@nice2dev/game-engine 1.3.15 → 1.3.17

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,1105 +1,1064 @@
1
- 'use strict';
2
-
3
- var PlatformExporter = require('./PlatformExporter.js');
4
-
5
- /* ────────────────────────────────────────────────────────────────
6
- Defold Exporter — Defold Game Engine Export
7
-
8
- Exports Nice2Dev projects to Defold format:
9
- - Project file (game.project)
10
- - Collection files (.collection)
11
- - Game object files (.go)
12
- - Lua scripts
13
- - GUI files
14
- - Atlas definitions
15
- ──────────────────────────────────────────────────────────────── */
16
- /* ── Defold Component Mappings ────────────────────────────────── */
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const PlatformExporter = require("./PlatformExporter.js");
17
4
  const DEFOLD_COMPONENT_MAP = {
18
- sprite: (comp, entity) => {
19
- comp.properties?.['texture'] ?? 'main';
20
- return `components {
21
- id: "sprite"
22
- component: "/main/sprites/${(entity.name ?? entity.id).toLowerCase()}.sprite"
23
- position {
24
- x: 0.0
25
- y: 0.0
26
- z: 0.0
27
- }
28
- rotation {
29
- x: 0.0
30
- y: 0.0
31
- z: 0.0
32
- w: 1.0
33
- }
5
+ sprite: (comp, entity) => {
6
+ comp.properties?.["texture"] ?? "main";
7
+ return `components {
8
+ id: "sprite"
9
+ component: "/main/sprites/${(entity.name ?? entity.id).toLowerCase()}.sprite"
10
+ position {
11
+ x: 0.0
12
+ y: 0.0
13
+ z: 0.0
14
+ }
15
+ rotation {
16
+ x: 0.0
17
+ y: 0.0
18
+ z: 0.0
19
+ w: 1.0
20
+ }
34
21
  }`;
35
- },
36
- rigidbody: (comp, entity) => {
37
- comp.properties?.['mass'] ?? 1;
38
- comp.properties?.['linearDamping'] ?? 0;
39
- comp.properties?.['angularDamping'] ?? 0;
40
- return `components {
41
- id: "collisionobject"
42
- component: "/main/collision/${(entity.name ?? entity.id).toLowerCase()}.collisionobject"
43
- position {
44
- x: 0.0
45
- y: 0.0
46
- z: 0.0
47
- }
48
- rotation {
49
- x: 0.0
50
- y: 0.0
51
- z: 0.0
52
- w: 1.0
53
- }
22
+ },
23
+ rigidbody: (comp, entity) => {
24
+ comp.properties?.["mass"] ?? 1;
25
+ comp.properties?.["linearDamping"] ?? 0;
26
+ comp.properties?.["angularDamping"] ?? 0;
27
+ return `components {
28
+ id: "collisionobject"
29
+ component: "/main/collision/${(entity.name ?? entity.id).toLowerCase()}.collisionobject"
30
+ position {
31
+ x: 0.0
32
+ y: 0.0
33
+ z: 0.0
34
+ }
35
+ rotation {
36
+ x: 0.0
37
+ y: 0.0
38
+ z: 0.0
39
+ w: 1.0
40
+ }
54
41
  }`;
55
- },
56
- script: (comp, entity) => {
57
- return `components {
58
- id: "script"
59
- component: "/main/scripts/${(entity.name ?? entity.id).toLowerCase()}.script"
60
- position {
61
- x: 0.0
62
- y: 0.0
63
- z: 0.0
64
- }
65
- rotation {
66
- x: 0.0
67
- y: 0.0
68
- z: 0.0
69
- w: 1.0
70
- }
42
+ },
43
+ script: (comp, entity) => {
44
+ return `components {
45
+ id: "script"
46
+ component: "/main/scripts/${(entity.name ?? entity.id).toLowerCase()}.script"
47
+ position {
48
+ x: 0.0
49
+ y: 0.0
50
+ z: 0.0
51
+ }
52
+ rotation {
53
+ x: 0.0
54
+ y: 0.0
55
+ z: 0.0
56
+ w: 1.0
57
+ }
71
58
  }`;
72
- },
59
+ }
73
60
  };
74
- /* ── Exporter Implementation ──────────────────────────────────── */
75
61
  class DefoldExporter extends PlatformExporter.PlatformExporter {
76
- constructor() {
77
- super(...arguments);
78
- this.platformId = 'defold';
79
- this.platformInfo = {
80
- id: 'defold',
81
- name: 'Defold',
82
- description: 'Defold - Cross-platform game engine by King',
83
- website: 'https://defold.com/',
84
- features: [
85
- '2d-rendering',
86
- '3d-rendering',
87
- 'physics-2d',
88
- 'physics-3d',
89
- 'audio',
90
- 'particles',
91
- 'ui-system',
92
- 'animation',
93
- ],
94
- supportedAssets: [
95
- 'texture',
96
- 'audio',
97
- 'tilemap',
98
- 'animation',
99
- 'prefab',
100
- 'scene',
101
- 'data',
102
- 'script',
103
- ],
104
- exportFormats: ['.project', '.collection', '.go', '.script', '.gui'],
105
- };
62
+ constructor() {
63
+ super(...arguments);
64
+ this.platformId = "defold";
65
+ this.platformInfo = {
66
+ id: "defold",
67
+ name: "Defold",
68
+ description: "Defold - Cross-platform game engine by King",
69
+ website: "https://defold.com/",
70
+ features: [
71
+ "2d-rendering",
72
+ "3d-rendering",
73
+ "physics-2d",
74
+ "physics-3d",
75
+ "audio",
76
+ "particles",
77
+ "ui-system",
78
+ "animation"
79
+ ],
80
+ supportedAssets: [
81
+ "texture",
82
+ "audio",
83
+ "tilemap",
84
+ "animation",
85
+ "prefab",
86
+ "scene",
87
+ "data",
88
+ "script"
89
+ ],
90
+ exportFormats: [".project", ".collection", ".go", ".script", ".gui"]
91
+ };
92
+ }
93
+ async doExport(project, options) {
94
+ const platformOpts = options.platformOptions ?? {};
95
+ await this.generateProjectFile(project, options);
96
+ await this.generateMainCollection(project, options);
97
+ for (const scene of project.scenes) {
98
+ await this.exportScene(scene, project, options);
106
99
  }
107
- async doExport(project, options) {
108
- const platformOpts = options.platformOptions ?? {};
109
- // Generate main project file
110
- await this.generateProjectFile(project, options);
111
- // Generate main collection (bootstrap)
112
- await this.generateMainCollection(project, options);
113
- // Generate scenes as collections
114
- for (const scene of project.scenes) {
115
- await this.exportScene(scene, project, options);
116
- }
117
- // Generate prefabs as game objects
118
- for (const prefab of project.prefabs) {
119
- await this.exportPrefab(prefab, options);
120
- }
121
- // Generate shared scripts
122
- await this.generateSharedScripts(project, options);
123
- // Generate app manifest for HTML5
124
- if (platformOpts.html5Manifest !== false) {
125
- await this.generateAppManifest(project, options);
126
- }
127
- // Generate README
128
- await this.generateReadme(project, options);
100
+ for (const prefab of project.prefabs) {
101
+ await this.exportPrefab(prefab, options);
129
102
  }
130
- /* ── Project File ───────────────────────────────────────────── */
131
- async generateProjectFile(project, options) {
132
- const safeName = (options.projectName ?? project.name)
133
- .toLowerCase()
134
- .replace(/[^a-z0-9_]/g, '_');
135
- const platformOpts = options.platformOptions ?? {};
136
- const projectContent = `[project]
137
- title = ${project.name}
138
- version = ${project.version}
139
- write_log = 0
140
- compress_archive = 1
141
- publisher = Nice2Dev
142
- developer = Nice2Dev
143
-
144
- [display]
145
- width = ${project.settings.resolution.width}
146
- height = ${project.settings.resolution.height}
147
- high_dpi = 1
148
- samples = 0
149
- fullscreen = 0
150
- update_frequency = 0
151
- swap_interval = 1
152
- vsync = 1
153
- display_profiles = /builtins/render/default.display_profilesc
154
- dynamic_orientation = 0
155
-
156
- [render]
157
- clear_color_red = 0
158
- clear_color_green = 0
159
- clear_color_blue = 0
160
- clear_color_alpha = 0
161
-
162
- [physics]
163
- type = ${platformOpts.usePhysics3D ? '3D' : '2D'}
164
- max_collision_object_count = 128
165
- use_fixed_timestep = 0
166
- gravity_y = ${project.settings.physics.gravity.y}
167
- gravity_x = ${project.settings.physics.gravity.x}
168
- gravity_z = 0
169
- debug = 0
170
- debug_alpha = 0.9
171
- world_count = 4
172
- scale = 0.02
173
-
174
- [bootstrap]
175
- main_collection = /main/main.collectionc
176
- render = /builtins/render/default.renderc
177
-
178
- [graphics]
179
- default_texture_min_filter = linear
180
- default_texture_mag_filter = linear
181
- max_draw_calls = 1024
182
- max_characters = 8192
183
- max_font_batches = 4
184
- max_debug_vertices = 10000
185
- texture_profiles = /builtins/graphics/default.texture_profiles
186
-
187
- [shader]
188
- output_spirv = 0
189
-
190
- [sound]
191
- gain = ${project.settings.audio.masterVolume}
192
- max_sound_data = 128
193
- max_sound_buffers = 32
194
- max_sound_sources = 16
195
- max_sound_instances = 256
196
- max_component_count = 32
197
- use_thread = 1
198
-
199
- [resource]
200
- http_cache = 0
201
- max_resources = 1024
202
-
203
- [input]
204
- repeat_delay = 0.5
205
- repeat_interval = 0.2
206
- gamepads = /builtins/input/default.gamepadsc
207
- game_binding = /input/game.input_bindingc
208
- use_accelerometer = 1
209
-
210
- [sprite]
211
- max_count = 128
212
- subpixels = 1
213
-
214
- [model]
215
- max_count = 128
216
-
217
- [mesh]
218
- max_count = 128
219
-
220
- [gui]
221
- max_count = 64
222
- max_particlefx_count = 64
223
- max_particle_count = 1024
224
-
225
- [collection]
226
- max_instances = 1024
227
- max_input_stack_entries = 16
228
-
229
- [collection_proxy]
230
- max_count = 8
231
-
232
- [collectionfactory]
233
- max_count = 128
234
-
235
- [factory]
236
- max_count = 128
237
-
238
- [ios]
239
- launch_screen = /builtins/manifests/ios/LaunchScreen.storyboardc
240
- infoplist = /builtins/manifests/ios/Info.plist
241
- default_language = en
242
- localizations = en
243
-
244
- [android]
245
- version_code = 1
246
- minimum_sdk_version = 19
247
- target_sdk_version = 33
248
- package = com.nice2dev.${safeName}
249
- manifest = /builtins/manifests/android/AndroidManifest.xml
250
- iap_provider = GooglePlay
251
- input_method = HiddenInputField
252
- immersive_mode = 0
253
- display_cutout = 1
254
- debuggable = 0
255
-
256
- [osx]
257
- infoplist = /builtins/manifests/osx/Info.plist
258
- bundle_identifier = com.nice2dev.${safeName}
259
- default_language = en
260
- localizations = en
261
-
262
- [windows]
263
- icon = /builtins/manifests/windows/game.ico
264
-
265
- [html5]
266
- custom_heap_size = 0
267
- heap_size = 256
268
- htmlfile = /builtins/manifests/web/engine_template.html
269
- cssfile = /builtins/manifests/web/light_theme.css
270
- splash_image = /builtins/manifests/web/splash.png
271
- archive_location_prefix = archive
272
- archive_location_suffix =
273
- engine_arguments = --verify-graphics-calls=false
274
- wasm_streaming = 0
275
- show_fullscreen_button = 1
276
- show_made_with_defold = 1
277
- show_console_banner = 1
278
- scale_mode = fit
279
- power_preference = default
280
-
281
- [particle_fx]
282
- max_count = 64
283
- max_emitter_count = 64
284
- max_particle_count = 1024
285
-
286
- [iap]
287
- auto_finish_transactions = 1
288
-
289
- [network]
290
- http_timeout = 0
291
- ssl_certificates = /builtins/network/ssl_certificates.pem
292
- http_thread_count = 4
293
-
294
- [library]
295
- include_dirs =
296
-
297
- [script]
298
- shared_state = 0
299
-
300
- [label]
301
- max_count = 64
302
- subpixels = 1
303
-
304
- [profiler]
305
- track_cpu = 0
306
- sleep_between_server_updates = 0
307
-
308
- [liveupdate]
309
- settings = /liveupdate.settings
310
- enabled = 1
311
-
312
- [tilemap]
313
- max_count = 16
314
- max_tile_count = 2048
315
-
316
- [engine]
317
- run_while_iconified = 0
318
- fixed_update_frequency = 60
319
-
320
- [native_extension]
321
- _plugins =
322
- `;
323
- this.addTextFile('game.project', projectContent);
103
+ await this.generateSharedScripts(project, options);
104
+ if (platformOpts.html5Manifest !== false) {
105
+ await this.generateAppManifest(project, options);
324
106
  }
325
- /* ── Main Collection ────────────────────────────────────────── */
326
- async generateMainCollection(project, _options) {
327
- const firstScene = project.scenes[0];
328
- const sceneName = firstScene
329
- ? firstScene.name.toLowerCase().replace(/[^a-z0-9_]/g, '_')
330
- : 'level1';
331
- const mainCollection = `name: "main"
332
- scale_along_z: 0
333
- embedded_instances {
334
- id: "game_manager"
335
- data: "components {\\n"
336
- " id: \\"game_manager\\"\\n"
337
- " component: \\"/main/scripts/game_manager.script\\"\\n"
338
- " position {\\n"
339
- " x: 0.0\\n"
340
- " y: 0.0\\n"
341
- " z: 0.0\\n"
342
- " }\\n"
343
- " rotation {\\n"
344
- " x: 0.0\\n"
345
- " y: 0.0\\n"
346
- " z: 0.0\\n"
347
- " w: 1.0\\n"
348
- " }\\n"
349
- "}\\n"
350
- ""
351
- position {
352
- x: 0.0
353
- y: 0.0
354
- z: 0.0
355
- }
356
- rotation {
357
- x: 0.0
358
- y: 0.0
359
- z: 0.0
360
- w: 1.0
361
- }
362
- scale3 {
363
- x: 1.0
364
- y: 1.0
365
- z: 1.0
366
- }
367
- }
368
- collection_instances {
369
- id: "level"
370
- collection: "/main/scenes/${sceneName}.collection"
371
- position {
372
- x: 0.0
373
- y: 0.0
374
- z: 0.0
375
- }
376
- rotation {
377
- x: 0.0
378
- y: 0.0
379
- z: 0.0
380
- w: 1.0
381
- }
382
- scale3 {
383
- x: 1.0
384
- y: 1.0
385
- z: 1.0
386
- }
387
- }
107
+ await this.generateReadme(project, options);
108
+ }
109
+ /* ── Project File ───────────────────────────────────────────── */
110
+ async generateProjectFile(project, options) {
111
+ const safeName = (options.projectName ?? project.name).toLowerCase().replace(/[^a-z0-9_]/g, "_");
112
+ const platformOpts = options.platformOptions ?? {};
113
+ const projectContent = `[project]
114
+ title = ${project.name}
115
+ version = ${project.version}
116
+ write_log = 0
117
+ compress_archive = 1
118
+ publisher = Nice2Dev
119
+ developer = Nice2Dev
120
+
121
+ [display]
122
+ width = ${project.settings.resolution.width}
123
+ height = ${project.settings.resolution.height}
124
+ high_dpi = 1
125
+ samples = 0
126
+ fullscreen = 0
127
+ update_frequency = 0
128
+ swap_interval = 1
129
+ vsync = 1
130
+ display_profiles = /builtins/render/default.display_profilesc
131
+ dynamic_orientation = 0
132
+
133
+ [render]
134
+ clear_color_red = 0
135
+ clear_color_green = 0
136
+ clear_color_blue = 0
137
+ clear_color_alpha = 0
138
+
139
+ [physics]
140
+ type = ${platformOpts.usePhysics3D ? "3D" : "2D"}
141
+ max_collision_object_count = 128
142
+ use_fixed_timestep = 0
143
+ gravity_y = ${project.settings.physics.gravity.y}
144
+ gravity_x = ${project.settings.physics.gravity.x}
145
+ gravity_z = 0
146
+ debug = 0
147
+ debug_alpha = 0.9
148
+ world_count = 4
149
+ scale = 0.02
150
+
151
+ [bootstrap]
152
+ main_collection = /main/main.collectionc
153
+ render = /builtins/render/default.renderc
154
+
155
+ [graphics]
156
+ default_texture_min_filter = linear
157
+ default_texture_mag_filter = linear
158
+ max_draw_calls = 1024
159
+ max_characters = 8192
160
+ max_font_batches = 4
161
+ max_debug_vertices = 10000
162
+ texture_profiles = /builtins/graphics/default.texture_profiles
163
+
164
+ [shader]
165
+ output_spirv = 0
166
+
167
+ [sound]
168
+ gain = ${project.settings.audio.masterVolume}
169
+ max_sound_data = 128
170
+ max_sound_buffers = 32
171
+ max_sound_sources = 16
172
+ max_sound_instances = 256
173
+ max_component_count = 32
174
+ use_thread = 1
175
+
176
+ [resource]
177
+ http_cache = 0
178
+ max_resources = 1024
179
+
180
+ [input]
181
+ repeat_delay = 0.5
182
+ repeat_interval = 0.2
183
+ gamepads = /builtins/input/default.gamepadsc
184
+ game_binding = /input/game.input_bindingc
185
+ use_accelerometer = 1
186
+
187
+ [sprite]
188
+ max_count = 128
189
+ subpixels = 1
190
+
191
+ [model]
192
+ max_count = 128
193
+
194
+ [mesh]
195
+ max_count = 128
196
+
197
+ [gui]
198
+ max_count = 64
199
+ max_particlefx_count = 64
200
+ max_particle_count = 1024
201
+
202
+ [collection]
203
+ max_instances = 1024
204
+ max_input_stack_entries = 16
205
+
206
+ [collection_proxy]
207
+ max_count = 8
208
+
209
+ [collectionfactory]
210
+ max_count = 128
211
+
212
+ [factory]
213
+ max_count = 128
214
+
215
+ [ios]
216
+ launch_screen = /builtins/manifests/ios/LaunchScreen.storyboardc
217
+ infoplist = /builtins/manifests/ios/Info.plist
218
+ default_language = en
219
+ localizations = en
220
+
221
+ [android]
222
+ version_code = 1
223
+ minimum_sdk_version = 19
224
+ target_sdk_version = 33
225
+ package = com.nice2dev.${safeName}
226
+ manifest = /builtins/manifests/android/AndroidManifest.xml
227
+ iap_provider = GooglePlay
228
+ input_method = HiddenInputField
229
+ immersive_mode = 0
230
+ display_cutout = 1
231
+ debuggable = 0
232
+
233
+ [osx]
234
+ infoplist = /builtins/manifests/osx/Info.plist
235
+ bundle_identifier = com.nice2dev.${safeName}
236
+ default_language = en
237
+ localizations = en
238
+
239
+ [windows]
240
+ icon = /builtins/manifests/windows/game.ico
241
+
242
+ [html5]
243
+ custom_heap_size = 0
244
+ heap_size = 256
245
+ htmlfile = /builtins/manifests/web/engine_template.html
246
+ cssfile = /builtins/manifests/web/light_theme.css
247
+ splash_image = /builtins/manifests/web/splash.png
248
+ archive_location_prefix = archive
249
+ archive_location_suffix =
250
+ engine_arguments = --verify-graphics-calls=false
251
+ wasm_streaming = 0
252
+ show_fullscreen_button = 1
253
+ show_made_with_defold = 1
254
+ show_console_banner = 1
255
+ scale_mode = fit
256
+ power_preference = default
257
+
258
+ [particle_fx]
259
+ max_count = 64
260
+ max_emitter_count = 64
261
+ max_particle_count = 1024
262
+
263
+ [iap]
264
+ auto_finish_transactions = 1
265
+
266
+ [network]
267
+ http_timeout = 0
268
+ ssl_certificates = /builtins/network/ssl_certificates.pem
269
+ http_thread_count = 4
270
+
271
+ [library]
272
+ include_dirs =
273
+
274
+ [script]
275
+ shared_state = 0
276
+
277
+ [label]
278
+ max_count = 64
279
+ subpixels = 1
280
+
281
+ [profiler]
282
+ track_cpu = 0
283
+ sleep_between_server_updates = 0
284
+
285
+ [liveupdate]
286
+ settings = /liveupdate.settings
287
+ enabled = 1
288
+
289
+ [tilemap]
290
+ max_count = 16
291
+ max_tile_count = 2048
292
+
293
+ [engine]
294
+ run_while_iconified = 0
295
+ fixed_update_frequency = 60
296
+
297
+ [native_extension]
298
+ _plugins =
388
299
  `;
389
- this.addTextFile('main/main.collection', mainCollection);
390
- }
391
- /* ── Scene Export ───────────────────────────────────────────── */
392
- async exportScene(scene, project, options) {
393
- const sceneName = scene.name.toLowerCase().replace(/[^a-z0-9_]/g, '_');
394
- // Generate collection
395
- let collectionContent = `name: "${sceneName}"
396
- scale_along_z: 0
300
+ this.addTextFile("game.project", projectContent);
301
+ }
302
+ /* ── Main Collection ────────────────────────────────────────── */
303
+ async generateMainCollection(project, _options) {
304
+ const firstScene = project.scenes[0];
305
+ const sceneName = firstScene ? firstScene.name.toLowerCase().replace(/[^a-z0-9_]/g, "_") : "level1";
306
+ const mainCollection = `name: "main"
307
+ scale_along_z: 0
308
+ embedded_instances {
309
+ id: "game_manager"
310
+ data: "components {\\n"
311
+ " id: \\"game_manager\\"\\n"
312
+ " component: \\"/main/scripts/game_manager.script\\"\\n"
313
+ " position {\\n"
314
+ " x: 0.0\\n"
315
+ " y: 0.0\\n"
316
+ " z: 0.0\\n"
317
+ " }\\n"
318
+ " rotation {\\n"
319
+ " x: 0.0\\n"
320
+ " y: 0.0\\n"
321
+ " z: 0.0\\n"
322
+ " w: 1.0\\n"
323
+ " }\\n"
324
+ "}\\n"
325
+ ""
326
+ position {
327
+ x: 0.0
328
+ y: 0.0
329
+ z: 0.0
330
+ }
331
+ rotation {
332
+ x: 0.0
333
+ y: 0.0
334
+ z: 0.0
335
+ w: 1.0
336
+ }
337
+ scale3 {
338
+ x: 1.0
339
+ y: 1.0
340
+ z: 1.0
341
+ }
342
+ }
343
+ collection_instances {
344
+ id: "level"
345
+ collection: "/main/scenes/${sceneName}.collection"
346
+ position {
347
+ x: 0.0
348
+ y: 0.0
349
+ z: 0.0
350
+ }
351
+ rotation {
352
+ x: 0.0
353
+ y: 0.0
354
+ z: 0.0
355
+ w: 1.0
356
+ }
357
+ scale3 {
358
+ x: 1.0
359
+ y: 1.0
360
+ z: 1.0
361
+ }
362
+ }
397
363
  `;
398
- // Add entities as embedded instances
399
- for (const entity of scene.entities) {
400
- collectionContent += this.entityToEmbeddedInstance(entity);
401
- }
402
- this.addTextFile(`main/scenes/${sceneName}.collection`, collectionContent);
403
- // Generate game objects for each entity
404
- for (const entity of scene.entities) {
405
- await this.generateGameObject(entity, options);
406
- }
407
- // Generate scene script
408
- const sceneScript = this.generateSceneScript(scene, project);
409
- this.addTextFile(`main/scripts/${sceneName}_controller.script`, sceneScript);
410
- }
411
- entityToEmbeddedInstance(entity) {
412
- const name = (entity.name ?? entity.id).toLowerCase().replace(/[^a-z0-9_]/g, '_');
413
- const pos = entity.position ?? { x: 0, y: 0 };
414
- const scale = entity.scale ?? { x: 1, y: 1 };
415
- const rotation = entity.rotation ?? 0;
416
- // Calculate quaternion from rotation angle
417
- const radians = (rotation * Math.PI) / 180;
418
- const qz = Math.sin(radians / 2);
419
- const qw = Math.cos(radians / 2);
420
- return `embedded_instances {
421
- id: "${name}"
422
- data: ""
423
- position {
424
- x: ${pos.x}
425
- y: ${pos.y}
426
- z: 0.0
427
- }
428
- rotation {
429
- x: 0.0
430
- y: 0.0
431
- z: ${qz.toFixed(6)}
432
- w: ${qw.toFixed(6)}
433
- }
434
- scale3 {
435
- x: ${scale.x}
436
- y: ${scale.y}
437
- z: 1.0
438
- }
439
- }
364
+ this.addTextFile("main/main.collection", mainCollection);
365
+ }
366
+ /* ── Scene Export ───────────────────────────────────────────── */
367
+ async exportScene(scene, project, options) {
368
+ const sceneName = scene.name.toLowerCase().replace(/[^a-z0-9_]/g, "_");
369
+ let collectionContent = `name: "${sceneName}"
370
+ scale_along_z: 0
440
371
  `;
372
+ for (const entity of scene.entities) {
373
+ collectionContent += this.entityToEmbeddedInstance(entity);
441
374
  }
442
- async generateGameObject(entity, _options) {
443
- const name = (entity.name ?? entity.id).toLowerCase().replace(/[^a-z0-9_]/g, '_');
444
- let goContent = '';
445
- // Add components
446
- for (const comp of entity.components) {
447
- const mapper = DEFOLD_COMPONENT_MAP[comp.type];
448
- if (mapper) {
449
- goContent += mapper(comp, entity) + '\n';
450
- }
451
- }
452
- // Always add a script component
453
- goContent += `components {
454
- id: "script"
455
- component: "/main/scripts/${name}.script"
456
- position {
457
- x: 0.0
458
- y: 0.0
459
- z: 0.0
460
- }
461
- rotation {
462
- x: 0.0
463
- y: 0.0
464
- z: 0.0
465
- w: 1.0
466
- }
467
- }
375
+ this.addTextFile(`main/scenes/${sceneName}.collection`, collectionContent);
376
+ for (const entity of scene.entities) {
377
+ await this.generateGameObject(entity, options);
378
+ }
379
+ const sceneScript = this.generateSceneScript(scene, project);
380
+ this.addTextFile(`main/scripts/${sceneName}_controller.script`, sceneScript);
381
+ }
382
+ entityToEmbeddedInstance(entity) {
383
+ const name = (entity.name ?? entity.id).toLowerCase().replace(/[^a-z0-9_]/g, "_");
384
+ const pos = entity.position ?? { x: 0, y: 0 };
385
+ const scale = entity.scale ?? { x: 1, y: 1 };
386
+ const rotation = entity.rotation ?? 0;
387
+ const radians = rotation * Math.PI / 180;
388
+ const qz = Math.sin(radians / 2);
389
+ const qw = Math.cos(radians / 2);
390
+ return `embedded_instances {
391
+ id: "${name}"
392
+ data: ""
393
+ position {
394
+ x: ${pos.x}
395
+ y: ${pos.y}
396
+ z: 0.0
397
+ }
398
+ rotation {
399
+ x: 0.0
400
+ y: 0.0
401
+ z: ${qz.toFixed(6)}
402
+ w: ${qw.toFixed(6)}
403
+ }
404
+ scale3 {
405
+ x: ${scale.x}
406
+ y: ${scale.y}
407
+ z: 1.0
408
+ }
409
+ }
468
410
  `;
469
- this.addTextFile(`main/go/${name}.go`, goContent);
470
- // Generate entity script
471
- const entityScript = this.generateEntityScript(entity);
472
- this.addTextFile(`main/scripts/${name}.script`, entityScript);
473
- // Generate sprite definition if has sprite component
474
- const hasSprite = entity.components.some((c) => c.type === 'sprite');
475
- if (hasSprite) {
476
- await this.generateSpriteDefinition(entity);
477
- }
478
- // Generate collision object if has physics
479
- const hasPhysics = entity.components.some((c) => c.type === 'rigidbody' || c.type.includes('Collider'));
480
- if (hasPhysics) {
481
- await this.generateCollisionObject(entity);
482
- }
411
+ }
412
+ async generateGameObject(entity, _options) {
413
+ const name = (entity.name ?? entity.id).toLowerCase().replace(/[^a-z0-9_]/g, "_");
414
+ let goContent = "";
415
+ for (const comp of entity.components) {
416
+ const mapper = DEFOLD_COMPONENT_MAP[comp.type];
417
+ if (mapper) {
418
+ goContent += mapper(comp, entity) + "\n";
419
+ }
483
420
  }
484
- generateEntityScript(entity) {
485
- const name = entity.name ?? entity.id;
486
- const tags = entity.tags ?? [];
487
- return `-- ${name} Entity Script
488
- -- Generated from Nice2Dev
489
-
490
- -- Properties
491
- go.property("speed", ${this.getComponentProperty(entity, 'movement', 'speed', 200)})
492
- go.property("health", ${this.getComponentProperty(entity, 'health', 'max', 100)})
493
- go.property("max_health", ${this.getComponentProperty(entity, 'health', 'max', 100)})
494
-
495
- -- Tags: ${tags.join(', ') || 'none'}
496
-
497
- -- Initialize
498
- function init(self)
499
- self.velocity = vmath.vector3(0, 0, 0)
500
- self.is_alive = true
501
- self.tags = {${tags.map((t) => `["${t}"] = true`).join(', ')}}
502
-
503
- -- Register with game manager
504
- msg.post("/game_manager#game_manager", "register_entity", {
505
- id = go.get_id(),
506
- name = "${name}",
507
- tags = self.tags,
508
- })
509
- end
510
-
511
- -- Update (called every frame)
512
- function update(self, dt)
513
- if not self.is_alive then return end
514
-
515
- -- Apply velocity
516
- if vmath.length(self.velocity) > 0 then
517
- local pos = go.get_position()
518
- pos = pos + self.velocity * dt
519
- go.set_position(pos)
520
- end
521
- end
522
-
523
- -- Fixed update (physics)
524
- function fixed_update(self, dt)
525
- -- Physics updates here
526
- end
527
-
528
- -- Handle messages
529
- function on_message(self, message_id, message, sender)
530
- if message_id == hash("take_damage") then
531
- self.health = self.health - (message.amount or 10)
532
- if self.health <= 0 then
533
- self:die()
534
- end
535
- elseif message_id == hash("heal") then
536
- self.health = math.min(self.health + (message.amount or 10), self.max_health)
537
- elseif message_id == hash("set_velocity") then
538
- self.velocity = message.velocity or vmath.vector3(0, 0, 0)
539
- elseif message_id == hash("destroy") then
540
- self:die()
541
- end
542
- end
543
-
544
- -- Handle input (if enabled)
545
- function on_input(self, action_id, action)
546
- -- Input handling here
547
- return false
548
- end
549
-
550
- -- Cleanup
551
- function final(self)
552
- msg.post("/game_manager#game_manager", "unregister_entity", {
553
- id = go.get_id(),
554
- })
555
- end
556
-
557
- -- Custom methods
558
- function die(self)
559
- self.is_alive = false
560
- -- Play death animation/effect
561
- -- Then delete
562
- go.delete()
563
- end
564
-
565
- function has_tag(self, tag)
566
- return self.tags[tag] == true
567
- end
421
+ goContent += `components {
422
+ id: "script"
423
+ component: "/main/scripts/${name}.script"
424
+ position {
425
+ x: 0.0
426
+ y: 0.0
427
+ z: 0.0
428
+ }
429
+ rotation {
430
+ x: 0.0
431
+ y: 0.0
432
+ z: 0.0
433
+ w: 1.0
434
+ }
435
+ }
568
436
  `;
437
+ this.addTextFile(`main/go/${name}.go`, goContent);
438
+ const entityScript = this.generateEntityScript(entity);
439
+ this.addTextFile(`main/scripts/${name}.script`, entityScript);
440
+ const hasSprite = entity.components.some((c) => c.type === "sprite");
441
+ if (hasSprite) {
442
+ await this.generateSpriteDefinition(entity);
569
443
  }
570
- getComponentProperty(entity, componentType, property, defaultValue) {
571
- const comp = entity.components.find((c) => c.type === componentType);
572
- if (comp && comp.properties && property in comp.properties) {
573
- return comp.properties[property];
574
- }
575
- return defaultValue;
444
+ const hasPhysics = entity.components.some(
445
+ (c) => c.type === "rigidbody" || c.type.includes("Collider")
446
+ );
447
+ if (hasPhysics) {
448
+ await this.generateCollisionObject(entity);
576
449
  }
577
- async generateSpriteDefinition(entity) {
578
- const name = (entity.name ?? entity.id).toLowerCase().replace(/[^a-z0-9_]/g, '_');
579
- const spriteContent = `tile_set: "/main/atlases/main.atlas"
580
- default_animation: "default"
581
- material: "/builtins/materials/sprite.material"
582
- blend_mode: BLEND_MODE_ALPHA
450
+ }
451
+ generateEntityScript(entity) {
452
+ const name = entity.name ?? entity.id;
453
+ const tags = entity.tags ?? [];
454
+ return `-- ${name} Entity Script
455
+ -- Generated from Nice2Dev
456
+
457
+ -- Properties
458
+ go.property("speed", ${this.getComponentProperty(entity, "movement", "speed", 200)})
459
+ go.property("health", ${this.getComponentProperty(entity, "health", "max", 100)})
460
+ go.property("max_health", ${this.getComponentProperty(entity, "health", "max", 100)})
461
+
462
+ -- Tags: ${tags.join(", ") || "none"}
463
+
464
+ -- Initialize
465
+ function init(self)
466
+ self.velocity = vmath.vector3(0, 0, 0)
467
+ self.is_alive = true
468
+ self.tags = {${tags.map((t) => `["${t}"] = true`).join(", ")}}
469
+
470
+ -- Register with game manager
471
+ msg.post("/game_manager#game_manager", "register_entity", {
472
+ id = go.get_id(),
473
+ name = "${name}",
474
+ tags = self.tags,
475
+ })
476
+ end
477
+
478
+ -- Update (called every frame)
479
+ function update(self, dt)
480
+ if not self.is_alive then return end
481
+
482
+ -- Apply velocity
483
+ if vmath.length(self.velocity) > 0 then
484
+ local pos = go.get_position()
485
+ pos = pos + self.velocity * dt
486
+ go.set_position(pos)
487
+ end
488
+ end
489
+
490
+ -- Fixed update (physics)
491
+ function fixed_update(self, dt)
492
+ -- Physics updates here
493
+ end
494
+
495
+ -- Handle messages
496
+ function on_message(self, message_id, message, sender)
497
+ if message_id == hash("take_damage") then
498
+ self.health = self.health - (message.amount or 10)
499
+ if self.health <= 0 then
500
+ self:die()
501
+ end
502
+ elseif message_id == hash("heal") then
503
+ self.health = math.min(self.health + (message.amount or 10), self.max_health)
504
+ elseif message_id == hash("set_velocity") then
505
+ self.velocity = message.velocity or vmath.vector3(0, 0, 0)
506
+ elseif message_id == hash("destroy") then
507
+ self:die()
508
+ end
509
+ end
510
+
511
+ -- Handle input (if enabled)
512
+ function on_input(self, action_id, action)
513
+ -- Input handling here
514
+ return false
515
+ end
516
+
517
+ -- Cleanup
518
+ function final(self)
519
+ msg.post("/game_manager#game_manager", "unregister_entity", {
520
+ id = go.get_id(),
521
+ })
522
+ end
523
+
524
+ -- Custom methods
525
+ function die(self)
526
+ self.is_alive = false
527
+ -- Play death animation/effect
528
+ -- Then delete
529
+ go.delete()
530
+ end
531
+
532
+ function has_tag(self, tag)
533
+ return self.tags[tag] == true
534
+ end
583
535
  `;
584
- this.addTextFile(`main/sprites/${name}.sprite`, spriteContent);
536
+ }
537
+ getComponentProperty(entity, componentType, property, defaultValue) {
538
+ const comp = entity.components.find((c) => c.type === componentType);
539
+ if (comp && comp.properties && property in comp.properties) {
540
+ return comp.properties[property];
585
541
  }
586
- async generateCollisionObject(entity) {
587
- const name = (entity.name ?? entity.id).toLowerCase().replace(/[^a-z0-9_]/g, '_');
588
- const hasRigidbody = entity.components.some((c) => c.type === 'rigidbody');
589
- const scale = entity.scale ?? { x: 1, y: 1 };
590
- const collisionContent = `collision_shape: ""
591
- type: ${hasRigidbody ? 'COLLISION_OBJECT_TYPE_DYNAMIC' : 'COLLISION_OBJECT_TYPE_STATIC'}
592
- mass: ${this.getComponentProperty(entity, 'rigidbody', 'mass', 1)}
593
- friction: 0.5
594
- restitution: 0.2
595
- group: "default"
596
- mask: "default"
597
- linear_damping: ${this.getComponentProperty(entity, 'rigidbody', 'linearDamping', 0)}
598
- angular_damping: ${this.getComponentProperty(entity, 'rigidbody', 'angularDamping', 0)}
599
- locked_rotation: false
600
- bullet: false
601
- embedded_collision_shape {
602
- shapes {
603
- shape_type: TYPE_BOX
604
- position {
605
- x: 0.0
606
- y: 0.0
607
- z: 0.0
608
- }
609
- rotation {
610
- x: 0.0
611
- y: 0.0
612
- z: 0.0
613
- w: 1.0
614
- }
615
- index: 0
616
- count: 3
617
- }
618
- data: ${32 * scale.x}
619
- data: ${32 * scale.y}
620
- data: 0.0
621
- }
542
+ return defaultValue;
543
+ }
544
+ async generateSpriteDefinition(entity) {
545
+ const name = (entity.name ?? entity.id).toLowerCase().replace(/[^a-z0-9_]/g, "_");
546
+ const spriteContent = `tile_set: "/main/atlases/main.atlas"
547
+ default_animation: "default"
548
+ material: "/builtins/materials/sprite.material"
549
+ blend_mode: BLEND_MODE_ALPHA
622
550
  `;
623
- this.addTextFile(`main/collision/${name}.collisionobject`, collisionContent);
551
+ this.addTextFile(`main/sprites/${name}.sprite`, spriteContent);
552
+ }
553
+ async generateCollisionObject(entity) {
554
+ const name = (entity.name ?? entity.id).toLowerCase().replace(/[^a-z0-9_]/g, "_");
555
+ const hasRigidbody = entity.components.some((c) => c.type === "rigidbody");
556
+ const scale = entity.scale ?? { x: 1, y: 1 };
557
+ const collisionContent = `collision_shape: ""
558
+ type: ${hasRigidbody ? "COLLISION_OBJECT_TYPE_DYNAMIC" : "COLLISION_OBJECT_TYPE_STATIC"}
559
+ mass: ${this.getComponentProperty(entity, "rigidbody", "mass", 1)}
560
+ friction: 0.5
561
+ restitution: 0.2
562
+ group: "default"
563
+ mask: "default"
564
+ linear_damping: ${this.getComponentProperty(entity, "rigidbody", "linearDamping", 0)}
565
+ angular_damping: ${this.getComponentProperty(entity, "rigidbody", "angularDamping", 0)}
566
+ locked_rotation: false
567
+ bullet: false
568
+ embedded_collision_shape {
569
+ shapes {
570
+ shape_type: TYPE_BOX
571
+ position {
572
+ x: 0.0
573
+ y: 0.0
574
+ z: 0.0
624
575
  }
625
- /* ── Prefab Export ──────────────────────────────────────────── */
626
- async exportPrefab(prefab, options) {
627
- // Prefabs in Defold are just regular game objects that can be spawned
628
- await this.generateGameObject(prefab.entity, options);
629
- // Generate factory for spawning
630
- const name = prefab.name.toLowerCase().replace(/[^a-z0-9_]/g, '_');
631
- const factoryContent = `prototype: "/main/go/${name}.go"
632
- load_dynamically: false
633
- `;
634
- this.addTextFile(`main/factories/${name}.factory`, factoryContent);
576
+ rotation {
577
+ x: 0.0
578
+ y: 0.0
579
+ z: 0.0
580
+ w: 1.0
635
581
  }
636
- /* ── Scene Script ───────────────────────────────────────────── */
637
- generateSceneScript(scene, project) {
638
- const sceneName = scene.name;
639
- return `-- ${sceneName} Scene Controller
640
- -- Generated from Nice2Dev
641
-
642
- -- Properties
643
- go.property("music_volume", ${project.settings.audio.masterVolume})
644
- go.property("sfx_volume", 1.0)
645
-
646
- function init(self)
647
- self.entities = {}
648
- self.is_paused = false
649
-
650
- -- Acquire input focus
651
- msg.post(".", "acquire_input_focus")
652
-
653
- print("[Scene] ${sceneName} initialized")
654
- end
655
-
656
- function update(self, dt)
657
- if self.is_paused then return end
658
-
659
- -- Scene update logic
660
- end
661
-
662
- function on_message(self, message_id, message, sender)
663
- if message_id == hash("pause") then
664
- self.is_paused = true
665
- elseif message_id == hash("resume") then
666
- self.is_paused = false
667
- elseif message_id == hash("entity_spawned") then
668
- self.entities[message.id] = message
669
- elseif message_id == hash("entity_destroyed") then
670
- self.entities[message.id] = nil
671
- end
672
- end
673
-
674
- function on_input(self, action_id, action)
675
- if action_id == hash("pause") and action.pressed then
676
- self.is_paused = not self.is_paused
677
- msg.post("/game_manager#game_manager", self.is_paused and "pause" or "resume")
678
- end
679
- return false
680
- end
681
-
682
- function final(self)
683
- msg.post(".", "release_input_focus")
684
- print("[Scene] ${sceneName} finalized")
685
- end
582
+ index: 0
583
+ count: 3
584
+ }
585
+ data: ${32 * scale.x}
586
+ data: ${32 * scale.y}
587
+ data: 0.0
588
+ }
686
589
  `;
687
- }
688
- /* ── Shared Scripts ─────────────────────────────────────────── */
689
- async generateSharedScripts(project, _options) {
690
- // Game Manager Script
691
- const gameManagerScript = `-- Game Manager
692
- -- Central game state and utility management
693
- -- Generated from Nice2Dev
694
-
695
- -- Settings from Nice2Dev project
696
- local SETTINGS = {
697
- game_width = ${project.settings.resolution.width},
698
- game_height = ${project.settings.resolution.height},
699
- master_volume = ${project.settings.audio.masterVolume},
700
- physics_enabled = ${project.settings.physics.enabled},
701
- gravity_x = ${project.settings.physics.gravity.x},
702
- gravity_y = ${project.settings.physics.gravity.y},
703
- }
704
-
705
- -- Game state
706
- local state = {
707
- is_paused = false,
708
- entities = {},
709
- global_variables = {},
710
- current_scene = nil,
711
- }
712
-
713
- function init(self)
714
- self.state = state
715
- self.settings = SETTINGS
716
-
717
- print("[GameManager] Initialized - ${project.name} v${project.version}")
718
- end
719
-
720
- function update(self, dt)
721
- if self.state.is_paused then return end
722
-
723
- -- Global game update
724
- end
725
-
726
- function on_message(self, message_id, message, sender)
727
- if message_id == hash("pause") then
728
- self.state.is_paused = true
729
- print("[GameManager] Game paused")
730
- elseif message_id == hash("resume") then
731
- self.state.is_paused = false
732
- print("[GameManager] Game resumed")
733
- elseif message_id == hash("register_entity") then
734
- self.state.entities[message.id] = {
735
- id = message.id,
736
- name = message.name,
737
- tags = message.tags,
738
- }
739
- elseif message_id == hash("unregister_entity") then
740
- self.state.entities[message.id] = nil
741
- elseif message_id == hash("set_variable") then
742
- self.state.global_variables[message.key] = message.value
743
- elseif message_id == hash("get_variable") then
744
- msg.post(sender, "variable_value", {
745
- key = message.key,
746
- value = self.state.global_variables[message.key],
747
- })
748
- elseif message_id == hash("load_scene") then
749
- self:load_scene(message.scene)
750
- end
751
- end
752
-
753
- function load_scene(self, scene_name)
754
- if self.state.current_scene then
755
- -- Unload current scene
756
- msg.post("#" .. self.state.current_scene, "unload")
757
- end
758
-
759
- -- Load new scene
760
- self.state.current_scene = scene_name
761
- msg.post("#" .. scene_name, "load")
762
-
763
- print("[GameManager] Loaded scene: " .. scene_name)
764
- end
765
-
766
- -- Utility functions accessible via msg
767
- function get_entities_by_tag(self, tag)
768
- local result = {}
769
- for id, entity in pairs(self.state.entities) do
770
- if entity.tags and entity.tags[tag] then
771
- table.insert(result, entity)
772
- end
773
- end
774
- return result
775
- end
590
+ this.addTextFile(`main/collision/${name}.collisionobject`, collisionContent);
591
+ }
592
+ /* ── Prefab Export ──────────────────────────────────────────── */
593
+ async exportPrefab(prefab, options) {
594
+ await this.generateGameObject(prefab.entity, options);
595
+ const name = prefab.name.toLowerCase().replace(/[^a-z0-9_]/g, "_");
596
+ const factoryContent = `prototype: "/main/go/${name}.go"
597
+ load_dynamically: false
598
+ `;
599
+ this.addTextFile(`main/factories/${name}.factory`, factoryContent);
600
+ }
601
+ /* ── Scene Script ───────────────────────────────────────────── */
602
+ generateSceneScript(scene, project) {
603
+ const sceneName = scene.name;
604
+ return `-- ${sceneName} Scene Controller
605
+ -- Generated from Nice2Dev
606
+
607
+ -- Properties
608
+ go.property("music_volume", ${project.settings.audio.masterVolume})
609
+ go.property("sfx_volume", 1.0)
610
+
611
+ function init(self)
612
+ self.entities = {}
613
+ self.is_paused = false
614
+
615
+ -- Acquire input focus
616
+ msg.post(".", "acquire_input_focus")
617
+
618
+ print("[Scene] ${sceneName} initialized")
619
+ end
620
+
621
+ function update(self, dt)
622
+ if self.is_paused then return end
623
+
624
+ -- Scene update logic
625
+ end
626
+
627
+ function on_message(self, message_id, message, sender)
628
+ if message_id == hash("pause") then
629
+ self.is_paused = true
630
+ elseif message_id == hash("resume") then
631
+ self.is_paused = false
632
+ elseif message_id == hash("entity_spawned") then
633
+ self.entities[message.id] = message
634
+ elseif message_id == hash("entity_destroyed") then
635
+ self.entities[message.id] = nil
636
+ end
637
+ end
638
+
639
+ function on_input(self, action_id, action)
640
+ if action_id == hash("pause") and action.pressed then
641
+ self.is_paused = not self.is_paused
642
+ msg.post("/game_manager#game_manager", self.is_paused and "pause" or "resume")
643
+ end
644
+ return false
645
+ end
646
+
647
+ function final(self)
648
+ msg.post(".", "release_input_focus")
649
+ print("[Scene] ${sceneName} finalized")
650
+ end
776
651
  `;
777
- this.addTextFile('main/scripts/game_manager.script', gameManagerScript);
778
- // Input bindings
779
- const inputBindings = `key_trigger {
780
- input: KEY_SPACE
781
- action: "jump"
782
- }
783
- key_trigger {
784
- input: KEY_W
785
- action: "up"
786
- }
787
- key_trigger {
788
- input: KEY_S
789
- action: "down"
790
- }
791
- key_trigger {
792
- input: KEY_A
793
- action: "left"
794
- }
795
- key_trigger {
796
- input: KEY_D
797
- action: "right"
798
- }
799
- key_trigger {
800
- input: KEY_UP
801
- action: "up"
802
- }
803
- key_trigger {
804
- input: KEY_DOWN
805
- action: "down"
806
- }
807
- key_trigger {
808
- input: KEY_LEFT
809
- action: "left"
810
- }
811
- key_trigger {
812
- input: KEY_RIGHT
813
- action: "right"
814
- }
815
- key_trigger {
816
- input: KEY_ESC
817
- action: "pause"
818
- }
819
- key_trigger {
820
- input: KEY_P
821
- action: "pause"
822
- }
823
- mouse_trigger {
824
- input: MOUSE_BUTTON_LEFT
825
- action: "click"
826
- }
827
- mouse_trigger {
828
- input: MOUSE_BUTTON_RIGHT
829
- action: "right_click"
830
- }
831
- touch_trigger {
832
- input: TOUCH_MULTI
833
- action: "touch"
834
- }
652
+ }
653
+ /* ── Shared Scripts ─────────────────────────────────────────── */
654
+ async generateSharedScripts(project, _options) {
655
+ const gameManagerScript = `-- Game Manager
656
+ -- Central game state and utility management
657
+ -- Generated from Nice2Dev
658
+
659
+ -- Settings from Nice2Dev project
660
+ local SETTINGS = {
661
+ game_width = ${project.settings.resolution.width},
662
+ game_height = ${project.settings.resolution.height},
663
+ master_volume = ${project.settings.audio.masterVolume},
664
+ physics_enabled = ${project.settings.physics.enabled},
665
+ gravity_x = ${project.settings.physics.gravity.x},
666
+ gravity_y = ${project.settings.physics.gravity.y},
667
+ }
668
+
669
+ -- Game state
670
+ local state = {
671
+ is_paused = false,
672
+ entities = {},
673
+ global_variables = {},
674
+ current_scene = nil,
675
+ }
676
+
677
+ function init(self)
678
+ self.state = state
679
+ self.settings = SETTINGS
680
+
681
+ print("[GameManager] Initialized - ${project.name} v${project.version}")
682
+ end
683
+
684
+ function update(self, dt)
685
+ if self.state.is_paused then return end
686
+
687
+ -- Global game update
688
+ end
689
+
690
+ function on_message(self, message_id, message, sender)
691
+ if message_id == hash("pause") then
692
+ self.state.is_paused = true
693
+ print("[GameManager] Game paused")
694
+ elseif message_id == hash("resume") then
695
+ self.state.is_paused = false
696
+ print("[GameManager] Game resumed")
697
+ elseif message_id == hash("register_entity") then
698
+ self.state.entities[message.id] = {
699
+ id = message.id,
700
+ name = message.name,
701
+ tags = message.tags,
702
+ }
703
+ elseif message_id == hash("unregister_entity") then
704
+ self.state.entities[message.id] = nil
705
+ elseif message_id == hash("set_variable") then
706
+ self.state.global_variables[message.key] = message.value
707
+ elseif message_id == hash("get_variable") then
708
+ msg.post(sender, "variable_value", {
709
+ key = message.key,
710
+ value = self.state.global_variables[message.key],
711
+ })
712
+ elseif message_id == hash("load_scene") then
713
+ self:load_scene(message.scene)
714
+ end
715
+ end
716
+
717
+ function load_scene(self, scene_name)
718
+ if self.state.current_scene then
719
+ -- Unload current scene
720
+ msg.post("#" .. self.state.current_scene, "unload")
721
+ end
722
+
723
+ -- Load new scene
724
+ self.state.current_scene = scene_name
725
+ msg.post("#" .. scene_name, "load")
726
+
727
+ print("[GameManager] Loaded scene: " .. scene_name)
728
+ end
729
+
730
+ -- Utility functions accessible via msg
731
+ function get_entities_by_tag(self, tag)
732
+ local result = {}
733
+ for id, entity in pairs(self.state.entities) do
734
+ if entity.tags and entity.tags[tag] then
735
+ table.insert(result, entity)
736
+ end
737
+ end
738
+ return result
739
+ end
835
740
  `;
836
- this.addTextFile('input/game.input_binding', inputBindings);
837
- // Main atlas (placeholder)
838
- const atlasContent = `images {
839
- image: "/main/images/placeholder.png"
840
- }
841
- margin: 0
842
- extrude_borders: 2
843
- inner_padding: 0
741
+ this.addTextFile("main/scripts/game_manager.script", gameManagerScript);
742
+ const inputBindings = `key_trigger {
743
+ input: KEY_SPACE
744
+ action: "jump"
745
+ }
746
+ key_trigger {
747
+ input: KEY_W
748
+ action: "up"
749
+ }
750
+ key_trigger {
751
+ input: KEY_S
752
+ action: "down"
753
+ }
754
+ key_trigger {
755
+ input: KEY_A
756
+ action: "left"
757
+ }
758
+ key_trigger {
759
+ input: KEY_D
760
+ action: "right"
761
+ }
762
+ key_trigger {
763
+ input: KEY_UP
764
+ action: "up"
765
+ }
766
+ key_trigger {
767
+ input: KEY_DOWN
768
+ action: "down"
769
+ }
770
+ key_trigger {
771
+ input: KEY_LEFT
772
+ action: "left"
773
+ }
774
+ key_trigger {
775
+ input: KEY_RIGHT
776
+ action: "right"
777
+ }
778
+ key_trigger {
779
+ input: KEY_ESC
780
+ action: "pause"
781
+ }
782
+ key_trigger {
783
+ input: KEY_P
784
+ action: "pause"
785
+ }
786
+ mouse_trigger {
787
+ input: MOUSE_BUTTON_LEFT
788
+ action: "click"
789
+ }
790
+ mouse_trigger {
791
+ input: MOUSE_BUTTON_RIGHT
792
+ action: "right_click"
793
+ }
794
+ touch_trigger {
795
+ input: TOUCH_MULTI
796
+ action: "touch"
797
+ }
844
798
  `;
845
- this.addTextFile('main/atlases/main.atlas', atlasContent);
846
- // Utility module
847
- const utilityModule = `-- Nice2Dev Utility Module
848
- -- Common utility functions
849
-
850
- local M = {}
851
-
852
- -- Math utilities
853
- function M.lerp(a, b, t)
854
- return a + (b - a) * math.max(0, math.min(1, t))
855
- end
856
-
857
- function M.lerp_vector(a, b, t)
858
- t = math.max(0, math.min(1, t))
859
- return vmath.vector3(
860
- a.x + (b.x - a.x) * t,
861
- a.y + (b.y - a.y) * t,
862
- a.z + (b.z - a.z) * t
863
- )
864
- end
865
-
866
- function M.distance(a, b)
867
- return vmath.length(b - a)
868
- end
869
-
870
- function M.angle_between(a, b)
871
- local diff = b - a
872
- return math.atan2(diff.y, diff.x)
873
- end
874
-
875
- function M.random_range(min, max)
876
- return min + math.random() * (max - min)
877
- end
878
-
879
- function M.random_int(min, max)
880
- return math.random(min, max)
881
- end
882
-
883
- function M.clamp(value, min, max)
884
- return math.max(min, math.min(max, value))
885
- end
886
-
887
- -- Timer utilities
888
- M.timers = {}
889
-
890
- function M.set_timeout(callback, delay)
891
- local id = tostring(socket.gettime())
892
- M.timers[id] = {
893
- callback = callback,
894
- remaining = delay,
895
- repeat_interval = nil,
896
- }
897
- return id
898
- end
899
-
900
- function M.set_interval(callback, interval)
901
- local id = tostring(socket.gettime())
902
- M.timers[id] = {
903
- callback = callback,
904
- remaining = interval,
905
- repeat_interval = interval,
906
- }
907
- return id
908
- end
909
-
910
- function M.clear_timer(id)
911
- M.timers[id] = nil
912
- end
913
-
914
- function M.update_timers(dt)
915
- for id, timer in pairs(M.timers) do
916
- timer.remaining = timer.remaining - dt
917
- if timer.remaining <= 0 then
918
- timer.callback()
919
- if timer.repeat_interval then
920
- timer.remaining = timer.repeat_interval
921
- else
922
- M.timers[id] = nil
923
- end
924
- end
925
- end
926
- end
927
-
928
- -- Spawn utilities
929
- function M.spawn(factory_url, position, properties)
930
- local id = factory.create(factory_url, position, nil, properties)
931
- return id
932
- end
933
-
934
- function M.spawn_at(factory_url, x, y, z, properties)
935
- return M.spawn(factory_url, vmath.vector3(x, y, z or 0), properties)
936
- end
937
-
938
- return M
799
+ this.addTextFile("input/game.input_binding", inputBindings);
800
+ const atlasContent = `images {
801
+ image: "/main/images/placeholder.png"
802
+ }
803
+ margin: 0
804
+ extrude_borders: 2
805
+ inner_padding: 0
939
806
  `;
940
- this.addTextFile('main/scripts/utility.lua', utilityModule);
807
+ this.addTextFile("main/atlases/main.atlas", atlasContent);
808
+ const utilityModule = `-- Nice2Dev Utility Module
809
+ -- Common utility functions
810
+
811
+ local M = {}
812
+
813
+ -- Math utilities
814
+ function M.lerp(a, b, t)
815
+ return a + (b - a) * math.max(0, math.min(1, t))
816
+ end
817
+
818
+ function M.lerp_vector(a, b, t)
819
+ t = math.max(0, math.min(1, t))
820
+ return vmath.vector3(
821
+ a.x + (b.x - a.x) * t,
822
+ a.y + (b.y - a.y) * t,
823
+ a.z + (b.z - a.z) * t
824
+ )
825
+ end
826
+
827
+ function M.distance(a, b)
828
+ return vmath.length(b - a)
829
+ end
830
+
831
+ function M.angle_between(a, b)
832
+ local diff = b - a
833
+ return math.atan2(diff.y, diff.x)
834
+ end
835
+
836
+ function M.random_range(min, max)
837
+ return min + math.random() * (max - min)
838
+ end
839
+
840
+ function M.random_int(min, max)
841
+ return math.random(min, max)
842
+ end
843
+
844
+ function M.clamp(value, min, max)
845
+ return math.max(min, math.min(max, value))
846
+ end
847
+
848
+ -- Timer utilities
849
+ M.timers = {}
850
+
851
+ function M.set_timeout(callback, delay)
852
+ local id = tostring(socket.gettime())
853
+ M.timers[id] = {
854
+ callback = callback,
855
+ remaining = delay,
856
+ repeat_interval = nil,
941
857
  }
942
- /* ── App Manifest ───────────────────────────────────────────── */
943
- async generateAppManifest(_project, _options) {
944
- const manifest = `platforms:
945
- x86_64-osx:
946
- context:
947
- excludeLibs: []
948
- excludeSymbols: []
949
- symbols: []
950
- libs: []
951
- linkFlags: []
952
- x86_64-linux:
953
- context:
954
- excludeLibs: []
955
- excludeSymbols: []
956
- symbols: []
957
- libs: []
958
- linkFlags: []
959
- js-web:
960
- context:
961
- excludeLibs: []
962
- excludeJsLibs: []
963
- excludeSymbols: []
964
- symbols: []
965
- libs: []
966
- linkFlags: []
967
- wasm-web:
968
- context:
969
- excludeLibs: []
970
- excludeJsLibs: []
971
- excludeSymbols: []
972
- symbols: []
973
- libs: []
974
- linkFlags: []
975
- x86-win32:
976
- context:
977
- excludeLibs: []
978
- excludeSymbols: []
979
- symbols: []
980
- libs: []
981
- linkFlags: []
982
- x86_64-win32:
983
- context:
984
- excludeLibs: []
985
- excludeSymbols: []
986
- symbols: []
987
- libs: []
988
- linkFlags: []
989
- armv7-android:
990
- context:
991
- excludeLibs: []
992
- excludeJars: []
993
- excludeSymbols: []
994
- symbols: []
995
- libs: []
996
- linkFlags: []
997
- jetifier: true
998
- arm64-android:
999
- context:
1000
- excludeLibs: []
1001
- excludeJars: []
1002
- excludeSymbols: []
1003
- symbols: []
1004
- libs: []
1005
- linkFlags: []
1006
- jetifier: true
1007
- armv7-ios:
1008
- context:
1009
- excludeLibs: []
1010
- excludeSymbols: []
1011
- symbols: []
1012
- libs: []
1013
- linkFlags: []
1014
- arm64-ios:
1015
- context:
1016
- excludeLibs: []
1017
- excludeSymbols: []
1018
- symbols: []
1019
- libs: []
1020
- linkFlags: []
1021
- x86_64-ios:
1022
- context:
1023
- excludeLibs: []
1024
- excludeSymbols: []
1025
- symbols: []
1026
- libs: []
1027
- linkFlags: []
1028
- `;
1029
- this.addTextFile('app.manifest', manifest);
858
+ return id
859
+ end
860
+
861
+ function M.set_interval(callback, interval)
862
+ local id = tostring(socket.gettime())
863
+ M.timers[id] = {
864
+ callback = callback,
865
+ remaining = interval,
866
+ repeat_interval = interval,
1030
867
  }
1031
- /* ── README ─────────────────────────────────────────────────── */
1032
- async generateReadme(project, _options) {
1033
- const readme = `# ${project.name} - Defold Export
1034
-
1035
- Generated from Nice2Dev project v${project.version}
1036
-
1037
- ## Installation
1038
-
1039
- 1. Install Defold Editor from https://defold.com/
1040
- 2. Open Defold and create a new project from this folder
1041
- 3. Or copy contents to existing project
1042
-
1043
- ## Project Structure
1044
-
1045
- - \`game.project\` - Main project configuration
1046
- - \`main/main.collection\` - Bootstrap collection
1047
- - \`main/scenes/\` - Scene collections
1048
- - \`main/go/\` - Game object definitions
1049
- - \`main/scripts/\` - Lua scripts
1050
- - \`main/sprites/\` - Sprite definitions
1051
- - \`main/collision/\` - Collision objects
1052
- - \`main/factories/\` - Factory components (for spawning)
1053
- - \`main/atlases/\` - Texture atlases
1054
- - \`input/\` - Input bindings
1055
-
1056
- ## Scenes
1057
-
1058
- ${project.scenes.map((s) => `- ${s.name} (${s.entities.length} entities)`).join('\n')}
1059
-
1060
- ## Key Scripts
1061
-
1062
- ### game_manager.script
1063
- Central game state management:
1064
- - Pause/Resume handling
1065
- - Entity registration
1066
- - Global variables
1067
- - Scene loading
1068
-
1069
- ### utility.lua
1070
- Common utility functions:
1071
- - Math helpers (lerp, distance, clamp)
1072
- - Timer system (setTimeout, setInterval)
1073
- - Spawn utilities
1074
-
1075
- ## Input Bindings
1076
-
1077
- - WASD / Arrow Keys: Movement
1078
- - Space: Jump
1079
- - P / Escape: Pause
1080
- - Mouse: Click, Right-click
1081
- - Touch: Multi-touch support
1082
-
1083
- ## Notes
1084
-
1085
- - Add your textures to \`main/images/\` and update atlases
1086
- - Configure physics in \`game.project\` [physics] section
1087
- - Adjust collision groups as needed
1088
-
1089
- ## Settings
1090
-
1091
- - Resolution: ${project.settings.resolution.width}x${project.settings.resolution.height}
1092
- - Physics: ${project.settings.physics.enabled ? 'Enabled' : 'Disabled'}
1093
- - Gravity: (${project.settings.physics.gravity.x}, ${project.settings.physics.gravity.y})
1094
- - Master Volume: ${project.settings.audio.masterVolume}
868
+ return id
869
+ end
870
+
871
+ function M.clear_timer(id)
872
+ M.timers[id] = nil
873
+ end
874
+
875
+ function M.update_timers(dt)
876
+ for id, timer in pairs(M.timers) do
877
+ timer.remaining = timer.remaining - dt
878
+ if timer.remaining <= 0 then
879
+ timer.callback()
880
+ if timer.repeat_interval then
881
+ timer.remaining = timer.repeat_interval
882
+ else
883
+ M.timers[id] = nil
884
+ end
885
+ end
886
+ end
887
+ end
888
+
889
+ -- Spawn utilities
890
+ function M.spawn(factory_url, position, properties)
891
+ local id = factory.create(factory_url, position, nil, properties)
892
+ return id
893
+ end
894
+
895
+ function M.spawn_at(factory_url, x, y, z, properties)
896
+ return M.spawn(factory_url, vmath.vector3(x, y, z or 0), properties)
897
+ end
898
+
899
+ return M
1095
900
  `;
1096
- this.addTextFile('README.md', readme);
1097
- }
901
+ this.addTextFile("main/scripts/utility.lua", utilityModule);
902
+ }
903
+ /* ── App Manifest ───────────────────────────────────────────── */
904
+ async generateAppManifest(_project, _options) {
905
+ const manifest = `platforms:
906
+ x86_64-osx:
907
+ context:
908
+ excludeLibs: []
909
+ excludeSymbols: []
910
+ symbols: []
911
+ libs: []
912
+ linkFlags: []
913
+ x86_64-linux:
914
+ context:
915
+ excludeLibs: []
916
+ excludeSymbols: []
917
+ symbols: []
918
+ libs: []
919
+ linkFlags: []
920
+ js-web:
921
+ context:
922
+ excludeLibs: []
923
+ excludeJsLibs: []
924
+ excludeSymbols: []
925
+ symbols: []
926
+ libs: []
927
+ linkFlags: []
928
+ wasm-web:
929
+ context:
930
+ excludeLibs: []
931
+ excludeJsLibs: []
932
+ excludeSymbols: []
933
+ symbols: []
934
+ libs: []
935
+ linkFlags: []
936
+ x86-win32:
937
+ context:
938
+ excludeLibs: []
939
+ excludeSymbols: []
940
+ symbols: []
941
+ libs: []
942
+ linkFlags: []
943
+ x86_64-win32:
944
+ context:
945
+ excludeLibs: []
946
+ excludeSymbols: []
947
+ symbols: []
948
+ libs: []
949
+ linkFlags: []
950
+ armv7-android:
951
+ context:
952
+ excludeLibs: []
953
+ excludeJars: []
954
+ excludeSymbols: []
955
+ symbols: []
956
+ libs: []
957
+ linkFlags: []
958
+ jetifier: true
959
+ arm64-android:
960
+ context:
961
+ excludeLibs: []
962
+ excludeJars: []
963
+ excludeSymbols: []
964
+ symbols: []
965
+ libs: []
966
+ linkFlags: []
967
+ jetifier: true
968
+ armv7-ios:
969
+ context:
970
+ excludeLibs: []
971
+ excludeSymbols: []
972
+ symbols: []
973
+ libs: []
974
+ linkFlags: []
975
+ arm64-ios:
976
+ context:
977
+ excludeLibs: []
978
+ excludeSymbols: []
979
+ symbols: []
980
+ libs: []
981
+ linkFlags: []
982
+ x86_64-ios:
983
+ context:
984
+ excludeLibs: []
985
+ excludeSymbols: []
986
+ symbols: []
987
+ libs: []
988
+ linkFlags: []
989
+ `;
990
+ this.addTextFile("app.manifest", manifest);
991
+ }
992
+ /* ── README ─────────────────────────────────────────────────── */
993
+ async generateReadme(project, _options) {
994
+ const readme = `# ${project.name} - Defold Export
995
+
996
+ Generated from Nice2Dev project v${project.version}
997
+
998
+ ## Installation
999
+
1000
+ 1. Install Defold Editor from https://defold.com/
1001
+ 2. Open Defold and create a new project from this folder
1002
+ 3. Or copy contents to existing project
1003
+
1004
+ ## Project Structure
1005
+
1006
+ - \`game.project\` - Main project configuration
1007
+ - \`main/main.collection\` - Bootstrap collection
1008
+ - \`main/scenes/\` - Scene collections
1009
+ - \`main/go/\` - Game object definitions
1010
+ - \`main/scripts/\` - Lua scripts
1011
+ - \`main/sprites/\` - Sprite definitions
1012
+ - \`main/collision/\` - Collision objects
1013
+ - \`main/factories/\` - Factory components (for spawning)
1014
+ - \`main/atlases/\` - Texture atlases
1015
+ - \`input/\` - Input bindings
1016
+
1017
+ ## Scenes
1018
+
1019
+ ${project.scenes.map((s) => `- ${s.name} (${s.entities.length} entities)`).join("\n")}
1020
+
1021
+ ## Key Scripts
1022
+
1023
+ ### game_manager.script
1024
+ Central game state management:
1025
+ - Pause/Resume handling
1026
+ - Entity registration
1027
+ - Global variables
1028
+ - Scene loading
1029
+
1030
+ ### utility.lua
1031
+ Common utility functions:
1032
+ - Math helpers (lerp, distance, clamp)
1033
+ - Timer system (setTimeout, setInterval)
1034
+ - Spawn utilities
1035
+
1036
+ ## Input Bindings
1037
+
1038
+ - WASD / Arrow Keys: Movement
1039
+ - Space: Jump
1040
+ - P / Escape: Pause
1041
+ - Mouse: Click, Right-click
1042
+ - Touch: Multi-touch support
1043
+
1044
+ ## Notes
1045
+
1046
+ - Add your textures to \`main/images/\` and update atlases
1047
+ - Configure physics in \`game.project\` [physics] section
1048
+ - Adjust collision groups as needed
1049
+
1050
+ ## Settings
1051
+
1052
+ - Resolution: ${project.settings.resolution.width}x${project.settings.resolution.height}
1053
+ - Physics: ${project.settings.physics.enabled ? "Enabled" : "Disabled"}
1054
+ - Gravity: (${project.settings.physics.gravity.x}, ${project.settings.physics.gravity.y})
1055
+ - Master Volume: ${project.settings.audio.masterVolume}
1056
+ `;
1057
+ this.addTextFile("README.md", readme);
1058
+ }
1098
1059
  }
1099
- /* ── Factory ──────────────────────────────────────────────────── */
1100
1060
  function createDefoldExporter() {
1101
- return new DefoldExporter();
1061
+ return new DefoldExporter();
1102
1062
  }
1103
-
1104
1063
  exports.DefoldExporter = DefoldExporter;
1105
1064
  exports.createDefoldExporter = createDefoldExporter;