@nice2dev/game-engine 1.3.14 → 1.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (434) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/accessibility/Accessibility.js +152 -165
  3. package/dist/cjs/ai/AI.js +292 -294
  4. package/dist/cjs/ai/BehaviorTree.js +1029 -1113
  5. package/dist/cjs/ai/StateMachine.js +694 -756
  6. package/dist/cjs/animation/Animation.js +232 -241
  7. package/dist/cjs/audio/AudioAdvanced.js +221 -236
  8. package/dist/cjs/audio/AudioBridge.js +441 -435
  9. package/dist/cjs/audio/AudioManager.js +242 -259
  10. package/dist/cjs/build-cloud/BuildOrchestration.js +1059 -1098
  11. package/dist/cjs/build-cloud/GodotBuildCloud.js +641 -670
  12. package/dist/cjs/build-cloud/UnityBuildCloud.js +563 -610
  13. package/dist/cjs/build-cloud/UnrealBuildCloud.js +610 -635
  14. package/dist/cjs/core/EventBus.js +51 -56
  15. package/dist/cjs/core/GameClock.js +62 -66
  16. package/dist/cjs/core/GameConfig.js +72 -79
  17. package/dist/cjs/core/GameLoop.js +80 -89
  18. package/dist/cjs/core/ServiceLocator.js +61 -65
  19. package/dist/cjs/core/Validation.js +72 -82
  20. package/dist/cjs/core/math.js +108 -112
  21. package/dist/cjs/devtools/DevTools.js +542 -563
  22. package/dist/cjs/devtools/DeveloperExperience.js +521 -559
  23. package/dist/cjs/devtools/GameplayAnalytics.js +636 -646
  24. package/dist/cjs/dialogue/DialogueSystem.js +984 -986
  25. package/dist/cjs/docs/DocGenerator.js +339 -364
  26. package/dist/cjs/ecs/World.js +355 -371
  27. package/dist/cjs/editor/AchievementEditor.js +580 -636
  28. package/dist/cjs/editor/AdvancedEditor.js +184 -191
  29. package/dist/cjs/editor/AnimationRetargeting.js +696 -741
  30. package/dist/cjs/editor/AssetBrowser.js +1072 -1160
  31. package/dist/cjs/editor/AssetManager.js +187 -192
  32. package/dist/cjs/editor/ConsolePro.js +971 -1061
  33. package/dist/cjs/editor/CraftingEditor.js +680 -730
  34. package/dist/cjs/editor/DebugTools.js +187 -185
  35. package/dist/cjs/editor/DialogueSystem.js +844 -901
  36. package/dist/cjs/editor/LeaderboardSystem.js +429 -483
  37. package/dist/cjs/editor/NiceGameEditor.js +1903 -1201
  38. package/dist/cjs/editor/PrefabSystem.js +772 -838
  39. package/dist/cjs/editor/ProfilerPanel.js +649 -700
  40. package/dist/cjs/editor/QuestEditor.js +792 -839
  41. package/dist/cjs/editor/ReplaySystem.js +585 -634
  42. package/dist/cjs/editor/SceneEditor.js +176 -200
  43. package/dist/cjs/editor/ScreenshotMode.js +621 -688
  44. package/dist/cjs/editor/ShaderGraph.js +1556 -1582
  45. package/dist/cjs/editor/TimelineEditor.js +715 -778
  46. package/dist/cjs/editor/UndoRedoPro.js +830 -904
  47. package/dist/cjs/editor/VRARMode.js +582 -645
  48. package/dist/cjs/engine/NiceGameEngine.js +141 -164
  49. package/dist/cjs/engine/SaveSystem.js +441 -495
  50. package/dist/cjs/enterprise/Enterprise.js +254 -261
  51. package/dist/cjs/export/BevyExporter.js +927 -967
  52. package/dist/cjs/export/CocosExporter.js +644 -673
  53. package/dist/cjs/export/Construct3Exporter.js +783 -794
  54. package/dist/cjs/export/DefoldExporter.js +1028 -1069
  55. package/dist/cjs/export/GDevelopExporter.js +674 -708
  56. package/dist/cjs/export/GameMakerExporter.js +791 -805
  57. package/dist/cjs/export/GodotExporter.js +1003 -1045
  58. package/dist/cjs/export/MinecraftBedrockExporter.js +573 -578
  59. package/dist/cjs/export/MonoGameExporter.js +1265 -1293
  60. package/dist/cjs/export/Pico8Exporter.js +766 -812
  61. package/dist/cjs/export/PlatformExporter.js +188 -206
  62. package/dist/cjs/export/RPGMakerExporter.js +860 -879
  63. package/dist/cjs/export/RobloxExporter.js +883 -919
  64. package/dist/cjs/export/Solar2DExporter.js +1218 -1256
  65. package/dist/cjs/export/ThreeJSExporter.js +1006 -1073
  66. package/dist/cjs/export/Tic80Exporter.js +1210 -1267
  67. package/dist/cjs/export/UnityExporter.js +1116 -1131
  68. package/dist/cjs/export/UnrealExporter.js +889 -919
  69. package/dist/cjs/export/WebExporter.js +931 -970
  70. package/dist/cjs/export/index.js +42 -65
  71. package/dist/cjs/godot-integration/GodotAssetLibrary.js +659 -692
  72. package/dist/cjs/godot-integration/GodotImport.js +929 -1027
  73. package/dist/cjs/godot-integration/GodotLiveLink.js +915 -945
  74. package/dist/cjs/godot-integration/components/GodotProjectBrowser.js +911 -611
  75. package/dist/cjs/i18n/I18n.js +860 -900
  76. package/dist/cjs/i18n/useTranslation.js +84 -89
  77. package/dist/cjs/import/AsepriteImporter.js +658 -716
  78. package/dist/cjs/import/DragonBonesImporter.js +437 -461
  79. package/dist/cjs/import/GameMakerImporter.js +511 -521
  80. package/dist/cjs/import/GodotSceneImporter.js +788 -822
  81. package/dist/cjs/import/LDtkImporter.js +436 -454
  82. package/dist/cjs/import/Live2DImporter.js +497 -518
  83. package/dist/cjs/import/NdgFormat.js +424 -457
  84. package/dist/cjs/import/OgmoImporter.js +466 -493
  85. package/dist/cjs/import/RPGMakerImporter.js +451 -477
  86. package/dist/cjs/import/SceneImporter.js +378 -423
  87. package/dist/cjs/import/SpineImporter.js +511 -546
  88. package/dist/cjs/import/SpriterImporter.js +590 -613
  89. package/dist/cjs/import/TiledMapImporter.js +811 -846
  90. package/dist/cjs/import/UnitySceneImporter.js +687 -703
  91. package/dist/cjs/import/index.js +206 -251
  92. package/dist/cjs/index.js +275 -278
  93. package/dist/cjs/input/GamepadNavigation.js +185 -205
  94. package/dist/cjs/input/InputManager.js +397 -421
  95. package/dist/cjs/input/useGamepads.js +70 -81
  96. package/dist/cjs/integration/IconSprite.js +129 -256
  97. package/dist/cjs/inventory/InventorySystem.js +920 -995
  98. package/dist/cjs/kids/KidMode.js +997 -1022
  99. package/dist/cjs/kids/KidTools.js +570 -594
  100. package/dist/cjs/monetization/Monetization.js +170 -177
  101. package/dist/cjs/multiplayer/LocalMultiplayer.js +287 -287
  102. package/dist/cjs/multiplayer/MiniGameTypes.js +49 -59
  103. package/dist/cjs/native-engine/AnimationSystem.js +731 -806
  104. package/dist/cjs/native-engine/AssetPipeline.js +454 -515
  105. package/dist/cjs/native-engine/AudioEngine.js +763 -804
  106. package/dist/cjs/native-engine/InputSystem.js +1075 -1145
  107. package/dist/cjs/native-engine/NetworkingSystem.js +733 -793
  108. package/dist/cjs/native-engine/PhysicsEngine.js +583 -607
  109. package/dist/cjs/native-engine/RenderingEngine.js +302 -350
  110. package/dist/cjs/native-engine/SceneGraph.js +769 -808
  111. package/dist/cjs/network/MultiplayerTransport.js +97 -132
  112. package/dist/cjs/network/Networking.js +549 -564
  113. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/AbortController.js +21 -29
  114. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/AccessTokenHttpClient.js +40 -48
  115. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js +35 -43
  116. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js +10 -15
  117. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Errors.js +103 -135
  118. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js +131 -158
  119. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js +39 -53
  120. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HeaderNames.js +5 -8
  121. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HttpClient.js +40 -48
  122. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js +494 -572
  123. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HubConnection.js +826 -953
  124. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js +125 -146
  125. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js +13 -23
  126. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/ILogger.js +11 -25
  127. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/ITransport.js +13 -24
  128. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js +108 -121
  129. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Loggers.js +10 -14
  130. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js +150 -185
  131. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/MessageBuffer.js +158 -196
  132. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js +90 -105
  133. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Subject.js +30 -35
  134. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js +16 -21
  135. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Utils.js +215 -248
  136. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js +135 -157
  137. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js +76 -85
  138. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/index.js +24 -27
  139. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/pkg-version.js +3 -4
  140. package/dist/cjs/pathfinding/Pathfinding.js +245 -263
  141. package/dist/cjs/performance/AssetStreaming.js +561 -635
  142. package/dist/cjs/performance/BenchmarkSuite.js +283 -311
  143. package/dist/cjs/performance/DeltaCompression.js +467 -526
  144. package/dist/cjs/performance/DeterministicPhysics.js +450 -498
  145. package/dist/cjs/performance/ECSOptimization.js +644 -695
  146. package/dist/cjs/performance/GameSaveSystem.js +509 -556
  147. package/dist/cjs/performance/HotReload.js +447 -500
  148. package/dist/cjs/performance/InputRecording.js +511 -561
  149. package/dist/cjs/performance/InterestManagement.js +453 -500
  150. package/dist/cjs/performance/LocalizationRuntime.js +376 -423
  151. package/dist/cjs/performance/MemoryManagement.js +410 -470
  152. package/dist/cjs/performance/ModSupport.js +445 -496
  153. package/dist/cjs/performance/MultiThreadedPhysics.js +400 -443
  154. package/dist/cjs/performance/NetworkPrediction.js +424 -482
  155. package/dist/cjs/performance/ObjectPooling.js +569 -617
  156. package/dist/cjs/performance/Performance.js +174 -190
  157. package/dist/cjs/performance/PerformanceAdvanced.js +614 -637
  158. package/dist/cjs/performance/WebGPURenderer.js +656 -683
  159. package/dist/cjs/physics/PhysicsAdvanced.js +345 -379
  160. package/dist/cjs/physics/PhysicsEngine2D.js +391 -427
  161. package/dist/cjs/plugins/PluginSDK.js +432 -466
  162. package/dist/cjs/plugins/PluginTestKit.js +307 -330
  163. package/dist/cjs/procedural/Procedural.js +243 -254
  164. package/dist/cjs/procedural/WorldBuilding.js +297 -314
  165. package/dist/cjs/quest/QuestSystem.js +975 -932
  166. package/dist/cjs/release/MobileExport.js +157 -163
  167. package/dist/cjs/release/Release.js +225 -238
  168. package/dist/cjs/rendering/Camera2D.js +121 -124
  169. package/dist/cjs/rendering/Renderer2D.js +321 -335
  170. package/dist/cjs/rendering/WebGPURenderPipeline.js +632 -651
  171. package/dist/cjs/runtime3d/Runtime3D.js +359 -378
  172. package/dist/cjs/runtime3d/SceneEditor3D.js +252 -263
  173. package/dist/cjs/scene/SceneManager.js +177 -193
  174. package/dist/cjs/scripting/GraphToAST.js +574 -547
  175. package/dist/cjs/scripting/LanguageExporter.js +254 -279
  176. package/dist/cjs/scripting/NodeGraph.js +546 -570
  177. package/dist/cjs/scripting/ScriptAST.js +31 -39
  178. package/dist/cjs/scripting/VisualScripting2.js +1016 -1065
  179. package/dist/cjs/scripting/exporters/CSharpExporter.js +464 -496
  180. package/dist/cjs/scripting/exporters/GDScriptExporter.js +390 -442
  181. package/dist/cjs/scripting/exporters/LuaExporter.js +406 -447
  182. package/dist/cjs/scripting/exporters/PythonExporter.js +484 -549
  183. package/dist/cjs/scripting/exporters/RustExporter.js +459 -512
  184. package/dist/cjs/scripting/exporters/TypeScriptExporter.js +505 -556
  185. package/dist/cjs/social/Social.js +72 -80
  186. package/dist/cjs/systems/LightingSystem.js +844 -931
  187. package/dist/cjs/systems/ParticleSystem2.js +1447 -1451
  188. package/dist/cjs/systems/PhysicsDebugSystem.js +1070 -1141
  189. package/dist/cjs/systems/TerrainSystem.js +985 -1098
  190. package/dist/cjs/templates/ActionTemplates.js +296 -309
  191. package/dist/cjs/templates/FightingTemplate.js +417 -463
  192. package/dist/cjs/templates/MetroidvaniaTemplate.js +353 -405
  193. package/dist/cjs/templates/PartyTemplates.js +190 -202
  194. package/dist/cjs/templates/PuzzleTemplates.js +245 -261
  195. package/dist/cjs/templates/RPGTemplates.js +160 -178
  196. package/dist/cjs/templates/SportsTemplates.js +237 -250
  197. package/dist/cjs/templates/StrategyTemplates.js +143 -153
  198. package/dist/cjs/templates/SurvivalTemplate.js +336 -380
  199. package/dist/cjs/templates/WaveDefense.js +499 -526
  200. package/dist/cjs/tilemap/Tilemap.js +207 -214
  201. package/dist/cjs/tutorials/TutorialBranching.js +396 -417
  202. package/dist/cjs/tutorials/TutorialEngine.js +888 -931
  203. package/dist/cjs/tutorials/TutorialOverlay.js +602 -640
  204. package/dist/cjs/tutorials/content/Tutorials_T05_T08.js +787 -809
  205. package/dist/cjs/tutorials/content/Tutorials_T09_T11.js +736 -756
  206. package/dist/cjs/tutorials/content/Tutorials_T12_T15.js +754 -778
  207. package/dist/cjs/ui/GameUI.js +295 -312
  208. package/dist/cjs/unity-integration/UnityAssetStore.js +700 -741
  209. package/dist/cjs/unity-integration/UnityImport.js +1066 -1176
  210. package/dist/cjs/unity-integration/UnityLiveLink.js +934 -981
  211. package/dist/cjs/unity-integration/components/UnityAssetStoreBrowser.js +1233 -757
  212. package/dist/cjs/unity-integration/components/UnityProjectBrowser.js +1240 -768
  213. package/dist/cjs/unreal-integration/UnrealImport.js +391 -412
  214. package/dist/cjs/unreal-integration/UnrealLiveLink.js +1102 -1137
  215. package/dist/cjs/unreal-integration/UnrealMarketplace.js +436 -473
  216. package/dist/cjs/unreal-integration/components/UnrealProjectBrowser.js +1150 -767
  217. package/dist/cjs/xr/ARVR.js +167 -175
  218. package/dist/esm/accessibility/Accessibility.js +160 -164
  219. package/dist/esm/ai/AI.js +310 -293
  220. package/dist/esm/ai/BehaviorTree.js +1057 -1112
  221. package/dist/esm/ai/StateMachine.js +709 -755
  222. package/dist/esm/animation/Animation.js +237 -240
  223. package/dist/esm/audio/AudioAdvanced.js +239 -235
  224. package/dist/esm/audio/AudioBridge.js +448 -434
  225. package/dist/esm/audio/AudioManager.js +243 -258
  226. package/dist/esm/build-cloud/BuildOrchestration.js +1071 -1097
  227. package/dist/esm/build-cloud/GodotBuildCloud.js +647 -669
  228. package/dist/esm/build-cloud/UnityBuildCloud.js +571 -609
  229. package/dist/esm/build-cloud/UnrealBuildCloud.js +615 -634
  230. package/dist/esm/core/EventBus.js +52 -55
  231. package/dist/esm/core/GameClock.js +63 -65
  232. package/dist/esm/core/GameConfig.js +77 -78
  233. package/dist/esm/core/GameLoop.js +81 -88
  234. package/dist/esm/core/ServiceLocator.js +63 -64
  235. package/dist/esm/core/Validation.js +82 -81
  236. package/dist/esm/core/math.js +109 -111
  237. package/dist/esm/devtools/DevTools.js +546 -562
  238. package/dist/esm/devtools/DeveloperExperience.js +535 -558
  239. package/dist/esm/devtools/GameplayAnalytics.js +647 -645
  240. package/dist/esm/dialogue/DialogueSystem.js +998 -985
  241. package/dist/esm/docs/DocGenerator.js +342 -363
  242. package/dist/esm/ecs/World.js +358 -370
  243. package/dist/esm/editor/AchievementEditor.js +584 -635
  244. package/dist/esm/editor/AdvancedEditor.js +191 -190
  245. package/dist/esm/editor/AnimationRetargeting.js +700 -740
  246. package/dist/esm/editor/AssetBrowser.js +1078 -1159
  247. package/dist/esm/editor/AssetManager.js +188 -191
  248. package/dist/esm/editor/ConsolePro.js +977 -1060
  249. package/dist/esm/editor/CraftingEditor.js +684 -729
  250. package/dist/esm/editor/DebugTools.js +194 -184
  251. package/dist/esm/editor/DialogueSystem.js +849 -900
  252. package/dist/esm/editor/LeaderboardSystem.js +433 -482
  253. package/dist/esm/editor/NiceGameEditor.js +1908 -1200
  254. package/dist/esm/editor/PrefabSystem.js +777 -837
  255. package/dist/esm/editor/ProfilerPanel.js +654 -699
  256. package/dist/esm/editor/QuestEditor.js +795 -838
  257. package/dist/esm/editor/ReplaySystem.js +591 -633
  258. package/dist/esm/editor/SceneEditor.js +189 -199
  259. package/dist/esm/editor/ScreenshotMode.js +628 -687
  260. package/dist/esm/editor/ShaderGraph.js +1565 -1581
  261. package/dist/esm/editor/TimelineEditor.js +733 -777
  262. package/dist/esm/editor/UndoRedoPro.js +835 -903
  263. package/dist/esm/editor/VRARMode.js +586 -644
  264. package/dist/esm/engine/NiceGameEngine.js +142 -163
  265. package/dist/esm/engine/SaveSystem.js +447 -494
  266. package/dist/esm/enterprise/Enterprise.js +265 -260
  267. package/dist/esm/export/BevyExporter.js +929 -966
  268. package/dist/esm/export/CocosExporter.js +646 -672
  269. package/dist/esm/export/Construct3Exporter.js +785 -793
  270. package/dist/esm/export/DefoldExporter.js +1030 -1068
  271. package/dist/esm/export/GDevelopExporter.js +676 -707
  272. package/dist/esm/export/GameMakerExporter.js +793 -804
  273. package/dist/esm/export/GodotExporter.js +1004 -1044
  274. package/dist/esm/export/MinecraftBedrockExporter.js +575 -577
  275. package/dist/esm/export/MonoGameExporter.js +1267 -1292
  276. package/dist/esm/export/Pico8Exporter.js +768 -811
  277. package/dist/esm/export/PlatformExporter.js +193 -205
  278. package/dist/esm/export/RPGMakerExporter.js +862 -878
  279. package/dist/esm/export/RobloxExporter.js +885 -918
  280. package/dist/esm/export/Solar2DExporter.js +1220 -1255
  281. package/dist/esm/export/ThreeJSExporter.js +1007 -1072
  282. package/dist/esm/export/Tic80Exporter.js +1212 -1266
  283. package/dist/esm/export/UnityExporter.js +1117 -1130
  284. package/dist/esm/export/UnrealExporter.js +891 -918
  285. package/dist/esm/export/WebExporter.js +933 -969
  286. package/dist/esm/export/index.js +86 -71
  287. package/dist/esm/godot-integration/GodotAssetLibrary.js +663 -691
  288. package/dist/esm/godot-integration/GodotImport.js +935 -1026
  289. package/dist/esm/godot-integration/GodotLiveLink.js +918 -944
  290. package/dist/esm/godot-integration/components/GodotProjectBrowser.js +912 -610
  291. package/dist/esm/i18n/I18n.js +871 -899
  292. package/dist/esm/i18n/useTranslation.js +88 -88
  293. package/dist/esm/import/AsepriteImporter.js +637 -715
  294. package/dist/esm/import/DragonBonesImporter.js +417 -460
  295. package/dist/esm/import/GameMakerImporter.js +491 -520
  296. package/dist/esm/import/GodotSceneImporter.js +767 -821
  297. package/dist/esm/import/LDtkImporter.js +415 -453
  298. package/dist/esm/import/Live2DImporter.js +477 -517
  299. package/dist/esm/import/NdgFormat.js +410 -456
  300. package/dist/esm/import/OgmoImporter.js +446 -492
  301. package/dist/esm/import/RPGMakerImporter.js +431 -476
  302. package/dist/esm/import/SceneImporter.js +385 -422
  303. package/dist/esm/import/SpineImporter.js +491 -545
  304. package/dist/esm/import/SpriterImporter.js +570 -612
  305. package/dist/esm/import/TiledMapImporter.js +790 -845
  306. package/dist/esm/import/UnitySceneImporter.js +666 -702
  307. package/dist/esm/import/index.js +247 -258
  308. package/dist/esm/index.js +1332 -188
  309. package/dist/esm/input/GamepadNavigation.js +187 -204
  310. package/dist/esm/input/InputManager.js +401 -420
  311. package/dist/esm/input/useGamepads.js +72 -80
  312. package/dist/esm/integration/IconSprite.js +143 -255
  313. package/dist/esm/inventory/InventorySystem.js +925 -994
  314. package/dist/esm/kids/KidMode.js +1003 -1021
  315. package/dist/esm/kids/KidTools.js +573 -593
  316. package/dist/esm/monetization/Monetization.js +180 -176
  317. package/dist/esm/multiplayer/LocalMultiplayer.js +290 -286
  318. package/dist/esm/multiplayer/MiniGameTypes.js +58 -58
  319. package/dist/esm/native-engine/AnimationSystem.js +735 -805
  320. package/dist/esm/native-engine/AssetPipeline.js +456 -514
  321. package/dist/esm/native-engine/AudioEngine.js +765 -803
  322. package/dist/esm/native-engine/InputSystem.js +1079 -1144
  323. package/dist/esm/native-engine/NetworkingSystem.js +740 -792
  324. package/dist/esm/native-engine/PhysicsEngine.js +585 -606
  325. package/dist/esm/native-engine/RenderingEngine.js +304 -349
  326. package/dist/esm/native-engine/SceneGraph.js +773 -807
  327. package/dist/esm/network/MultiplayerTransport.js +99 -131
  328. package/dist/esm/network/Networking.js +556 -563
  329. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/AbortController.js +22 -28
  330. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/AccessTokenHttpClient.js +41 -47
  331. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js +36 -42
  332. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js +11 -14
  333. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Errors.js +111 -134
  334. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js +132 -157
  335. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js +40 -52
  336. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HeaderNames.js +6 -7
  337. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HttpClient.js +42 -47
  338. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js +496 -571
  339. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HubConnection.js +828 -952
  340. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js +126 -145
  341. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js +14 -23
  342. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/ILogger.js +12 -25
  343. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/ITransport.js +15 -24
  344. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js +109 -120
  345. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Loggers.js +11 -13
  346. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js +151 -184
  347. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/MessageBuffer.js +159 -195
  348. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js +91 -104
  349. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Subject.js +31 -34
  350. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js +17 -20
  351. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Utils.js +230 -248
  352. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js +136 -156
  353. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js +77 -84
  354. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/index.js +31 -12
  355. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/pkg-version.js +4 -3
  356. package/dist/esm/pathfinding/Pathfinding.js +249 -262
  357. package/dist/esm/performance/AssetStreaming.js +567 -634
  358. package/dist/esm/performance/BenchmarkSuite.js +285 -310
  359. package/dist/esm/performance/DeltaCompression.js +478 -525
  360. package/dist/esm/performance/DeterministicPhysics.js +479 -497
  361. package/dist/esm/performance/ECSOptimization.js +653 -694
  362. package/dist/esm/performance/GameSaveSystem.js +515 -555
  363. package/dist/esm/performance/HotReload.js +454 -499
  364. package/dist/esm/performance/InputRecording.js +520 -560
  365. package/dist/esm/performance/InterestManagement.js +460 -499
  366. package/dist/esm/performance/LocalizationRuntime.js +382 -422
  367. package/dist/esm/performance/MemoryManagement.js +415 -469
  368. package/dist/esm/performance/ModSupport.js +455 -495
  369. package/dist/esm/performance/MultiThreadedPhysics.js +408 -442
  370. package/dist/esm/performance/NetworkPrediction.js +436 -481
  371. package/dist/esm/performance/ObjectPooling.js +582 -616
  372. package/dist/esm/performance/Performance.js +182 -189
  373. package/dist/esm/performance/PerformanceAdvanced.js +621 -636
  374. package/dist/esm/performance/WebGPURenderer.js +660 -682
  375. package/dist/esm/physics/PhysicsAdvanced.js +359 -378
  376. package/dist/esm/physics/PhysicsEngine2D.js +393 -426
  377. package/dist/esm/plugins/PluginSDK.js +435 -465
  378. package/dist/esm/plugins/PluginTestKit.js +315 -329
  379. package/dist/esm/procedural/Procedural.js +248 -253
  380. package/dist/esm/procedural/WorldBuilding.js +316 -313
  381. package/dist/esm/quest/QuestSystem.js +982 -931
  382. package/dist/esm/release/MobileExport.js +163 -162
  383. package/dist/esm/release/Release.js +234 -237
  384. package/dist/esm/rendering/Camera2D.js +122 -123
  385. package/dist/esm/rendering/Renderer2D.js +323 -334
  386. package/dist/esm/rendering/WebGPURenderPipeline.js +647 -650
  387. package/dist/esm/runtime3d/Runtime3D.js +368 -377
  388. package/dist/esm/runtime3d/SceneEditor3D.js +268 -262
  389. package/dist/esm/scene/SceneManager.js +178 -192
  390. package/dist/esm/scripting/GraphToAST.js +576 -546
  391. package/dist/esm/scripting/LanguageExporter.js +263 -278
  392. package/dist/esm/scripting/NodeGraph.js +550 -569
  393. package/dist/esm/scripting/ScriptAST.js +45 -38
  394. package/dist/esm/scripting/VisualScripting2.js +1025 -1064
  395. package/dist/esm/scripting/exporters/CSharpExporter.js +465 -495
  396. package/dist/esm/scripting/exporters/GDScriptExporter.js +391 -441
  397. package/dist/esm/scripting/exporters/LuaExporter.js +407 -446
  398. package/dist/esm/scripting/exporters/PythonExporter.js +485 -548
  399. package/dist/esm/scripting/exporters/RustExporter.js +460 -511
  400. package/dist/esm/scripting/exporters/TypeScriptExporter.js +506 -555
  401. package/dist/esm/social/Social.js +77 -79
  402. package/dist/esm/systems/LightingSystem.js +855 -930
  403. package/dist/esm/systems/ParticleSystem2.js +1453 -1450
  404. package/dist/esm/systems/PhysicsDebugSystem.js +1078 -1140
  405. package/dist/esm/systems/TerrainSystem.js +996 -1097
  406. package/dist/esm/templates/ActionTemplates.js +307 -308
  407. package/dist/esm/templates/FightingTemplate.js +439 -462
  408. package/dist/esm/templates/MetroidvaniaTemplate.js +391 -404
  409. package/dist/esm/templates/PartyTemplates.js +206 -201
  410. package/dist/esm/templates/PuzzleTemplates.js +260 -260
  411. package/dist/esm/templates/RPGTemplates.js +172 -177
  412. package/dist/esm/templates/SportsTemplates.js +251 -249
  413. package/dist/esm/templates/StrategyTemplates.js +158 -152
  414. package/dist/esm/templates/SurvivalTemplate.js +367 -379
  415. package/dist/esm/templates/WaveDefense.js +501 -525
  416. package/dist/esm/tilemap/Tilemap.js +209 -213
  417. package/dist/esm/tutorials/TutorialBranching.js +399 -416
  418. package/dist/esm/tutorials/TutorialEngine.js +893 -930
  419. package/dist/esm/tutorials/TutorialOverlay.js +603 -639
  420. package/dist/esm/tutorials/content/Tutorials_T05_T08.js +792 -808
  421. package/dist/esm/tutorials/content/Tutorials_T09_T11.js +740 -755
  422. package/dist/esm/tutorials/content/Tutorials_T12_T15.js +759 -777
  423. package/dist/esm/ui/GameUI.js +296 -311
  424. package/dist/esm/unity-integration/UnityAssetStore.js +704 -740
  425. package/dist/esm/unity-integration/UnityImport.js +1071 -1175
  426. package/dist/esm/unity-integration/UnityLiveLink.js +938 -980
  427. package/dist/esm/unity-integration/components/UnityAssetStoreBrowser.js +1234 -756
  428. package/dist/esm/unity-integration/components/UnityProjectBrowser.js +1241 -767
  429. package/dist/esm/unreal-integration/UnrealImport.js +395 -411
  430. package/dist/esm/unreal-integration/UnrealLiveLink.js +1105 -1136
  431. package/dist/esm/unreal-integration/UnrealMarketplace.js +442 -472
  432. package/dist/esm/unreal-integration/components/UnrealProjectBrowser.js +1151 -766
  433. package/dist/esm/xr/ARVR.js +181 -174
  434. package/package.json +7 -12
@@ -1,831 +1,820 @@
1
- 'use strict';
2
-
3
- var PlatformExporter = require('./PlatformExporter.js');
4
-
5
- /* ────────────────────────────────────────────────────────────────
6
- Construct 3 Exporter — C3P Project Export
7
-
8
- Exports Nice2Dev projects to Construct 3 format:
9
- - Project files (.c3proj)
10
- - Layout files (.json)
11
- - Event sheets (.json)
12
- - JavaScript addons
13
- - Object types
14
- ──────────────────────────────────────────────────────────────── */
15
- /* ── UUID Generator ───────────────────────────────────────────── */
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const PlatformExporter = require("./PlatformExporter.js");
16
4
  function generateC3UID() {
17
- return 'c3-' + Math.random().toString(36).substr(2, 9);
5
+ return "c3-" + Math.random().toString(36).substr(2, 9);
18
6
  }
19
- /* ── Construct 3 Component Mappings ───────────────────────────── */
20
7
  const C3_BEHAVIOR_MAP = {
21
- rigidbody: {
22
- behavior: 'Physics',
23
- properties: {
24
- mass: 'mass',
25
- linearDamping: 'linearDamping',
26
- angularDamping: 'angularDamping',
27
- },
28
- },
29
- movement: {
30
- behavior: 'EightDirection',
31
- properties: {
32
- speed: 'maxSpeed',
33
- acceleration: 'acceleration',
34
- deceleration: 'deceleration',
8
+ rigidbody: {
9
+ behavior: "Physics",
10
+ properties: {
11
+ mass: "mass",
12
+ linearDamping: "linearDamping",
13
+ angularDamping: "angularDamping"
14
+ }
15
+ },
16
+ movement: {
17
+ behavior: "EightDirection",
18
+ properties: {
19
+ speed: "maxSpeed",
20
+ acceleration: "acceleration",
21
+ deceleration: "deceleration"
22
+ }
23
+ },
24
+ platformer: {
25
+ behavior: "Platform",
26
+ properties: {
27
+ speed: "maxSpeed",
28
+ jumpStrength: "jumpStrength",
29
+ gravity: "gravity"
30
+ }
31
+ },
32
+ bullet: {
33
+ behavior: "Bullet",
34
+ properties: {
35
+ speed: "speed",
36
+ acceleration: "acceleration"
37
+ }
38
+ },
39
+ solid: {
40
+ behavior: "Solid",
41
+ properties: {}
42
+ },
43
+ timer: {
44
+ behavior: "Timer",
45
+ properties: {}
46
+ },
47
+ fade: {
48
+ behavior: "Fade",
49
+ properties: {
50
+ fadeInTime: "fadeInTime",
51
+ fadeOutTime: "fadeOutTime"
52
+ }
53
+ }
54
+ };
55
+ class Construct3Exporter extends PlatformExporter.PlatformExporter {
56
+ constructor() {
57
+ super(...arguments);
58
+ this.platformId = "construct3";
59
+ this.platformInfo = {
60
+ id: "construct3",
61
+ name: "Construct 3",
62
+ description: "Construct 3 - visual game development environment with JavaScript scripting",
63
+ website: "https://www.construct.net/",
64
+ features: [
65
+ "2d-rendering",
66
+ "physics-2d",
67
+ "audio",
68
+ "particles",
69
+ "ui-system",
70
+ "tilemaps",
71
+ "animation"
72
+ ],
73
+ supportedAssets: [
74
+ "texture",
75
+ "audio",
76
+ "tilemap",
77
+ "animation",
78
+ "prefab",
79
+ "scene",
80
+ "data",
81
+ "script"
82
+ ],
83
+ exportFormats: [".c3p", ".c3proj", ".json"]
84
+ };
85
+ this.projectId = "";
86
+ this.uidCounter = 0;
87
+ }
88
+ async doExport(project, options) {
89
+ this.projectId = generateC3UID();
90
+ this.uidCounter = 0;
91
+ const platformOpts = options.platformOptions ?? {};
92
+ if (platformOpts.exportAsAddon) {
93
+ await this.exportAsAddon(project, options);
94
+ } else {
95
+ await this.exportAsProject(project, options);
96
+ }
97
+ }
98
+ /* ── Full Project Export ────────────────────────────────────── */
99
+ async exportAsProject(project, options) {
100
+ (options.projectName ?? project.name).replace(/[^a-zA-Z0-9]/g, "");
101
+ const c3Project = this.generateProjectFile(project, options);
102
+ this.addTextFile("project.c3proj", JSON.stringify(c3Project, null, " "));
103
+ await this.generateObjectTypes(project, options);
104
+ for (const scene of project.scenes) {
105
+ await this.exportLayout(scene, project, options);
106
+ }
107
+ for (const scene of project.scenes) {
108
+ await this.generateEventSheet(scene, project, options);
109
+ }
110
+ await this.generateScripts(project, options);
111
+ await this.generateReadme(project, options);
112
+ }
113
+ generateProjectFile(project, options) {
114
+ const safeName = (options.projectName ?? project.name).replace(/[^a-zA-Z0-9]/g, "");
115
+ const platformOpts = options.platformOptions ?? {};
116
+ const layouts = project.scenes.map((s) => s.name.replace(/[^a-zA-Z0-9_]/g, "_"));
117
+ const eventSheets = project.scenes.map(
118
+ (s) => `${s.name.replace(/[^a-zA-Z0-9_]/g, "_")}_Events`
119
+ );
120
+ const objectTypes = this.collectObjectTypes(project);
121
+ const usedAddons = [
122
+ { type: "plugin", id: "Sprite", name: "Sprite", author: "Scirra", bundled: false },
123
+ { type: "plugin", id: "Audio", name: "Audio", author: "Scirra", bundled: false },
124
+ { type: "plugin", id: "Keyboard", name: "Keyboard", author: "Scirra", bundled: false },
125
+ { type: "plugin", id: "Mouse", name: "Mouse", author: "Scirra", bundled: false },
126
+ { type: "plugin", id: "Touch", name: "Touch", author: "Scirra", bundled: false }
127
+ ];
128
+ if (platformOpts.useBuiltInPhysics !== false) {
129
+ usedAddons.push({
130
+ type: "behavior",
131
+ id: "Physics",
132
+ name: "Physics",
133
+ author: "Scirra",
134
+ bundled: false
135
+ });
136
+ }
137
+ return {
138
+ projectFormatVersion: 1,
139
+ savedWithRelease: 4e4,
140
+ name: safeName,
141
+ runtime: "c3",
142
+ useWorker: "auto",
143
+ bundleAddons: true,
144
+ usedAddons,
145
+ uniqueId: this.projectId,
146
+ objectTypes: { items: objectTypes, subfolders: [] },
147
+ containers: [],
148
+ families: { items: [], subfolders: [] },
149
+ layouts: { items: layouts, subfolders: [] },
150
+ eventSheets: { items: eventSheets, subfolders: [] },
151
+ rootFileFolders: {
152
+ script: { items: ["main.js", "importsForEvents.js"], subfolders: [] },
153
+ sound: { items: [], subfolders: [] },
154
+ music: { items: [], subfolders: [] },
155
+ video: { items: [], subfolders: [] },
156
+ font: { items: [], subfolders: [] },
157
+ icon: { items: [], subfolders: [] },
158
+ general: { items: [], subfolders: [] }
159
+ },
160
+ timelines: { items: [], subfolders: [] },
161
+ flowcharts: { items: [], subfolders: [] },
162
+ properties: {
163
+ description: `Generated from Nice2Dev project: ${project.name}`,
164
+ version: project.version,
165
+ author: "Nice2Dev",
166
+ authorEmail: "",
167
+ website: "https://nice2dev.com",
168
+ backgroundColour: [0, 0, 0],
169
+ splashColour: [0, 0, 0],
170
+ useThemeColour: false,
171
+ themeColour: [66, 133, 244],
172
+ orientations: "landscape",
173
+ webgpu: "auto",
174
+ gpuPreference: "high-performance",
175
+ scriptsType: "module",
176
+ framerateMode: "vsync",
177
+ compositingMode: "standard",
178
+ sampling: "trilinear",
179
+ downscaling: "medium",
180
+ maxSpriteSheetSize: 4096,
181
+ loaderStyle: "splash",
182
+ preloadSounds: "yes",
183
+ cordovaDirectory: "",
184
+ exportFileStructure: "folders"
185
+ },
186
+ viewportWidth: project.settings.resolution.width,
187
+ viewportHeight: project.settings.resolution.height,
188
+ firstLayout: layouts[0] ?? "Layout1"
189
+ };
190
+ }
191
+ collectObjectTypes(project) {
192
+ const types = /* @__PURE__ */ new Set();
193
+ types.add("Keyboard");
194
+ types.add("Mouse");
195
+ types.add("Touch");
196
+ types.add("Audio");
197
+ for (const scene of project.scenes) {
198
+ for (const entity of scene.entities) {
199
+ const typeName = (entity.name ?? entity.id).replace(/[^a-zA-Z0-9_]/g, "_");
200
+ types.add(typeName);
201
+ }
202
+ }
203
+ for (const prefab of project.prefabs) {
204
+ const typeName = prefab.name.replace(/[^a-zA-Z0-9_]/g, "_");
205
+ types.add(typeName);
206
+ }
207
+ return Array.from(types);
208
+ }
209
+ /* ── Object Types ───────────────────────────────────────────── */
210
+ async generateObjectTypes(project, options) {
211
+ this.addTextFile(
212
+ "objectTypes/Keyboard.json",
213
+ JSON.stringify(
214
+ {
215
+ c3object: true,
216
+ name: "Keyboard",
217
+ type: "world",
218
+ plugin: "Keyboard"
35
219
  },
36
- },
37
- platformer: {
38
- behavior: 'Platform',
39
- properties: {
40
- speed: 'maxSpeed',
41
- jumpStrength: 'jumpStrength',
42
- gravity: 'gravity',
220
+ null,
221
+ " "
222
+ )
223
+ );
224
+ this.addTextFile(
225
+ "objectTypes/Mouse.json",
226
+ JSON.stringify(
227
+ {
228
+ c3object: true,
229
+ name: "Mouse",
230
+ type: "world",
231
+ plugin: "Mouse"
43
232
  },
44
- },
45
- bullet: {
46
- behavior: 'Bullet',
47
- properties: {
48
- speed: 'speed',
49
- acceleration: 'acceleration',
233
+ null,
234
+ " "
235
+ )
236
+ );
237
+ this.addTextFile(
238
+ "objectTypes/Touch.json",
239
+ JSON.stringify(
240
+ {
241
+ c3object: true,
242
+ name: "Touch",
243
+ type: "world",
244
+ plugin: "Touch"
50
245
  },
51
- },
52
- solid: {
53
- behavior: 'Solid',
54
- properties: {},
55
- },
56
- timer: {
57
- behavior: 'Timer',
58
- properties: {},
59
- },
60
- fade: {
61
- behavior: 'Fade',
62
- properties: {
63
- fadeInTime: 'fadeInTime',
64
- fadeOutTime: 'fadeOutTime',
246
+ null,
247
+ " "
248
+ )
249
+ );
250
+ this.addTextFile(
251
+ "objectTypes/Audio.json",
252
+ JSON.stringify(
253
+ {
254
+ c3object: true,
255
+ name: "Audio",
256
+ type: "world",
257
+ plugin: "Audio"
65
258
  },
66
- },
67
- };
68
- /* ── Exporter Implementation ──────────────────────────────────── */
69
- class Construct3Exporter extends PlatformExporter.PlatformExporter {
70
- constructor() {
71
- super(...arguments);
72
- this.platformId = 'construct3';
73
- this.platformInfo = {
74
- id: 'construct3',
75
- name: 'Construct 3',
76
- description: 'Construct 3 - visual game development environment with JavaScript scripting',
77
- website: 'https://www.construct.net/',
78
- features: [
79
- '2d-rendering',
80
- 'physics-2d',
81
- 'audio',
82
- 'particles',
83
- 'ui-system',
84
- 'tilemaps',
85
- 'animation',
86
- ],
87
- supportedAssets: [
88
- 'texture',
89
- 'audio',
90
- 'tilemap',
91
- 'animation',
92
- 'prefab',
93
- 'scene',
94
- 'data',
95
- 'script',
96
- ],
97
- exportFormats: ['.c3p', '.c3proj', '.json'],
98
- };
99
- this.projectId = '';
100
- this.uidCounter = 0;
101
- }
102
- async doExport(project, options) {
103
- this.projectId = generateC3UID();
104
- this.uidCounter = 0;
105
- const platformOpts = options.platformOptions ?? {};
106
- if (platformOpts.exportAsAddon) {
107
- await this.exportAsAddon(project, options);
108
- }
109
- else {
110
- await this.exportAsProject(project, options);
259
+ null,
260
+ " "
261
+ )
262
+ );
263
+ const processedTypes = /* @__PURE__ */ new Set();
264
+ for (const scene of project.scenes) {
265
+ for (const entity of scene.entities) {
266
+ const typeName = (entity.name ?? entity.id).replace(/[^a-zA-Z0-9_]/g, "_");
267
+ if (processedTypes.has(typeName)) {
268
+ continue;
111
269
  }
270
+ processedTypes.add(typeName);
271
+ await this.generateObjectType(typeName, entity, options);
272
+ }
112
273
  }
113
- /* ── Full Project Export ────────────────────────────────────── */
114
- async exportAsProject(project, options) {
115
- (options.projectName ?? project.name).replace(/[^a-zA-Z0-9]/g, '');
116
- // Generate main project file
117
- const c3Project = this.generateProjectFile(project, options);
118
- this.addTextFile('project.c3proj', JSON.stringify(c3Project, null, '\t'));
119
- // Generate object types
120
- await this.generateObjectTypes(project, options);
121
- // Generate layouts (scenes)
122
- for (const scene of project.scenes) {
123
- await this.exportLayout(scene, project, options);
124
- }
125
- // Generate event sheets
126
- for (const scene of project.scenes) {
127
- await this.generateEventSheet(scene, project, options);
128
- }
129
- // Generate scripts
130
- await this.generateScripts(project, options);
131
- // Generate README
132
- await this.generateReadme(project, options);
274
+ for (const prefab of project.prefabs) {
275
+ const typeName = prefab.name.replace(/[^a-zA-Z0-9_]/g, "_");
276
+ if (processedTypes.has(typeName)) {
277
+ continue;
278
+ }
279
+ processedTypes.add(typeName);
280
+ await this.generateObjectType(typeName, prefab.entity, options);
133
281
  }
134
- generateProjectFile(project, options) {
135
- const safeName = (options.projectName ?? project.name).replace(/[^a-zA-Z0-9]/g, '');
136
- const platformOpts = options.platformOptions ?? {};
137
- const layouts = project.scenes.map((s) => s.name.replace(/[^a-zA-Z0-9_]/g, '_'));
138
- const eventSheets = project.scenes.map((s) => `${s.name.replace(/[^a-zA-Z0-9_]/g, '_')}_Events`);
139
- const objectTypes = this.collectObjectTypes(project);
140
- const usedAddons = [
141
- { type: 'plugin', id: 'Sprite', name: 'Sprite', author: 'Scirra', bundled: false },
142
- { type: 'plugin', id: 'Audio', name: 'Audio', author: 'Scirra', bundled: false },
143
- { type: 'plugin', id: 'Keyboard', name: 'Keyboard', author: 'Scirra', bundled: false },
144
- { type: 'plugin', id: 'Mouse', name: 'Mouse', author: 'Scirra', bundled: false },
145
- { type: 'plugin', id: 'Touch', name: 'Touch', author: 'Scirra', bundled: false },
146
- ];
147
- if (platformOpts.useBuiltInPhysics !== false) {
148
- usedAddons.push({
149
- type: 'behavior',
150
- id: 'Physics',
151
- name: 'Physics',
152
- author: 'Scirra',
153
- bundled: false,
154
- });
155
- }
156
- return {
157
- projectFormatVersion: 1,
158
- savedWithRelease: 40000,
159
- name: safeName,
160
- runtime: 'c3',
161
- useWorker: 'auto',
162
- bundleAddons: true,
163
- usedAddons,
164
- uniqueId: this.projectId,
165
- objectTypes: { items: objectTypes, subfolders: [] },
166
- containers: [],
167
- families: { items: [], subfolders: [] },
168
- layouts: { items: layouts, subfolders: [] },
169
- eventSheets: { items: eventSheets, subfolders: [] },
170
- rootFileFolders: {
171
- script: { items: ['main.js', 'importsForEvents.js'], subfolders: [] },
172
- sound: { items: [], subfolders: [] },
173
- music: { items: [], subfolders: [] },
174
- video: { items: [], subfolders: [] },
175
- font: { items: [], subfolders: [] },
176
- icon: { items: [], subfolders: [] },
177
- general: { items: [], subfolders: [] },
178
- },
179
- timelines: { items: [], subfolders: [] },
180
- flowcharts: { items: [], subfolders: [] },
181
- properties: {
182
- description: `Generated from Nice2Dev project: ${project.name}`,
183
- version: project.version,
184
- author: 'Nice2Dev',
185
- authorEmail: '',
186
- website: 'https://nice2dev.com',
187
- backgroundColour: [0, 0, 0],
188
- splashColour: [0, 0, 0],
189
- useThemeColour: false,
190
- themeColour: [66, 133, 244],
191
- orientations: 'landscape',
192
- webgpu: 'auto',
193
- gpuPreference: 'high-performance',
194
- scriptsType: 'module',
195
- framerateMode: 'vsync',
196
- compositingMode: 'standard',
197
- sampling: 'trilinear',
198
- downscaling: 'medium',
199
- maxSpriteSheetSize: 4096,
200
- loaderStyle: 'splash',
201
- preloadSounds: 'yes',
202
- cordovaDirectory: '',
203
- exportFileStructure: 'folders',
204
- },
205
- viewportWidth: project.settings.resolution.width,
206
- viewportHeight: project.settings.resolution.height,
207
- firstLayout: layouts[0] ?? 'Layout1',
282
+ }
283
+ async generateObjectType(typeName, entity, _options) {
284
+ const behaviors = {};
285
+ const instanceVariables = {};
286
+ for (const comp of entity.components) {
287
+ const mapping = C3_BEHAVIOR_MAP[comp.type];
288
+ if (mapping) {
289
+ behaviors[mapping.behavior] = {
290
+ behaviorType: mapping.behavior,
291
+ ...this.mapProperties(comp.properties ?? {}, mapping.properties)
208
292
  };
293
+ }
209
294
  }
210
- collectObjectTypes(project) {
211
- const types = new Set();
212
- // Add system objects
213
- types.add('Keyboard');
214
- types.add('Mouse');
215
- types.add('Touch');
216
- types.add('Audio');
217
- // Add entities as sprite types
218
- for (const scene of project.scenes) {
219
- for (const entity of scene.entities) {
220
- const typeName = (entity.name ?? entity.id).replace(/[^a-zA-Z0-9_]/g, '_');
221
- types.add(typeName);
222
- }
223
- }
224
- // Add prefabs
225
- for (const prefab of project.prefabs) {
226
- const typeName = prefab.name.replace(/[^a-zA-Z0-9_]/g, '_');
227
- types.add(typeName);
295
+ for (const tag of entity.tags ?? []) {
296
+ instanceVariables[`tag_${tag}`] = { type: "boolean", initialValue: true };
297
+ }
298
+ const objectType = {
299
+ c3object: true,
300
+ name: typeName,
301
+ type: "world",
302
+ plugin: "Sprite",
303
+ isGlobal: false,
304
+ isInteractive: true,
305
+ instanceVars: instanceVariables,
306
+ behaviors,
307
+ effectList: { list: [] },
308
+ defaultImageWidth: 64,
309
+ defaultImageHeight: 64,
310
+ animations: {
311
+ items: [
312
+ {
313
+ name: "Default",
314
+ speed: 5,
315
+ loop: true,
316
+ repeatCount: 1,
317
+ repeatTo: 0,
318
+ pingPong: false,
319
+ frames: [{ duration: 1 }]
320
+ }
321
+ ],
322
+ subfolders: []
323
+ }
324
+ };
325
+ this.addTextFile(`objectTypes/${typeName}.json`, JSON.stringify(objectType, null, " "));
326
+ }
327
+ mapProperties(props, mapping) {
328
+ const result = {};
329
+ for (const [from, to] of Object.entries(mapping)) {
330
+ if (props[from] !== void 0) {
331
+ result[to] = props[from];
332
+ }
333
+ }
334
+ return result;
335
+ }
336
+ /* ── Layout Export ──────────────────────────────────────────── */
337
+ async exportLayout(scene, project, _options) {
338
+ const layoutName = scene.name.replace(/[^a-zA-Z0-9_]/g, "_");
339
+ const layout = {
340
+ c3dtg: true,
341
+ name: layoutName,
342
+ width: project.settings.resolution.width,
343
+ height: project.settings.resolution.height,
344
+ unboundedScrolling: true,
345
+ originX: 0,
346
+ originY: 0,
347
+ eventSheet: `${layoutName}_Events`,
348
+ layers: [
349
+ {
350
+ name: "Main",
351
+ type: "layer",
352
+ index: 0,
353
+ isVisible: true,
354
+ isLocked: false,
355
+ initiallyVisible: true,
356
+ scrollRateX: 100,
357
+ scrollRateY: 100,
358
+ zElevation: 0,
359
+ parallaxX: 100,
360
+ parallaxY: 100,
361
+ opacity: 100,
362
+ forceOwnTexture: false,
363
+ ownTextureAlpha: false,
364
+ zIndex: 0,
365
+ blendMode: "normal",
366
+ effectList: { list: [] },
367
+ instances: scene.entities.map((entity) => this.entityToInstance(entity))
228
368
  }
229
- return Array.from(types);
369
+ ]
370
+ };
371
+ this.addTextFile(`layouts/${layoutName}.json`, JSON.stringify(layout, null, " "));
372
+ }
373
+ entityToInstance(entity) {
374
+ const pos = entity.position ?? { x: 0, y: 0 };
375
+ const scale = entity.scale ?? { x: 1, y: 1 };
376
+ const typeName = (entity.name ?? entity.id).replace(/[^a-zA-Z0-9_]/g, "_");
377
+ const behaviors = {};
378
+ for (const comp of entity.components) {
379
+ const mapping = C3_BEHAVIOR_MAP[comp.type];
380
+ if (mapping) {
381
+ behaviors[mapping.behavior] = this.mapProperties(comp.properties ?? {}, mapping.properties);
382
+ }
230
383
  }
231
- /* ── Object Types ───────────────────────────────────────────── */
232
- async generateObjectTypes(project, options) {
233
- // System objects
234
- this.addTextFile('objectTypes/Keyboard.json', JSON.stringify({
235
- c3object: true,
236
- name: 'Keyboard',
237
- type: 'world',
238
- plugin: 'Keyboard',
239
- }, null, '\t'));
240
- this.addTextFile('objectTypes/Mouse.json', JSON.stringify({
241
- c3object: true,
242
- name: 'Mouse',
243
- type: 'world',
244
- plugin: 'Mouse',
245
- }, null, '\t'));
246
- this.addTextFile('objectTypes/Touch.json', JSON.stringify({
247
- c3object: true,
248
- name: 'Touch',
249
- type: 'world',
250
- plugin: 'Touch',
251
- }, null, '\t'));
252
- this.addTextFile('objectTypes/Audio.json', JSON.stringify({
253
- c3object: true,
254
- name: 'Audio',
255
- type: 'world',
256
- plugin: 'Audio',
257
- }, null, '\t'));
258
- // Entity objects
259
- const processedTypes = new Set();
260
- for (const scene of project.scenes) {
261
- for (const entity of scene.entities) {
262
- const typeName = (entity.name ?? entity.id).replace(/[^a-zA-Z0-9_]/g, '_');
263
- if (processedTypes.has(typeName)) {
264
- continue;
265
- }
266
- processedTypes.add(typeName);
267
- await this.generateObjectType(typeName, entity, options);
384
+ return {
385
+ type: typeName,
386
+ uid: this.uidCounter++,
387
+ x: pos.x,
388
+ y: pos.y,
389
+ width: 64 * scale.x,
390
+ height: 64 * scale.y,
391
+ originX: 0.5,
392
+ originY: 0.5,
393
+ angle: entity.rotation ?? 0,
394
+ opacity: 100,
395
+ zElevation: 0,
396
+ colorRgb: [255, 255, 255],
397
+ blendMode: "normal",
398
+ effectList: { list: [] },
399
+ behaviors,
400
+ instVars: {}
401
+ };
402
+ }
403
+ /* ── Event Sheet ────────────────────────────────────────────── */
404
+ async generateEventSheet(scene, _project, _options) {
405
+ const sheetName = `${scene.name.replace(/[^a-zA-Z0-9_]/g, "_")}_Events`;
406
+ const eventSheet = {
407
+ c3eventsheet: true,
408
+ name: sheetName,
409
+ events: [
410
+ {
411
+ eventType: "comment",
412
+ children: void 0,
413
+ conditions: void 0,
414
+ actions: void 0
415
+ },
416
+ // On start of layout
417
+ {
418
+ eventType: "block",
419
+ conditions: [
420
+ {
421
+ id: "on-start-of-layout",
422
+ objectType: "System"
268
423
  }
269
- }
270
- // Prefab objects
271
- for (const prefab of project.prefabs) {
272
- const typeName = prefab.name.replace(/[^a-zA-Z0-9_]/g, '_');
273
- if (processedTypes.has(typeName)) {
274
- continue;
424
+ ],
425
+ actions: [
426
+ {
427
+ id: "log",
428
+ objectType: "System",
429
+ parameters: { message: `Scene ${scene.name} started` }
275
430
  }
276
- processedTypes.add(typeName);
277
- await this.generateObjectType(typeName, prefab.entity, options);
278
- }
279
- }
280
- async generateObjectType(typeName, entity, _options) {
281
- const behaviors = {};
282
- const instanceVariables = {};
283
- // Map components to behaviors
284
- for (const comp of entity.components) {
285
- const mapping = C3_BEHAVIOR_MAP[comp.type];
286
- if (mapping) {
287
- behaviors[mapping.behavior] = {
288
- behaviorType: mapping.behavior,
289
- ...this.mapProperties(comp.properties ?? {}, mapping.properties),
290
- };
431
+ ]
432
+ },
433
+ // Main loop
434
+ {
435
+ eventType: "block",
436
+ conditions: [
437
+ {
438
+ id: "every-tick",
439
+ objectType: "System"
291
440
  }
441
+ ],
442
+ actions: [],
443
+ children: this.generateEntityEvents(scene.entities)
292
444
  }
293
- // Add instance variables from tags
294
- for (const tag of entity.tags ?? []) {
295
- instanceVariables[`tag_${tag}`] = { type: 'boolean', initialValue: true };
296
- }
297
- const objectType = {
298
- c3object: true,
299
- name: typeName,
300
- type: 'world',
301
- plugin: 'Sprite',
302
- isGlobal: false,
303
- isInteractive: true,
304
- instanceVars: instanceVariables,
305
- behaviors,
306
- effectList: { list: [] },
307
- defaultImageWidth: 64,
308
- defaultImageHeight: 64,
309
- animations: {
310
- items: [
311
- {
312
- name: 'Default',
313
- speed: 5,
314
- loop: true,
315
- repeatCount: 1,
316
- repeatTo: 0,
317
- pingPong: false,
318
- frames: [{ duration: 1 }],
319
- },
320
- ],
321
- subfolders: [],
322
- },
323
- };
324
- this.addTextFile(`objectTypes/${typeName}.json`, JSON.stringify(objectType, null, '\t'));
445
+ ]
446
+ };
447
+ this.addTextFile(`eventSheets/${sheetName}.json`, JSON.stringify(eventSheet, null, " "));
448
+ }
449
+ generateEntityEvents(entities) {
450
+ const events = [];
451
+ for (const entity of entities) {
452
+ (entity.name ?? entity.id).replace(/[^a-zA-Z0-9_]/g, "_");
453
+ const hasMovement = entity.components.some((c) => c.type === "movement");
454
+ if (hasMovement) {
455
+ events.push({
456
+ eventType: "comment",
457
+ conditions: void 0,
458
+ actions: void 0,
459
+ children: void 0
460
+ });
461
+ }
325
462
  }
326
- mapProperties(props, mapping) {
327
- const result = {};
328
- for (const [from, to] of Object.entries(mapping)) {
329
- if (props[from] !== undefined) {
330
- result[to] = props[from];
331
- }
332
- }
333
- return result;
463
+ return events;
464
+ }
465
+ /* ── Scripts ────────────────────────────────────────────────── */
466
+ async generateScripts(project, _options) {
467
+ const mainScript = `// ${project.name} - Nice2Dev Export for Construct 3
468
+ // Generated automatically
469
+
470
+ // Runtime reference
471
+ const runtime = globalThis.runtime;
472
+
473
+ // Game state
474
+ const gameState = {
475
+ isPaused: false,
476
+ entities: new Map(),
477
+ globalVariables: new Map(),
478
+ };
479
+
480
+ // Settings from Nice2Dev
481
+ export const GameSettings = {
482
+ width: ${project.settings.resolution.width},
483
+ height: ${project.settings.resolution.height},
484
+ masterVolume: ${project.settings.audio.masterVolume},
485
+ physicsEnabled: ${project.settings.physics.enabled},
486
+ gravity: { x: ${project.settings.physics.gravity.x}, y: ${project.settings.physics.gravity.y} },
487
+ };
488
+
489
+ // Entity class
490
+ export class N2DEntity {
491
+ constructor(instance) {
492
+ this.instance = instance;
493
+ this.name = instance.objectType.name;
494
+ this.components = [];
495
+ this.tags = [];
334
496
  }
335
- /* ── Layout Export ──────────────────────────────────────────── */
336
- async exportLayout(scene, project, _options) {
337
- const layoutName = scene.name.replace(/[^a-zA-Z0-9_]/g, '_');
338
- const layout = {
339
- c3dtg: true,
340
- name: layoutName,
341
- width: project.settings.resolution.width,
342
- height: project.settings.resolution.height,
343
- unboundedScrolling: true,
344
- originX: 0,
345
- originY: 0,
346
- eventSheet: `${layoutName}_Events`,
347
- layers: [
348
- {
349
- name: 'Main',
350
- type: 'layer',
351
- index: 0,
352
- isVisible: true,
353
- isLocked: false,
354
- initiallyVisible: true,
355
- scrollRateX: 100,
356
- scrollRateY: 100,
357
- zElevation: 0,
358
- parallaxX: 100,
359
- parallaxY: 100,
360
- opacity: 100,
361
- forceOwnTexture: false,
362
- ownTextureAlpha: false,
363
- zIndex: 0,
364
- blendMode: 'normal',
365
- effectList: { list: [] },
366
- instances: scene.entities.map((entity) => this.entityToInstance(entity)),
367
- },
368
- ],
369
- };
370
- this.addTextFile(`layouts/${layoutName}.json`, JSON.stringify(layout, null, '\t'));
497
+
498
+ addComponent(type, properties = {}) {
499
+ this.components.push({ type, properties });
371
500
  }
372
- entityToInstance(entity) {
373
- const pos = entity.position ?? { x: 0, y: 0 };
374
- const scale = entity.scale ?? { x: 1, y: 1 };
375
- const typeName = (entity.name ?? entity.id).replace(/[^a-zA-Z0-9_]/g, '_');
376
- const behaviors = {};
377
- for (const comp of entity.components) {
378
- const mapping = C3_BEHAVIOR_MAP[comp.type];
379
- if (mapping) {
380
- behaviors[mapping.behavior] = this.mapProperties(comp.properties ?? {}, mapping.properties);
381
- }
382
- }
383
- return {
384
- type: typeName,
385
- uid: this.uidCounter++,
386
- x: pos.x,
387
- y: pos.y,
388
- width: 64 * scale.x,
389
- height: 64 * scale.y,
390
- originX: 0.5,
391
- originY: 0.5,
392
- angle: entity.rotation ?? 0,
393
- opacity: 100,
394
- zElevation: 0,
395
- colorRgb: [255, 255, 255],
396
- blendMode: 'normal',
397
- effectList: { list: [] },
398
- behaviors,
399
- instVars: {},
400
- };
501
+
502
+ hasComponent(type) {
503
+ return this.components.some(c => c.type === type);
401
504
  }
402
- /* ── Event Sheet ────────────────────────────────────────────── */
403
- async generateEventSheet(scene, _project, _options) {
404
- const sheetName = `${scene.name.replace(/[^a-zA-Z0-9_]/g, '_')}_Events`;
405
- const eventSheet = {
406
- c3eventsheet: true,
407
- name: sheetName,
408
- events: [
409
- {
410
- eventType: 'comment',
411
- children: undefined,
412
- conditions: undefined,
413
- actions: undefined,
414
- },
415
- // On start of layout
416
- {
417
- eventType: 'block',
418
- conditions: [
419
- {
420
- id: 'on-start-of-layout',
421
- objectType: 'System',
422
- },
423
- ],
424
- actions: [
425
- {
426
- id: 'log',
427
- objectType: 'System',
428
- parameters: { message: `Scene ${scene.name} started` },
429
- },
430
- ],
431
- },
432
- // Main loop
433
- {
434
- eventType: 'block',
435
- conditions: [
436
- {
437
- id: 'every-tick',
438
- objectType: 'System',
439
- },
440
- ],
441
- actions: [],
442
- children: this.generateEntityEvents(scene.entities),
443
- },
444
- ],
445
- };
446
- this.addTextFile(`eventSheets/${sheetName}.json`, JSON.stringify(eventSheet, null, '\t'));
505
+
506
+ getComponent(type) {
507
+ return this.components.find(c => c.type === type);
447
508
  }
448
- generateEntityEvents(entities) {
449
- const events = [];
450
- for (const entity of entities) {
451
- (entity.name ?? entity.id).replace(/[^a-zA-Z0-9_]/g, '_');
452
- // Generate movement events based on components
453
- const hasMovement = entity.components.some((c) => c.type === 'movement');
454
- if (hasMovement) {
455
- events.push({
456
- eventType: 'comment',
457
- conditions: undefined,
458
- actions: undefined,
459
- children: undefined,
460
- });
461
- }
509
+
510
+ hasTag(tag) {
511
+ return this.tags.includes(tag);
512
+ }
513
+
514
+ addTag(tag) {
515
+ if (!this.hasTag(tag)) {
516
+ this.tags.push(tag);
462
517
  }
463
- return events;
464
518
  }
465
- /* ── Scripts ────────────────────────────────────────────────── */
466
- async generateScripts(project, _options) {
467
- // Main script
468
- const mainScript = `// ${project.name} - Nice2Dev Export for Construct 3
469
- // Generated automatically
470
-
471
- // Runtime reference
472
- const runtime = globalThis.runtime;
473
-
474
- // Game state
475
- const gameState = {
476
- isPaused: false,
477
- entities: new Map(),
478
- globalVariables: new Map(),
479
- };
480
-
481
- // Settings from Nice2Dev
482
- export const GameSettings = {
483
- width: ${project.settings.resolution.width},
484
- height: ${project.settings.resolution.height},
485
- masterVolume: ${project.settings.audio.masterVolume},
486
- physicsEnabled: ${project.settings.physics.enabled},
487
- gravity: { x: ${project.settings.physics.gravity.x}, y: ${project.settings.physics.gravity.y} },
488
- };
489
-
490
- // Entity class
491
- export class N2DEntity {
492
- constructor(instance) {
493
- this.instance = instance;
494
- this.name = instance.objectType.name;
495
- this.components = [];
496
- this.tags = [];
497
- }
498
-
499
- addComponent(type, properties = {}) {
500
- this.components.push({ type, properties });
501
- }
502
-
503
- hasComponent(type) {
504
- return this.components.some(c => c.type === type);
505
- }
506
-
507
- getComponent(type) {
508
- return this.components.find(c => c.type === type);
509
- }
510
-
511
- hasTag(tag) {
512
- return this.tags.includes(tag);
513
- }
514
-
515
- addTag(tag) {
516
- if (!this.hasTag(tag)) {
517
- this.tags.push(tag);
518
- }
519
- }
520
-
521
- get position() {
522
- return { x: this.instance.x, y: this.instance.y };
523
- }
524
-
525
- set position(pos) {
526
- this.instance.x = pos.x;
527
- this.instance.y = pos.y;
528
- }
529
-
530
- destroy() {
531
- this.instance.destroy();
532
- gameState.entities.delete(this.instance.uid);
533
- }
534
- }
535
-
536
- // Variable system
537
- export const Variables = {
538
- set(name, value) {
539
- gameState.globalVariables.set(name, value);
540
- },
541
-
542
- get(name, defaultValue = null) {
543
- return gameState.globalVariables.has(name)
544
- ? gameState.globalVariables.get(name)
545
- : defaultValue;
546
- },
547
-
548
- has(name) {
549
- return gameState.globalVariables.has(name);
550
- },
551
-
552
- remove(name) {
553
- gameState.globalVariables.delete(name);
554
- },
555
- };
556
-
557
- // Pause/Resume
558
- export function pauseGame() {
559
- gameState.isPaused = true;
560
- }
561
-
562
- export function resumeGame() {
563
- gameState.isPaused = false;
564
- }
565
-
566
- export function isPaused() {
567
- return gameState.isPaused;
568
- }
569
-
570
- // Entity management
571
- export function registerEntity(instance) {
572
- const entity = new N2DEntity(instance);
573
- gameState.entities.set(instance.uid, entity);
574
- return entity;
575
- }
576
-
577
- export function getEntity(uid) {
578
- return gameState.entities.get(uid);
579
- }
580
-
581
- export function getAllEntities() {
582
- return Array.from(gameState.entities.values());
583
- }
584
-
585
- export function getEntitiesByTag(tag) {
586
- return getAllEntities().filter(e => e.hasTag(tag));
587
- }
588
-
589
- // Initialize on runtime ready
590
- runOnStartup(async runtime => {
591
- console.log('[N2D] ${project.name} initialized');
592
- });
519
+
520
+ get position() {
521
+ return { x: this.instance.x, y: this.instance.y };
522
+ }
523
+
524
+ set position(pos) {
525
+ this.instance.x = pos.x;
526
+ this.instance.y = pos.y;
527
+ }
528
+
529
+ destroy() {
530
+ this.instance.destroy();
531
+ gameState.entities.delete(this.instance.uid);
532
+ }
533
+ }
534
+
535
+ // Variable system
536
+ export const Variables = {
537
+ set(name, value) {
538
+ gameState.globalVariables.set(name, value);
539
+ },
540
+
541
+ get(name, defaultValue = null) {
542
+ return gameState.globalVariables.has(name)
543
+ ? gameState.globalVariables.get(name)
544
+ : defaultValue;
545
+ },
546
+
547
+ has(name) {
548
+ return gameState.globalVariables.has(name);
549
+ },
550
+
551
+ remove(name) {
552
+ gameState.globalVariables.delete(name);
553
+ },
554
+ };
555
+
556
+ // Pause/Resume
557
+ export function pauseGame() {
558
+ gameState.isPaused = true;
559
+ }
560
+
561
+ export function resumeGame() {
562
+ gameState.isPaused = false;
563
+ }
564
+
565
+ export function isPaused() {
566
+ return gameState.isPaused;
567
+ }
568
+
569
+ // Entity management
570
+ export function registerEntity(instance) {
571
+ const entity = new N2DEntity(instance);
572
+ gameState.entities.set(instance.uid, entity);
573
+ return entity;
574
+ }
575
+
576
+ export function getEntity(uid) {
577
+ return gameState.entities.get(uid);
578
+ }
579
+
580
+ export function getAllEntities() {
581
+ return Array.from(gameState.entities.values());
582
+ }
583
+
584
+ export function getEntitiesByTag(tag) {
585
+ return getAllEntities().filter(e => e.hasTag(tag));
586
+ }
587
+
588
+ // Initialize on runtime ready
589
+ runOnStartup(async runtime => {
590
+ console.log('[N2D] ${project.name} initialized');
591
+ });
593
592
  `;
594
- this.addTextFile('scripts/main.js', mainScript);
595
- // Imports for events
596
- const importsScript = `// Imports for event sheets
597
- // Add any exports here that should be accessible from event sheets
598
-
599
- export * from './main.js';
593
+ this.addTextFile("scripts/main.js", mainScript);
594
+ const importsScript = `// Imports for event sheets
595
+ // Add any exports here that should be accessible from event sheets
596
+
597
+ export * from './main.js';
600
598
  `;
601
- this.addTextFile('scripts/importsForEvents.js', importsScript);
602
- }
603
- /* ── Addon Export ───────────────────────────────────────────── */
604
- async exportAsAddon(project, options) {
605
- const platformOpts = options.platformOptions ?? {};
606
- const addonId = platformOpts.addonId ?? project.name.toLowerCase().replace(/[^a-z0-9]/g, '');
607
- // Addon JSON
608
- const addon = {
609
- 'is-c3-addon': true,
610
- type: 'behavior',
611
- name: project.name,
612
- id: `Nice2Dev_${addonId}`,
613
- version: project.version,
614
- author: 'Nice2Dev',
615
- website: 'https://nice2dev.com',
616
- documentation: '',
617
- description: `${project.name} - Generated from Nice2Dev`,
618
- 'editor-scripts': ['editor.js'],
619
- 'file-list': ['c3runtime/behavior.js', 'c3runtime/instance.js', 'c3runtime/type.js'],
620
- };
621
- this.addTextFile('addon.json', JSON.stringify(addon, null, '\t'));
622
- // Editor script
623
- const editorScript = `"use strict";
624
-
625
- {
626
- const BEHAVIOR_ID = "Nice2Dev_${addonId}";
627
- const BEHAVIOR_VERSION = "${project.version}";
628
- const BEHAVIOR_CATEGORY = "general";
629
-
630
- const BEHAVIOR_CLASS = SDK.Behaviors.Nice2Dev_${addonId} = class Nice2Dev_${addonId} extends SDK.IBehaviorBase {
631
- constructor() {
632
- super(BEHAVIOR_ID);
633
- SDK.Lang.PushContext("behaviors." + BEHAVIOR_ID.toLowerCase());
634
- this._info.SetName(Lang(".name"));
635
- this._info.SetDescription(Lang(".description"));
636
- this._info.SetVersion(BEHAVIOR_VERSION);
637
- this._info.SetCategory(BEHAVIOR_CATEGORY);
638
- this._info.SetAuthor("Nice2Dev");
639
- this._info.SetHelpUrl("https://nice2dev.com");
640
- this._info.SetIsOnlyOneAllowed(false);
641
- SDK.Lang.PopContext();
642
- }
643
- };
644
-
645
- BEHAVIOR_CLASS.Register(BEHAVIOR_ID, BEHAVIOR_CLASS);
646
- }
599
+ this.addTextFile("scripts/importsForEvents.js", importsScript);
600
+ }
601
+ /* ── Addon Export ───────────────────────────────────────────── */
602
+ async exportAsAddon(project, options) {
603
+ const platformOpts = options.platformOptions ?? {};
604
+ const addonId = platformOpts.addonId ?? project.name.toLowerCase().replace(/[^a-z0-9]/g, "");
605
+ const addon = {
606
+ "is-c3-addon": true,
607
+ type: "behavior",
608
+ name: project.name,
609
+ id: `Nice2Dev_${addonId}`,
610
+ version: project.version,
611
+ author: "Nice2Dev",
612
+ website: "https://nice2dev.com",
613
+ documentation: "",
614
+ description: `${project.name} - Generated from Nice2Dev`,
615
+ "editor-scripts": ["editor.js"],
616
+ "file-list": ["c3runtime/behavior.js", "c3runtime/instance.js", "c3runtime/type.js"]
617
+ };
618
+ this.addTextFile("addon.json", JSON.stringify(addon, null, " "));
619
+ const editorScript = `"use strict";
620
+
621
+ {
622
+ const BEHAVIOR_ID = "Nice2Dev_${addonId}";
623
+ const BEHAVIOR_VERSION = "${project.version}";
624
+ const BEHAVIOR_CATEGORY = "general";
625
+
626
+ const BEHAVIOR_CLASS = SDK.Behaviors.Nice2Dev_${addonId} = class Nice2Dev_${addonId} extends SDK.IBehaviorBase {
627
+ constructor() {
628
+ super(BEHAVIOR_ID);
629
+ SDK.Lang.PushContext("behaviors." + BEHAVIOR_ID.toLowerCase());
630
+ this._info.SetName(Lang(".name"));
631
+ this._info.SetDescription(Lang(".description"));
632
+ this._info.SetVersion(BEHAVIOR_VERSION);
633
+ this._info.SetCategory(BEHAVIOR_CATEGORY);
634
+ this._info.SetAuthor("Nice2Dev");
635
+ this._info.SetHelpUrl("https://nice2dev.com");
636
+ this._info.SetIsOnlyOneAllowed(false);
637
+ SDK.Lang.PopContext();
638
+ }
639
+ };
640
+
641
+ BEHAVIOR_CLASS.Register(BEHAVIOR_ID, BEHAVIOR_CLASS);
642
+ }
647
643
  `;
648
- this.addTextFile('editor.js', editorScript);
649
- // Runtime behavior
650
- const runtimeBehavior = `"use strict";
651
-
652
- {
653
- const C3 = self.C3;
654
-
655
- C3.Behaviors.Nice2Dev_${addonId} = class Nice2Dev_${addonId} extends C3.SDKBehaviorBase {
656
- constructor(opts) {
657
- super(opts);
658
- }
659
-
660
- Release() {
661
- super.Release();
662
- }
663
- };
664
- }
644
+ this.addTextFile("editor.js", editorScript);
645
+ const runtimeBehavior = `"use strict";
646
+
647
+ {
648
+ const C3 = self.C3;
649
+
650
+ C3.Behaviors.Nice2Dev_${addonId} = class Nice2Dev_${addonId} extends C3.SDKBehaviorBase {
651
+ constructor(opts) {
652
+ super(opts);
653
+ }
654
+
655
+ Release() {
656
+ super.Release();
657
+ }
658
+ };
659
+ }
665
660
  `;
666
- this.addTextFile('c3runtime/behavior.js', runtimeBehavior);
667
- // Runtime instance
668
- const runtimeInstance = `"use strict";
669
-
670
- {
671
- const C3 = self.C3;
672
-
673
- C3.Behaviors.Nice2Dev_${addonId}.Instance = class Nice2Dev_${addonId}Instance extends C3.SDKBehaviorInstanceBase {
674
- constructor(behInst, properties) {
675
- super(behInst);
676
-
677
- // Nice2Dev game state
678
- this._gameState = {
679
- variables: new Map(),
680
- isPaused: false,
681
- };
682
-
683
- // Import Nice2Dev settings
684
- this._settings = {
685
- width: ${project.settings.resolution.width},
686
- height: ${project.settings.resolution.height},
687
- gravity: { x: ${project.settings.physics.gravity.x}, y: ${project.settings.physics.gravity.y} },
688
- };
689
- }
690
-
691
- Release() {
692
- super.Release();
693
- }
694
-
695
- SaveToJson() {
696
- return {
697
- variables: Object.fromEntries(this._gameState.variables),
698
- isPaused: this._gameState.isPaused,
699
- };
700
- }
701
-
702
- LoadFromJson(o) {
703
- this._gameState.variables = new Map(Object.entries(o.variables || {}));
704
- this._gameState.isPaused = o.isPaused || false;
705
- }
706
-
707
- Tick() {
708
- if (this._gameState.isPaused) return;
709
- // Update logic here
710
- }
711
-
712
- // Actions
713
- SetVariable(name, value) {
714
- this._gameState.variables.set(name, value);
715
- }
716
-
717
- Pause() {
718
- this._gameState.isPaused = true;
719
- }
720
-
721
- Resume() {
722
- this._gameState.isPaused = false;
723
- }
724
-
725
- // Conditions
726
- IsPaused() {
727
- return this._gameState.isPaused;
728
- }
729
-
730
- HasVariable(name) {
731
- return this._gameState.variables.has(name);
732
- }
733
-
734
- // Expressions
735
- GetVariable(name) {
736
- return this._gameState.variables.get(name) ?? '';
737
- }
738
- };
739
- }
661
+ this.addTextFile("c3runtime/behavior.js", runtimeBehavior);
662
+ const runtimeInstance = `"use strict";
663
+
664
+ {
665
+ const C3 = self.C3;
666
+
667
+ C3.Behaviors.Nice2Dev_${addonId}.Instance = class Nice2Dev_${addonId}Instance extends C3.SDKBehaviorInstanceBase {
668
+ constructor(behInst, properties) {
669
+ super(behInst);
670
+
671
+ // Nice2Dev game state
672
+ this._gameState = {
673
+ variables: new Map(),
674
+ isPaused: false,
675
+ };
676
+
677
+ // Import Nice2Dev settings
678
+ this._settings = {
679
+ width: ${project.settings.resolution.width},
680
+ height: ${project.settings.resolution.height},
681
+ gravity: { x: ${project.settings.physics.gravity.x}, y: ${project.settings.physics.gravity.y} },
682
+ };
683
+ }
684
+
685
+ Release() {
686
+ super.Release();
687
+ }
688
+
689
+ SaveToJson() {
690
+ return {
691
+ variables: Object.fromEntries(this._gameState.variables),
692
+ isPaused: this._gameState.isPaused,
693
+ };
694
+ }
695
+
696
+ LoadFromJson(o) {
697
+ this._gameState.variables = new Map(Object.entries(o.variables || {}));
698
+ this._gameState.isPaused = o.isPaused || false;
699
+ }
700
+
701
+ Tick() {
702
+ if (this._gameState.isPaused) return;
703
+ // Update logic here
704
+ }
705
+
706
+ // Actions
707
+ SetVariable(name, value) {
708
+ this._gameState.variables.set(name, value);
709
+ }
710
+
711
+ Pause() {
712
+ this._gameState.isPaused = true;
713
+ }
714
+
715
+ Resume() {
716
+ this._gameState.isPaused = false;
717
+ }
718
+
719
+ // Conditions
720
+ IsPaused() {
721
+ return this._gameState.isPaused;
722
+ }
723
+
724
+ HasVariable(name) {
725
+ return this._gameState.variables.has(name);
726
+ }
727
+
728
+ // Expressions
729
+ GetVariable(name) {
730
+ return this._gameState.variables.get(name) ?? '';
731
+ }
732
+ };
733
+ }
740
734
  `;
741
- this.addTextFile('c3runtime/instance.js', runtimeInstance);
742
- // Runtime type
743
- const runtimeType = `"use strict";
744
-
745
- {
746
- const C3 = self.C3;
747
-
748
- C3.Behaviors.Nice2Dev_${addonId}.Type = class Nice2Dev_${addonId}Type extends C3.SDKBehaviorTypeBase {
749
- constructor(behaviorType) {
750
- super(behaviorType);
751
- }
752
-
753
- Release() {
754
- super.Release();
755
- }
756
-
757
- OnCreate() {
758
- }
759
- };
760
- }
735
+ this.addTextFile("c3runtime/instance.js", runtimeInstance);
736
+ const runtimeType = `"use strict";
737
+
738
+ {
739
+ const C3 = self.C3;
740
+
741
+ C3.Behaviors.Nice2Dev_${addonId}.Type = class Nice2Dev_${addonId}Type extends C3.SDKBehaviorTypeBase {
742
+ constructor(behaviorType) {
743
+ super(behaviorType);
744
+ }
745
+
746
+ Release() {
747
+ super.Release();
748
+ }
749
+
750
+ OnCreate() {
751
+ }
752
+ };
753
+ }
761
754
  `;
762
- this.addTextFile('c3runtime/type.js', runtimeType);
763
- }
764
- /* ── README ─────────────────────────────────────────────────── */
765
- async generateReadme(project, _options) {
766
- const readme = `# ${project.name} - Construct 3 Export
767
-
768
- Generated from Nice2Dev project v${project.version}
769
-
770
- ## Installation
771
-
772
- 1. Create a new Construct 3 project or open existing
773
- 2. Import the .c3p file (if zipped) or copy project structure
774
- 3. Enable any required plugins in Project Properties
775
-
776
- ## Project Structure
777
-
778
- - \`project.c3proj\` - Main project file
779
- - \`objectTypes/\` - Object type definitions
780
- - \`layouts/\` - Layout/scene files
781
- - \`eventSheets/\` - Event sheet files
782
- - \`scripts/\` - JavaScript modules
783
-
784
- ## Scenes
785
-
786
- ${project.scenes.map((s) => `- ${s.name} (${s.entities.length} entities)`).join('\n')}
787
-
788
- ## Object Types
789
-
790
- ${this.collectObjectTypes(project)
791
- .map((t) => `- ${t}`)
792
- .join('\n')}
793
-
794
- ## JavaScript API
795
-
796
- Import from \`main.js\`:
797
-
798
- \`\`\`javascript
799
- import { GameSettings, Variables, pauseGame, resumeGame } from './main.js';
800
-
801
- // Get/Set variables
802
- Variables.set('score', 100);
803
- const score = Variables.get('score', 0);
804
-
805
- // Pause control
806
- pauseGame();
807
- resumeGame();
808
- \`\`\`
809
-
810
- ## Notes
811
-
812
- - Textures need to be imported manually into Construct 3
813
- - Audio files need to be imported and linked
814
- - Physics settings may need adjustment
815
-
816
- ## Settings
817
-
818
- - Resolution: ${project.settings.resolution.width}x${project.settings.resolution.height}
819
- - Physics: ${project.settings.physics.enabled ? 'Enabled' : 'Disabled'}
820
- - Gravity: (${project.settings.physics.gravity.x}, ${project.settings.physics.gravity.y})
755
+ this.addTextFile("c3runtime/type.js", runtimeType);
756
+ }
757
+ /* ── README ─────────────────────────────────────────────────── */
758
+ async generateReadme(project, _options) {
759
+ const readme = `# ${project.name} - Construct 3 Export
760
+
761
+ Generated from Nice2Dev project v${project.version}
762
+
763
+ ## Installation
764
+
765
+ 1. Create a new Construct 3 project or open existing
766
+ 2. Import the .c3p file (if zipped) or copy project structure
767
+ 3. Enable any required plugins in Project Properties
768
+
769
+ ## Project Structure
770
+
771
+ - \`project.c3proj\` - Main project file
772
+ - \`objectTypes/\` - Object type definitions
773
+ - \`layouts/\` - Layout/scene files
774
+ - \`eventSheets/\` - Event sheet files
775
+ - \`scripts/\` - JavaScript modules
776
+
777
+ ## Scenes
778
+
779
+ ${project.scenes.map((s) => `- ${s.name} (${s.entities.length} entities)`).join("\n")}
780
+
781
+ ## Object Types
782
+
783
+ ${this.collectObjectTypes(project).map((t) => `- ${t}`).join("\n")}
784
+
785
+ ## JavaScript API
786
+
787
+ Import from \`main.js\`:
788
+
789
+ \`\`\`javascript
790
+ import { GameSettings, Variables, pauseGame, resumeGame } from './main.js';
791
+
792
+ // Get/Set variables
793
+ Variables.set('score', 100);
794
+ const score = Variables.get('score', 0);
795
+
796
+ // Pause control
797
+ pauseGame();
798
+ resumeGame();
799
+ \`\`\`
800
+
801
+ ## Notes
802
+
803
+ - Textures need to be imported manually into Construct 3
804
+ - Audio files need to be imported and linked
805
+ - Physics settings may need adjustment
806
+
807
+ ## Settings
808
+
809
+ - Resolution: ${project.settings.resolution.width}x${project.settings.resolution.height}
810
+ - Physics: ${project.settings.physics.enabled ? "Enabled" : "Disabled"}
811
+ - Gravity: (${project.settings.physics.gravity.x}, ${project.settings.physics.gravity.y})
821
812
  `;
822
- this.addTextFile('README.md', readme);
823
- }
813
+ this.addTextFile("README.md", readme);
814
+ }
824
815
  }
825
- /* ── Factory ──────────────────────────────────────────────────── */
826
816
  function createConstruct3Exporter() {
827
- return new Construct3Exporter();
817
+ return new Construct3Exporter();
828
818
  }
829
-
830
819
  exports.Construct3Exporter = Construct3Exporter;
831
820
  exports.createConstruct3Exporter = createConstruct3Exporter;