gdcore-tools 1.0.6 → 1.0.7
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.
- package/GDevelop/ExtLibs/7za.exe +0 -0
- package/GDevelop/ExtLibs/curl.exe +0 -0
- package/GDevelop/scripts/libgettextlib-0-17.dll +0 -0
- package/GDevelop/scripts/libgettextsrc-0-17.dll +0 -0
- package/LICENSE +1 -1
- package/dist/Runtime/AsyncTasksManager.js +5 -0
- package/dist/Runtime/AsyncTasksManager.js.map +7 -0
- package/dist/Runtime/Cordova/config.xml +44 -0
- package/dist/Runtime/Cordova/package.json +22 -0
- package/dist/Runtime/Cordova/www/index.html +45 -0
- package/dist/Runtime/CustomRuntimeObject.js +2 -0
- package/dist/Runtime/CustomRuntimeObject.js.map +7 -0
- package/dist/Runtime/CustomRuntimeObjectInstanceContainer.js +2 -0
- package/dist/Runtime/CustomRuntimeObjectInstanceContainer.js.map +7 -0
- package/dist/Runtime/Electron/main.js +65 -0
- package/dist/Runtime/Electron/package.json +26 -0
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3D.js +2 -0
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3D.js.map +7 -0
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3DRenderer.js +2 -0
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3DRenderer.js.map +7 -0
- package/dist/Runtime/Extensions/3D/AmbientLight.js +2 -0
- package/dist/Runtime/Extensions/3D/AmbientLight.js.map +7 -0
- package/dist/Runtime/Extensions/3D/Cube3DRuntimeObject.js +2 -0
- package/dist/Runtime/Extensions/3D/Cube3DRuntimeObject.js.map +7 -0
- package/dist/Runtime/Extensions/3D/Cube3DRuntimeObjectPixiRenderer.js +2 -0
- package/dist/Runtime/Extensions/3D/Cube3DRuntimeObjectPixiRenderer.js.map +7 -0
- package/dist/Runtime/Extensions/3D/DirectionalLight.js +2 -0
- package/dist/Runtime/Extensions/3D/DirectionalLight.js.map +7 -0
- package/dist/Runtime/Extensions/3D/ExponentialFog.js +2 -0
- package/dist/Runtime/Extensions/3D/ExponentialFog.js.map +7 -0
- package/dist/Runtime/Extensions/3D/HemisphereLight.js +2 -0
- package/dist/Runtime/Extensions/3D/HemisphereLight.js.map +7 -0
- package/dist/Runtime/Extensions/3D/JsExtension.js +2809 -0
- package/dist/Runtime/Extensions/3D/LinearFog.js +2 -0
- package/dist/Runtime/Extensions/3D/LinearFog.js.map +7 -0
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject.js +2 -0
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject.js.map +7 -0
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject3DRenderer.js +2 -0
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject3DRenderer.js.map +7 -0
- package/dist/Runtime/Extensions/3D/Scene3DTools.js +2 -0
- package/dist/Runtime/Extensions/3D/Scene3DTools.js.map +7 -0
- package/dist/Runtime/Extensions/AdMob/JsExtension.js +798 -0
- package/dist/Runtime/Extensions/AdMob/admobtools.js +2 -0
- package/dist/Runtime/Extensions/AdMob/admobtools.js.map +7 -0
- package/dist/Runtime/Extensions/AdvancedWindow/JsExtension.js +719 -0
- package/dist/Runtime/Extensions/AdvancedWindow/electron-advancedwindowtools.js +2 -0
- package/dist/Runtime/Extensions/AdvancedWindow/electron-advancedwindowtools.js.map +7 -0
- package/dist/Runtime/Extensions/AnchorBehavior/anchorruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/AnchorBehavior/anchorruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/BBText/JsExtension.js +639 -0
- package/dist/Runtime/Extensions/BBText/bbtextruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/BBText/bbtextruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/BBText/bbtextruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/BBText/bbtextruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/BBText/pixi-multistyle-text/dist/pixi-multistyle-text.umd.js +1 -0
- package/dist/Runtime/Extensions/BitmapText/JsExtension.js +756 -0
- package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/DebuggerTools/JsExtension.js +123 -0
- package/dist/Runtime/Extensions/DebuggerTools/debuggertools.js +2 -0
- package/dist/Runtime/Extensions/DebuggerTools/debuggertools.js.map +7 -0
- package/dist/Runtime/Extensions/DestroyOutsideBehavior/destroyoutsideruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/DestroyOutsideBehavior/destroyoutsideruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/DeviceSensors/JsExtension.js +461 -0
- package/dist/Runtime/Extensions/DeviceSensors/devicesensortools.js +2 -0
- package/dist/Runtime/Extensions/DeviceSensors/devicesensortools.js.map +7 -0
- package/dist/Runtime/Extensions/DeviceVibration/JsExtension.js +108 -0
- package/dist/Runtime/Extensions/DeviceVibration/devicevibrationtools.js +2 -0
- package/dist/Runtime/Extensions/DeviceVibration/devicevibrationtools.js.map +7 -0
- package/dist/Runtime/Extensions/DialogueTree/JsExtension.js +730 -0
- package/dist/Runtime/Extensions/DialogueTree/bondage.js/dist/bondage.min.js +11 -0
- package/dist/Runtime/Extensions/DialogueTree/dialoguetools.js +3 -0
- package/dist/Runtime/Extensions/DialogueTree/dialoguetools.js.map +7 -0
- package/dist/Runtime/Extensions/DraggableBehavior/draggableruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/DraggableBehavior/draggableruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/JsExtension.js +1197 -0
- package/dist/Runtime/Extensions/Effects/adjustment-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/adjustment-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/advanced-bloom-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/advanced-bloom-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/ascii-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/ascii-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/bevel-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/bevel-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/black-and-white-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/black-and-white-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/blending-mode-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/blending-mode-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/blur-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/blur-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/brightness-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/brightness-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/bulge-pinch-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/bulge-pinch-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/color-map-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/color-map-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/color-replace-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/color-replace-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/crt-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/crt-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/displacement-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/displacement-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/dot-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/dot-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/drop-shadow-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/drop-shadow-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/glitch-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/glitch-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/glow-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/glow-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/godray-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/godray-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/kawase-blur-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/kawase-blur-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/light-night-pixi-filter.js +3 -0
- package/dist/Runtime/Extensions/Effects/light-night-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/night-pixi-filter.js +3 -0
- package/dist/Runtime/Extensions/Effects/night-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/noise-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/noise-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/old-film-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/old-film-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/outline-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/outline-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/pixelate-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/pixelate-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-adjustment.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-advanced-bloom.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-ascii.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-bevel.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-bulge-pinch.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-color-map.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-color-replace.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-crt.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-dot.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-drop-shadow.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-glitch.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-glow.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-godray.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-kawase-blur.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-old-film.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-outline.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-pixelate.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-radial-blur.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-reflection.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-rgb-split.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-tilt-shift.js +171 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-twist.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-zoom-blur.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/adjustment/types.d.ts +29 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/advanced-bloom/types.d.ts +30 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/ascii/types.d.ts +11 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/bevel/types.d.ts +25 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/bloom/types.d.ts +18 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/bulge-pinch/types.d.ts +24 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/color-map/types.d.ts +22 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/color-overlay/types.d.ts +11 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/color-replace/types.d.ts +17 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/convolution/types.d.ts +13 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/cross-hatch/types.d.ts +10 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/crt/types.d.ts +35 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/dot/types.d.ts +12 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/drop-shadow/types.d.ts +33 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/emboss/types.d.ts +11 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/glitch/types.d.ts +38 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/glow/types.d.ts +23 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/godray/types.d.ts +27 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/kawase-blur/types.d.ts +15 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/motion-blur/types.d.ts +17 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/multi-color-replace/types.d.ts +18 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/old-film/types.d.ts +33 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/outline/types.d.ts +13 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/pixelate/types.d.ts +11 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/radial-blur/types.d.ts +19 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/reflection/types.d.ts +25 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/rgb-split/types.d.ts +13 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/shockwave/types.d.ts +25 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/simple-lightmap/types.d.ts +13 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/tilt-shift/types.d.ts +19 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/twist/types.d.ts +13 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/zoom-blur/types.d.ts +28 -0
- package/dist/Runtime/Extensions/Effects/radial-blur-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/radial-blur-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/reflection-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/reflection-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/rgb-split-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/rgb-split-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/sepia-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/sepia-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/tilt-shift-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/tilt-shift-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/twist-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/twist-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/zoom-blur-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/zoom-blur-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/JsExtension.js +589 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyeffect.js +3 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyeffect.js.map +7 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummywithshareddataruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummywithshareddataruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/examplejsextensiontools.js +2 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/examplejsextensiontools.js.map +7 -0
- package/dist/Runtime/Extensions/FacebookInstantGames/FBInstant.d.ts +2 -0
- package/dist/Runtime/Extensions/FacebookInstantGames/JsExtension.js +379 -0
- package/dist/Runtime/Extensions/FacebookInstantGames/facebookinstantgamestools.js +2 -0
- package/dist/Runtime/Extensions/FacebookInstantGames/facebookinstantgamestools.js.map +7 -0
- package/dist/Runtime/Extensions/FileSystem/JsExtension.js +559 -0
- package/dist/Runtime/Extensions/FileSystem/filesystemtools.js +2 -0
- package/dist/Runtime/Extensions/FileSystem/filesystemtools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/A_firebase-base.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/A_firebase-base.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-analytics.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-analytics.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-auth.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-auth.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-database.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-database.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-firestore.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-firestore.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-functions.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-functions.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-messaging.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-messaging.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-performance.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-performance.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-remote-config.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-remote-config.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-storage.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-storage.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/firebase.d.ts +10191 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/C_firebasetools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/C_firebasetools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_analyticstools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_analyticstools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_authtools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_authtools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_cloudfirestoretools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_cloudfirestoretools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_databasetools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_databasetools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_functionstools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_functionstools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_performancetools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_performancetools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_remoteconfigtools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_remoteconfigtools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_storagetools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_storagetools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/JsExtension.js +2323 -0
- package/dist/Runtime/Extensions/Inventory/inventory.js +2 -0
- package/dist/Runtime/Extensions/Inventory/inventory.js.map +7 -0
- package/dist/Runtime/Extensions/Inventory/inventorytools.js +2 -0
- package/dist/Runtime/Extensions/Inventory/inventorytools.js.map +7 -0
- package/dist/Runtime/Extensions/JsExtensionTypes.flow.js +34 -0
- package/dist/Runtime/Extensions/Leaderboards/JsExtension.js +299 -0
- package/dist/Runtime/Extensions/Leaderboards/leaderboardstools.js +2 -0
- package/dist/Runtime/Extensions/Leaderboards/leaderboardstools.js.map +7 -0
- package/dist/Runtime/Extensions/Leaderboards/sha256.d.ts +234 -0
- package/dist/Runtime/Extensions/Leaderboards/sha256.js +21 -0
- package/dist/Runtime/Extensions/Lighting/JsExtension.js +371 -0
- package/dist/Runtime/Extensions/Lighting/lightobstacleruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/Lighting/lightobstacleruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/Lighting/lightruntimeobject-pixi-renderer.js +40 -0
- package/dist/Runtime/Extensions/Lighting/lightruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/Lighting/lightruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/Lighting/lightruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/LinkedObjects/linkedobjects.js +2 -0
- package/dist/Runtime/Extensions/LinkedObjects/linkedobjects.js.map +7 -0
- package/dist/Runtime/Extensions/P2P/A_peer.js +4 -0
- package/dist/Runtime/Extensions/P2P/A_peer.js.map +1 -0
- package/dist/Runtime/Extensions/P2P/B_p2ptools.js +2 -0
- package/dist/Runtime/Extensions/P2P/B_p2ptools.js.map +7 -0
- package/dist/Runtime/Extensions/P2P/JsExtension.js +483 -0
- package/dist/Runtime/Extensions/P2P/peerjs.d.ts +509 -0
- package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject.js +2 -0
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject.js.map +7 -0
- package/dist/Runtime/Extensions/ParticleSystem/pixi-particles-pixi-renderer.min.js +3 -0
- package/dist/Runtime/Extensions/PathfindingBehavior/PathTools.js +2 -0
- package/dist/Runtime/Extensions/PathfindingBehavior/PathTools.js.map +7 -0
- package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingobstacleruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingobstacleruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/Physics2Behavior/Box2D_v2.3.1_min.wasm.js +2 -0
- package/dist/Runtime/Extensions/Physics2Behavior/Box2D_v2.3.1_min.wasm.js.map +7 -0
- package/dist/Runtime/Extensions/Physics2Behavior/Box2D_v2.3.1_min.wasm.wasm +0 -0
- package/dist/Runtime/Extensions/Physics2Behavior/JsExtension.js +4072 -0
- package/dist/Runtime/Extensions/Physics2Behavior/box2d.d.ts +1804 -0
- package/dist/Runtime/Extensions/Physics2Behavior/physics2runtimebehavior.js +2 -0
- package/dist/Runtime/Extensions/Physics2Behavior/physics2runtimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/Physics2Behavior/physics2tools.js +2 -0
- package/dist/Runtime/Extensions/Physics2Behavior/physics2tools.js.map +7 -0
- package/dist/Runtime/Extensions/PhysicsBehavior/box2djs/box2d.js +804 -0
- package/dist/Runtime/Extensions/PhysicsBehavior/physicsruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/PhysicsBehavior/physicsruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/PlatformBehavior/benchmarks/platformerobjectruntimebehavior.benchmark.js +2 -0
- package/dist/Runtime/Extensions/PlatformBehavior/benchmarks/platformerobjectruntimebehavior.benchmark.js.map +7 -0
- package/dist/Runtime/Extensions/PlatformBehavior/platformerobjectruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/PlatformBehavior/platformerobjectruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/PlatformBehavior/platformruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/PlatformBehavior/platformruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/PlatformBehavior/platformtools.js +2 -0
- package/dist/Runtime/Extensions/PlatformBehavior/platformtools.js.map +7 -0
- package/dist/Runtime/Extensions/PlayerAuthentication/JsExtension.js +218 -0
- package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationcomponents.js +5 -0
- package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationcomponents.js.map +7 -0
- package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationtools.js +2 -0
- package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationtools.js.map +7 -0
- package/dist/Runtime/Extensions/PrimitiveDrawing/pixi-graphics-extras/graphics-extras.min.js +10 -0
- package/dist/Runtime/Extensions/PrimitiveDrawing/pixi-graphics-extras/graphics-extras.min.js.map +1 -0
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/Screenshot/JsExtension.js +68 -0
- package/dist/Runtime/Extensions/Screenshot/screenshottools.js +2 -0
- package/dist/Runtime/Extensions/Screenshot/screenshottools.js.map +7 -0
- package/dist/Runtime/Extensions/Shopify/shopify-buy.umd.polyfilled.min.js +2 -0
- package/dist/Runtime/Extensions/Shopify/shopifytools.js +2 -0
- package/dist/Runtime/Extensions/Shopify/shopifytools.js.map +7 -0
- package/dist/Runtime/Extensions/SpatialSound/JsExtension.js +92 -0
- package/dist/Runtime/Extensions/SpatialSound/howler.spatial.min.js +2 -0
- package/dist/Runtime/Extensions/SpatialSound/spatialsoundtools.js +2 -0
- package/dist/Runtime/Extensions/SpatialSound/spatialsoundtools.js.map +7 -0
- package/dist/Runtime/Extensions/SystemInfo/systeminfotools.js +2 -0
- package/dist/Runtime/Extensions/SystemInfo/systeminfotools.js.map +7 -0
- package/dist/Runtime/Extensions/TextEntryObject/textentryruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/TextEntryObject/textentryruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/TextEntryObject/textentryruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/TextEntryObject/textentryruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/TextInput/JsExtension.js +790 -0
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/TextObject/textruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/TextObject/textruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/TextObject/textruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/TextObject/textruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/JsExtension.js +1653 -0
- package/dist/Runtime/Extensions/TileMap/TileMapRuntimeManager.js +2 -0
- package/dist/Runtime/Extensions/TileMap/TileMapRuntimeManager.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/collision/TileMapCollisionMaskRenderer.js +2 -0
- package/dist/Runtime/Extensions/TileMap/collision/TileMapCollisionMaskRenderer.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/collision/TransformedTileMap.js +2 -0
- package/dist/Runtime/Extensions/TileMap/collision/TransformedTileMap.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/example/anotherIsland.json +5769 -0
- package/dist/Runtime/Extensions/TileMap/example/island.json +5823 -0
- package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.d.ts +25 -0
- package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.js +2 -0
- package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/index.d.ts +16 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/index.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/TileMapFileContent.d.ts +12 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/TileMapFileContent.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/TileMapLoader.d.ts +18 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/TileMapLoader.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkFormat.d.ts +589 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkFormat.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkTileMapLoader.d.ts +16 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkTileMapLoader.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkTileMapLoaderHelper.d.ts +5 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkTileMapLoaderHelper.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledFormat.d.ts +343 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledFormat.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoader.d.ts +16 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoader.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoader.spec.d.ts +2 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoader.spec.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoaderHelper.d.ts +37 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoaderHelper.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/CommonTypes.d.ts +5 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/CommonTypes.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/GID.d.ts +45 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/GID.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/TileMapModel.d.ts +361 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/TileMapModel.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/ResourceCache.d.ts +27 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/ResourceCache.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts +70 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts +56 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileTextureCache.d.ts +24 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileTextureCache.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/ldtk/LDtkPixiHelper.d.ts +26 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/ldtk/LDtkPixiHelper.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/tiled/TiledPixiHelper.d.ts +21 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/tiled/TiledPixiHelper.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/types/index.d.ts +12 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/types/index.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/pako/dist/pako.d.ts +166 -0
- package/dist/Runtime/Extensions/TileMap/pako/dist/pako.min.js +2 -0
- package/dist/Runtime/Extensions/TileMap/pixi-tilemap/dist/global-pixi-tilemap.d.ts +23 -0
- package/dist/Runtime/Extensions/TileMap/pixi-tilemap/dist/pixi-tilemap.d.ts +270 -0
- package/dist/Runtime/Extensions/TileMap/pixi-tilemap/dist/pixi-tilemap.umd.js +74 -0
- package/dist/Runtime/Extensions/TileMap/pixi-tilemap/dist/pixi-tilemap.umd.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/tilemapcollisionmaskruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/TileMap/tilemapcollisionmaskruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/TopDownMovementBehavior/topdownmovementruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/TopDownMovementBehavior/topdownmovementruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/TweenBehavior/JsExtension.js +1087 -0
- package/dist/Runtime/Extensions/TweenBehavior/shifty.d.ts +839 -0
- package/dist/Runtime/Extensions/TweenBehavior/shifty.js +5 -0
- package/dist/Runtime/Extensions/TweenBehavior/shifty.js.map +1 -0
- package/dist/Runtime/Extensions/TweenBehavior/shifty_setup.js +2 -0
- package/dist/Runtime/Extensions/TweenBehavior/shifty_setup.js.map +7 -0
- package/dist/Runtime/Extensions/TweenBehavior/tweenruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/TweenBehavior/tweenruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/TweenBehavior/tweentools.js +2 -0
- package/dist/Runtime/Extensions/TweenBehavior/tweentools.js.map +7 -0
- package/dist/Runtime/Extensions/Video/JsExtension.js +694 -0
- package/dist/Runtime/Extensions/Video/videoruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/Video/videoruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/Video/videoruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/Video/videoruntimeobject.js.map +7 -0
- package/dist/Runtime/FacebookInstantGames/fbapp-config.json +17 -0
- package/dist/Runtime/FacebookInstantGames/index.html +68 -0
- package/dist/Runtime/Model3DManager.js +2 -0
- package/dist/Runtime/Model3DManager.js.map +7 -0
- package/dist/Runtime/RuntimeCustomObjectLayer.js +2 -0
- package/dist/Runtime/RuntimeCustomObjectLayer.js.map +7 -0
- package/dist/Runtime/RuntimeInstanceContainer.js +2 -0
- package/dist/Runtime/RuntimeInstanceContainer.js.map +7 -0
- package/dist/Runtime/RuntimeLayer.js +2 -0
- package/dist/Runtime/RuntimeLayer.js.map +7 -0
- package/dist/Runtime/affinetransformation.js +2 -0
- package/dist/Runtime/affinetransformation.js.map +7 -0
- package/dist/Runtime/debugger-client/abstract-debugger-client.js +2 -0
- package/dist/Runtime/debugger-client/abstract-debugger-client.js.map +7 -0
- package/dist/Runtime/debugger-client/hot-reloader.js +2 -0
- package/dist/Runtime/debugger-client/hot-reloader.js.map +7 -0
- package/dist/Runtime/debugger-client/websocket-debugger-client.js +2 -0
- package/dist/Runtime/debugger-client/websocket-debugger-client.js.map +7 -0
- package/dist/Runtime/debugger-client/window-message-debugger-client.js +2 -0
- package/dist/Runtime/debugger-client/window-message-debugger-client.js.map +7 -0
- package/dist/Runtime/events-tools/cameratools.js +2 -0
- package/dist/Runtime/events-tools/cameratools.js.map +7 -0
- package/dist/Runtime/events-tools/commontools.js +2 -0
- package/dist/Runtime/events-tools/commontools.js.map +7 -0
- package/dist/Runtime/events-tools/inputtools.js +2 -0
- package/dist/Runtime/events-tools/inputtools.js.map +7 -0
- package/dist/Runtime/events-tools/networktools.js +2 -0
- package/dist/Runtime/events-tools/networktools.js.map +7 -0
- package/dist/Runtime/events-tools/objecttools.js +2 -0
- package/dist/Runtime/events-tools/objecttools.js.map +7 -0
- package/dist/Runtime/events-tools/runtimescenetools.js +2 -0
- package/dist/Runtime/events-tools/runtimescenetools.js.map +7 -0
- package/dist/Runtime/events-tools/soundtools.js +2 -0
- package/dist/Runtime/events-tools/soundtools.js.map +7 -0
- package/dist/Runtime/events-tools/storagetools.js +2 -0
- package/dist/Runtime/events-tools/storagetools.js.map +7 -0
- package/dist/Runtime/events-tools/stringtools.js +3 -0
- package/dist/Runtime/events-tools/stringtools.js.map +7 -0
- package/dist/Runtime/events-tools/variabletools.js +2 -0
- package/dist/Runtime/events-tools/variabletools.js.map +7 -0
- package/dist/Runtime/events-tools/windowtools.js +2 -0
- package/dist/Runtime/events-tools/windowtools.js.map +7 -0
- package/dist/Runtime/fontfaceobserver-font-manager/fontfaceobserver-font-manager.js +2 -0
- package/dist/Runtime/fontfaceobserver-font-manager/fontfaceobserver-font-manager.js.map +7 -0
- package/dist/Runtime/fontfaceobserver-font-manager/fontfaceobserver.js +16 -0
- package/dist/Runtime/force.js +2 -0
- package/dist/Runtime/force.js.map +7 -0
- package/dist/Runtime/gd.js +2 -0
- package/dist/Runtime/gd.js.map +7 -0
- package/dist/Runtime/howler-sound-manager/howler-sound-manager.js +2 -0
- package/dist/Runtime/howler-sound-manager/howler-sound-manager.js.map +7 -0
- package/dist/Runtime/howler-sound-manager/howler.min.js +3 -0
- package/dist/Runtime/index.html +55 -0
- package/dist/Runtime/inputmanager.js +2 -0
- package/dist/Runtime/inputmanager.js.map +7 -0
- package/dist/Runtime/jsonmanager.js +2 -0
- package/dist/Runtime/jsonmanager.js.map +7 -0
- package/dist/Runtime/layer.js +2 -0
- package/dist/Runtime/layer.js.map +7 -0
- package/dist/Runtime/libs/CocoonJS/cocoon.min.js +4 -0
- package/dist/Runtime/libs/jshashtable.js +2 -0
- package/dist/Runtime/libs/jshashtable.js.map +7 -0
- package/dist/Runtime/libs/rbush.js +624 -0
- package/dist/Runtime/logger.js +2 -0
- package/dist/Runtime/logger.js.map +7 -0
- package/dist/Runtime/oncetriggers.js +2 -0
- package/dist/Runtime/oncetriggers.js.map +7 -0
- package/dist/Runtime/pixi-renderers/CustomObjectPixiRenderer.js +2 -0
- package/dist/Runtime/pixi-renderers/CustomObjectPixiRenderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/DebuggerPixiRenderer.js +2 -0
- package/dist/Runtime/pixi-renderers/DebuggerPixiRenderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/RuntimeInstanceContainerPixiRenderer.js +1 -0
- package/dist/Runtime/pixi-renderers/RuntimeInstanceContainerPixiRenderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/ThreeAddons.js +2 -0
- package/dist/Runtime/pixi-renderers/draco/gltf/draco_decoder.wasm +0 -0
- package/dist/Runtime/pixi-renderers/draco/gltf/draco_wasm_wrapper.js +116 -0
- package/dist/Runtime/pixi-renderers/layer-pixi-renderer.js +15 -0
- package/dist/Runtime/pixi-renderers/layer-pixi-renderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/loadingscreen-pixi-renderer.js +2 -0
- package/dist/Runtime/pixi-renderers/loadingscreen-pixi-renderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/pixi-bitmapfont-manager.js +2 -0
- package/dist/Runtime/pixi-renderers/pixi-bitmapfont-manager.js.map +7 -0
- package/dist/Runtime/pixi-renderers/pixi-effects-manager.js +2 -0
- package/dist/Runtime/pixi-renderers/pixi-effects-manager.js.map +7 -0
- package/dist/Runtime/pixi-renderers/pixi-filters-tools.js +2 -0
- package/dist/Runtime/pixi-renderers/pixi-filters-tools.js.map +7 -0
- package/dist/Runtime/pixi-renderers/pixi-image-manager.js +2 -0
- package/dist/Runtime/pixi-renderers/pixi-image-manager.js.map +7 -0
- package/dist/Runtime/pixi-renderers/pixi.js +11 -0
- package/dist/Runtime/pixi-renderers/runtimegame-pixi-renderer.js +2 -0
- package/dist/Runtime/pixi-renderers/runtimegame-pixi-renderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/runtimescene-pixi-renderer.js +3 -0
- package/dist/Runtime/pixi-renderers/runtimescene-pixi-renderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/spriteruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/pixi-renderers/spriteruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/three.js +7 -0
- package/dist/Runtime/polygon.js +2 -0
- package/dist/Runtime/polygon.js.map +7 -0
- package/dist/Runtime/profiler.js +2 -0
- package/dist/Runtime/profiler.js.map +7 -0
- package/dist/Runtime/runtimebehavior.js +2 -0
- package/dist/Runtime/runtimebehavior.js.map +7 -0
- package/dist/Runtime/runtimegame.js +2 -0
- package/dist/Runtime/runtimegame.js.map +7 -0
- package/dist/Runtime/runtimeobject.js +2 -0
- package/dist/Runtime/runtimeobject.js.map +7 -0
- package/dist/Runtime/runtimescene.js +2 -0
- package/dist/Runtime/runtimescene.js.map +7 -0
- package/dist/Runtime/runtimewatermark.js +100 -0
- package/dist/Runtime/runtimewatermark.js.map +7 -0
- package/dist/Runtime/scenestack.js +2 -0
- package/dist/Runtime/scenestack.js.map +7 -0
- package/dist/Runtime/splash/gd-logo-dark-colored.js +2 -0
- package/dist/Runtime/splash/gd-logo-dark-colored.js.map +7 -0
- package/dist/Runtime/splash/gd-logo-dark.js +2 -0
- package/dist/Runtime/splash/gd-logo-dark.js.map +7 -0
- package/dist/Runtime/splash/gd-logo-light-colored.js +2 -0
- package/dist/Runtime/splash/gd-logo-light-colored.js.map +7 -0
- package/dist/Runtime/splash/gd-logo-light.js +2 -0
- package/dist/Runtime/splash/gd-logo-light.js.map +7 -0
- package/dist/Runtime/spriteruntimeobject.js +2 -0
- package/dist/Runtime/spriteruntimeobject.js.map +7 -0
- package/dist/Runtime/timemanager.js +2 -0
- package/dist/Runtime/timemanager.js.map +7 -0
- package/dist/Runtime/timer.js +2 -0
- package/dist/Runtime/timer.js.map +7 -0
- package/dist/Runtime/types/global-pixi.d.ts +22 -0
- package/dist/Runtime/types/global-three-addons.d.ts +9 -0
- package/dist/Runtime/types/global-three.d.ts +3 -0
- package/dist/Runtime/types/global-types.d.ts +61 -0
- package/dist/Runtime/types/howler.d.ts +313 -0
- package/dist/Runtime/types/project-data.d.ts +276 -0
- package/dist/Runtime/variable.js +2 -0
- package/dist/Runtime/variable.js.map +7 -0
- package/dist/Runtime/variablescontainer.js +2 -0
- package/dist/Runtime/variablescontainer.js.map +7 -0
- package/dist/lib/libGD.cjs +22 -0
- package/dist/lib/libGD.wasm +0 -0
- package/dist/loaders.js +1 -0
- package/package.json +24 -10
- package/src/downloadGD.js +0 -70
- package/src/index.js +21 -14
- package/examples/create-objects-from-json/assets/Blank button.png +0 -0
- package/examples/create-objects-from-json/game.json +0 -258
- package/examples/create-objects-from-json/index.js +0 -50
- package/examples/create-objects-from-json/mylist.json +0 -7
- package/examples/export-game/game.json +0 -205
- package/examples/export-game/index.js +0 -13
- package/src/CaseSensitiveSlug.js +0 -34
- package/src/EventsFunctionsExtensionsLoader/LocalEventsFunctionCodeWriter.js +0 -56
- package/src/EventsFunctionsExtensionsLoader/MetadataDeclarationHelpers.js +0 -489
- package/src/EventsFunctionsExtensionsLoader/index.js +0 -451
- package/src/JsExtensionsLoader/LocalJsExtensionsFinder.js +0 -42
- package/src/JsExtensionsLoader/LocalJsExtensionsLoader.js +0 -57
- package/src/JsExtensionsLoader/index.js +0 -101
- package/src/LocalFileSystem.js +0 -158
- package/src/LocalProjectOpener.js +0 -46
- package/src/LocalProjectWriter.js +0 -96
- package/src/MapFor.js +0 -46
- package/src/ObjectSplitter.js +0 -187
- package/src/Serializer.js +0 -35
- package/src/build.js +0 -51
- package/src/runtime-files-list.js +0 -143
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var gdjs;(A=>{const C=()=>({collision:!1,move_axis:[0,0]}),D=()=>({collision:!1,closeX:0,closeY:0,closeSqDist:0,farX:0,farY:0,farSqDist:0}),F={minMaxA:[0,0],minMaxB:[0,0],edge:[0,0],axis:[0,0],move_axis:[0,0],result:C()},R={p:[0,0],q:[0,0],r:[0,0],s:[0,0],deltaQP:[0,0],axis:[0,0],result:D()};class n{vertices=[];edges=[];center=[0,0];move(t,e){for(let i=0,o=this.vertices.length;i<o;++i)this.vertices[i][0]+=t,this.vertices[i][1]+=e}rotate(t){let e=0;const i=Math.cos(-t),o=Math.sin(-t);for(let l=0,s=this.vertices.length;l<s;++l)e=this.vertices[l][0],this.vertices[l][0]=e*i+this.vertices[l][1]*o,this.vertices[l][1]=-e*o+this.vertices[l][1]*i}computeEdges(){for(;this.edges.length<this.vertices.length;)this.edges.push([0,0]);this.edges.length!=this.vertices.length&&(this.edges.length=this.vertices.length);for(let t=0,e=this.vertices.length;t<e;++t){const i=this.vertices[t],o=t+1>=e?this.vertices[0]:this.vertices[t+1];this.edges[t][0]=o[0]-i[0],this.edges[t][1]=o[1]-i[1]}}isConvex(){this.computeEdges();const t=this.edges.length;if(t<3)return!1;const e=this.edges[0][0]*this.edges[0+1][1]-this.edges[0][1]*this.edges[0+1][0]>0;for(let o=1;o<t-1;++o)if(this.edges[o][0]*this.edges[o+1][1]-this.edges[o][1]*this.edges[o+1][0]>0!==e)return!1;return this.edges[t-1][0]*this.edges[0][1]-this.edges[t-1][1]*this.edges[0][0]>0===e}computeCenter(){this.center[0]=0,this.center[1]=0;const t=this.vertices.length;for(let e=0;e<t;++e)this.center[0]+=this.vertices[e][0],this.center[1]+=this.vertices[e][1];return this.center[0]/=t,this.center[1]/=t,this.center}static createRectangle(t,e){const i=new A.Polygon;return i.vertices.push([-t/2,-e/2]),i.vertices.push([+t/2,-e/2]),i.vertices.push([+t/2,+e/2]),i.vertices.push([-t/2,+e/2]),i}static collisionTest(t,e,i){t.computeEdges(),e.computeEdges();let o=F.edge;const l=F.move_axis,s=F.result;let a=Number.MAX_VALUE;o[0]=0,o[1]=0,o[0]=0,o[1]=0,s.collision=!1,s.move_axis[0]=0,s.move_axis[1]=0;for(let x=0,v=t.vertices.length,g=e.vertices.length;x<v+g;x++){x<v?o=t.edges[x]:o=e.edges[x-v];const f=F.axis;f[0]=-o[1],f[1]=o[0],n.normalise(f);const P=F.minMaxA,M=F.minMaxB;n.project(f,t,P),n.project(f,e,M);const r=n.distance(P[0],P[1],M[0],M[1]);if(r>0||r===0&&i)return s.collision=!1,s.move_axis[0]=0,s.move_axis[1]=0,s;const d=Math.abs(r);d<a&&(a=d,l[0]=f[0],l[1]=f[1])}s.collision=!0;const h=t.computeCenter(),c=e.computeCenter(),m=[h[0]-c[0],h[1]-c[1]];return n.dotProduct(m,l)<0&&(l[0]=-l[0],l[1]=-l[1]),s.move_axis[0]=l[0]*a,s.move_axis[1]=l[1]*a,s}static raycastTest(t,e,i,o,l){const s=R.result;if(s.collision=!1,t.vertices.length<2)return s;t.computeEdges();const a=R.p,h=R.q,c=R.r,m=R.s;let x=Number.MAX_VALUE;a[0]=e,a[1]=i,c[0]=o-e,c[1]=l-i;for(let v=0;v<t.edges.length;v++){h[0]=t.vertices[v][0],h[1]=t.vertices[v][1],m[0]=t.edges[v][0],m[1]=t.edges[v][1];const g=R.deltaQP;g[0]=h[0]-a[0],g[1]=h[1]-a[1];const f=n.crossProduct(c,m),P=n.crossProduct(g,m)/f,M=n.crossProduct(g,c)/f;if(Math.abs(f)<=1e-4&&Math.abs(n.crossProduct(g,c))<=1e-4){const r=R.axis;r[0]=c[0],r[1]=c[1],n.normalise(r);const d=0,u=n.dotProduct(r,c),S=n.dotProduct(r,g),p=n.dotProduct(r,[g[0]+m[0],g[1]+m[1]]),b=Math.max(Math.min(d,u),Math.min(S,p)),j=Math.min(Math.max(d,u),Math.max(S,p));if(b>j)return s;s.collision=!0,u===0&&(s.closeX=e,s.closeY=i,s.closeSqDist=0,s.farX=e,s.farY=i,s.farSqDist=0);const q=b/Math.abs(u),T=j/Math.abs(u);return s.closeX=e+q*c[0],s.closeY=i+q*c[1],s.closeSqDist=q*q*(c[0]*c[0]+c[1]*c[1]),s.farX=e+T*c[0],s.farY=i+T*c[1],s.farSqDist=T*T*(c[0]*c[0]+c[1]*c[1]),s}else if(f!==0&&0<=P&&P<=1&&0<=M&&M<=1){const r=a[0]+P*c[0],d=a[1]+P*c[1],u=(r-e)*(r-e)+(d-i)*(d-i);u<x?(s.collision||(s.farX=r,s.farY=d,s.farSqDist=u),x=u,s.closeX=r,s.closeY=d,s.closeSqDist=u,s.collision=!0):(s.farX=r,s.farY=d,s.farSqDist=u)}}return s}static normalise(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);e!=0&&(t[0]/=e,t[1]/=e)}static dotProduct(t,e){return t[0]*e[0]+t[1]*e[1]}static crossProduct(t,e){return t[0]*e[1]-t[1]*e[0]}static project(t,e,i){let o=n.dotProduct(t,e.vertices[0]);i[0]=o,i[1]=o;for(let l=1,s=e.vertices.length;l<s;++l)o=n.dotProduct(t,e.vertices[l]),o<i[0]?i[0]=o:o>i[1]&&(i[1]=o)}static distance(t,e,i,o){return t<i?i-e:t-o}static isPointInside(t,e,i){let o=!1;for(let l=0,s=t.vertices.length-1;l<t.vertices.length;s=l++){let a=t.vertices[l],h=t.vertices[s];a[1]>i!=h[1]>i&&e<(h[0]-a[0])*(i-a[1])/(h[1]-a[1])+a[0]&&(o=!o)}return o}static copyCollisionTestResult(t,e){e.collision=t.collision,e.move_axis[0]=t.move_axis[0],e.move_axis[1]=t.move_axis[1]}static makeNewCollisionTestResult=C;static copyRaycastTestResult(t,e){e.collision=t.collision,e.closeX=t.closeX,e.closeY=t.closeY,e.closeSqDist=t.closeSqDist,e.farX=t.farX,e.farY=t.farY,e.farSqDist=t.farSqDist}static makeNewRaycastTestResult=D}A.Polygon=n})(gdjs||={});
|
|
2
|
+
//# sourceMappingURL=polygon.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../GDevelop/GDJS/Runtime/polygon.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * GDevelop JS Platform\n * Copyright 2013-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.\n * This project is released under the MIT License.\n */\nnamespace gdjs {\n export type CollisionTestResult = {\n collision: boolean;\n move_axis: FloatPoint;\n };\n\n export type RaycastTestResult = {\n collision: boolean;\n closeX: float;\n closeY: float;\n closeSqDist: float;\n farX: float;\n farY: float;\n farSqDist: float;\n };\n\n /** Build a new object to store collision test results. */\n const makeNewCollisionTestResult = (): CollisionTestResult => {\n return { collision: false, move_axis: [0, 0] };\n };\n\n /** Build a new object to store raycast test results. */\n const makeNewRaycastTestResult = (): RaycastTestResult => {\n return {\n collision: false,\n closeX: 0,\n closeY: 0,\n closeSqDist: 0,\n farX: 0,\n farY: 0,\n farSqDist: 0,\n };\n };\n\n /**\n * Arrays and data structure that are (re)used by Polygon.collisionTest to\n * avoid any allocation.\n */\n const collisionTestStatics: {\n minMaxA: FloatPoint;\n minMaxB: FloatPoint;\n edge: FloatPoint;\n axis: FloatPoint;\n move_axis: FloatPoint;\n result: CollisionTestResult;\n } = {\n minMaxA: [0, 0],\n minMaxB: [0, 0],\n edge: [0, 0],\n axis: [0, 0],\n move_axis: [0, 0],\n result: makeNewCollisionTestResult(),\n };\n\n /**\n * Arrays and data structure that are (re)used by Polygon.raycastTest to\n * avoid any allocation.\n */\n const raycastTestStatics: {\n p: FloatPoint;\n q: FloatPoint;\n r: FloatPoint;\n s: FloatPoint;\n deltaQP: FloatPoint;\n axis: FloatPoint;\n result: RaycastTestResult;\n } = {\n p: [0, 0],\n q: [0, 0],\n r: [0, 0],\n s: [0, 0],\n deltaQP: [0, 0],\n axis: [0, 0],\n result: makeNewRaycastTestResult(),\n };\n\n /**\n * Polygon represents a polygon which can be used to create collisions masks for RuntimeObject.\n */\n export class Polygon {\n /**\n * The vertices of the polygon\n */\n vertices: Array<FloatPoint> = [];\n\n /**\n * The edges of the polygon. This property is only valid after calling\n * computeEdges, and remains valid until vertices are modified.\n */\n edges: Array<FloatPoint> = [];\n\n /**\n * The center of the polygon. This property is only valid after calling\n * computeCenter, and remains valid until vertices are modified.\n */\n center: FloatPoint = [0, 0];\n\n move(x: float, y: float): void {\n for (let i = 0, len = this.vertices.length; i < len; ++i) {\n this.vertices[i][0] += x;\n this.vertices[i][1] += y;\n }\n }\n\n rotate(angle: float): void {\n let t: float = 0;\n\n //We want a clockwise rotation\n const cosa = Math.cos(-angle);\n const sina = Math.sin(-angle);\n for (let i = 0, len = this.vertices.length; i < len; ++i) {\n t = this.vertices[i][0];\n this.vertices[i][0] = t * cosa + this.vertices[i][1] * sina;\n this.vertices[i][1] = -t * sina + this.vertices[i][1] * cosa;\n }\n }\n\n computeEdges(): void {\n //Ensure edge array has the right size (and avoid recreating an edge array).\n while (this.edges.length < this.vertices.length) {\n this.edges.push([0, 0]);\n }\n if (this.edges.length != this.vertices.length) {\n this.edges.length = this.vertices.length;\n }\n for (let i = 0, len = this.vertices.length; i < len; ++i) {\n const v1 = this.vertices[i];\n const v2 = i + 1 >= len ? this.vertices[0] : this.vertices[i + 1];\n this.edges[i][0] = v2[0] - v1[0];\n this.edges[i][1] = v2[1] - v1[1];\n }\n }\n\n isConvex(): boolean {\n this.computeEdges();\n const edgesLen = this.edges.length;\n if (edgesLen < 3) {\n return false;\n }\n const zProductIsPositive =\n this.edges[0][0] * this.edges[0 + 1][1] -\n this.edges[0][1] * this.edges[0 + 1][0] >\n 0;\n for (let i = 1; i < edgesLen - 1; ++i) {\n const zCrossProduct =\n this.edges[i][0] * this.edges[i + 1][1] -\n this.edges[i][1] * this.edges[i + 1][0];\n if (zCrossProduct > 0 !== zProductIsPositive) {\n return false;\n }\n }\n const lastZCrossProduct =\n this.edges[edgesLen - 1][0] * this.edges[0][1] -\n this.edges[edgesLen - 1][1] * this.edges[0][0];\n if (lastZCrossProduct > 0 !== zProductIsPositive) {\n return false;\n }\n return true;\n }\n\n computeCenter(): FloatPoint {\n this.center[0] = 0;\n this.center[1] = 0;\n const len = this.vertices.length;\n for (let i = 0; i < len; ++i) {\n this.center[0] += this.vertices[i][0];\n this.center[1] += this.vertices[i][1];\n }\n this.center[0] /= len;\n this.center[1] /= len;\n return this.center;\n }\n\n static createRectangle(width: float, height: float): gdjs.Polygon {\n const rect = new gdjs.Polygon();\n rect.vertices.push([-width / 2.0, -height / 2.0]);\n rect.vertices.push([+width / 2.0, -height / 2.0]);\n rect.vertices.push([+width / 2.0, +height / 2.0]);\n rect.vertices.push([-width / 2.0, +height / 2.0]);\n return rect;\n }\n\n /**\n * Do a collision test between two polygons.\n * Please note that polygons must *convexes*!\n *\n * You can read the result but do not keep a reference to it as it's a static object\n * reused between function calls. If you need to keep the results, use `copyCollisionTestResult`.\n *\n * Uses <a href=\"http://en.wikipedia.org/wiki/Hyperplane_separation_theorem\">Separating Axis Theorem </a>.<br>\n * Based on <a href=\"http://www.codeproject.com/Articles/15573/2D-Polygon-Collision-Detection\">this</a>\n * and <a href=\"http://stackoverflow.com/questions/5742329/problem-with-collision-response-sat\">this</a> article.\n *\n * @return A collision result. `collision` property is equal to true if polygons are overlapping. Do NOT keep a reference to this.\n * @param p1 The first polygon\n * @param p2 The second polygon\n * @param ignoreTouchingEdges If true, then edges that are touching each other, without the polygons actually overlapping, won't be considered in collision.\n */\n static collisionTest(\n p1: gdjs.Polygon,\n p2: gdjs.Polygon,\n ignoreTouchingEdges: boolean\n ): CollisionTestResult {\n //Algorithm core :\n p1.computeEdges();\n p2.computeEdges();\n let edge = collisionTestStatics.edge;\n const move_axis = collisionTestStatics.move_axis;\n const result = collisionTestStatics.result;\n let minDist = Number.MAX_VALUE;\n edge[0] = 0;\n edge[1] = 0;\n edge[0] = 0;\n edge[1] = 0;\n result.collision = false;\n result.move_axis[0] = 0;\n result.move_axis[1] = 0;\n\n //Iterate over all the edges composing the polygons\n for (\n let i = 0, len1 = p1.vertices.length, len2 = p2.vertices.length;\n i < len1 + len2;\n i++\n ) {\n if (i < len1) {\n // or <=\n edge = p1.edges[i];\n } else {\n edge = p2.edges[i - len1];\n }\n const axis = collisionTestStatics.axis;\n\n //Get the axis to which polygons will be projected\n axis[0] = -edge[1];\n axis[1] = edge[0];\n Polygon.normalise(axis);\n const minMaxA = collisionTestStatics.minMaxA;\n const minMaxB = collisionTestStatics.minMaxB;\n Polygon.project(\n axis,\n p1,\n //Do projection on the axis.\n minMaxA\n );\n Polygon.project(axis, p2, minMaxB);\n\n //If the projections on the axis do not overlap, then their is no collision\n const dist = Polygon.distance(\n minMaxA[0],\n minMaxA[1],\n minMaxB[0],\n minMaxB[1]\n );\n if (dist > 0 || (dist === 0 && ignoreTouchingEdges)) {\n result.collision = false;\n result.move_axis[0] = 0;\n result.move_axis[1] = 0;\n return result;\n }\n const absDist = Math.abs(dist);\n if (absDist < minDist) {\n minDist = absDist;\n move_axis[0] = axis[0];\n move_axis[1] = axis[1];\n }\n }\n result.collision = true;\n\n //Ensure move axis is correctly oriented.\n const p1Center = p1.computeCenter();\n const p2Center = p2.computeCenter();\n const d: FloatPoint = [\n p1Center[0] - p2Center[0],\n p1Center[1] - p2Center[1],\n ];\n if (Polygon.dotProduct(d, move_axis) < 0) {\n move_axis[0] = -move_axis[0];\n move_axis[1] = -move_axis[1];\n }\n\n //Add the magnitude to the move axis.\n result.move_axis[0] = move_axis[0] * minDist;\n result.move_axis[1] = move_axis[1] * minDist;\n return result;\n }\n\n /**\n * Do a raycast test.\n * Please note that the polygon must be **convex**!\n *\n * You can read the result but do not keep a reference to it as it's a static object\n * reused between function calls. If you need to keep the results, use `copyRaycastTestResult`.\n *\n * For some theory, check <a href=\"https://www.codeproject.com/Tips/862988/Find-the-Intersection-Point-of-Two-Line-Segments\">Find the Intersection Point of Two Line Segments</a>.\n *\n * @param poly The polygon to test\n * @param startX The raycast start point X\n * @param startY The raycast start point Y\n * @param endX The raycast end point X\n * @param endY The raycast end point Y\n * @return A raycast result with the contact points and distances. Do NOT keep a reference to this.\n */\n static raycastTest(\n poly: gdjs.Polygon,\n startX: float,\n startY: float,\n endX: float,\n endY: float\n ): RaycastTestResult {\n const result = raycastTestStatics.result;\n result.collision = false;\n if (poly.vertices.length < 2) {\n return result;\n }\n poly.computeEdges();\n const p = raycastTestStatics.p;\n const q = raycastTestStatics.q;\n const r = raycastTestStatics.r;\n const s = raycastTestStatics.s;\n let minSqDist = Number.MAX_VALUE;\n\n // Ray segment: p + t*r, with p = start and r = end - start\n p[0] = startX;\n p[1] = startY;\n r[0] = endX - startX;\n r[1] = endY - startY;\n for (let i = 0; i < poly.edges.length; i++) {\n // Edge segment: q + u*s\n q[0] = poly.vertices[i][0];\n q[1] = poly.vertices[i][1];\n s[0] = poly.edges[i][0];\n s[1] = poly.edges[i][1];\n const deltaQP = raycastTestStatics.deltaQP;\n deltaQP[0] = q[0] - p[0];\n deltaQP[1] = q[1] - p[1];\n const crossRS = Polygon.crossProduct(r, s);\n const t = Polygon.crossProduct(deltaQP, s) / crossRS;\n const u = Polygon.crossProduct(deltaQP, r) / crossRS;\n\n // Collinear\n // One point intersection\n if (\n Math.abs(crossRS) <= 0.0001 &&\n Math.abs(Polygon.crossProduct(deltaQP, r)) <= 0.0001\n ) {\n // Project the ray and the edge to work on floats, keeping linearity through t\n const axis = raycastTestStatics.axis;\n axis[0] = r[0];\n axis[1] = r[1];\n Polygon.normalise(axis);\n const rayA = 0;\n const rayB = Polygon.dotProduct(axis, r);\n const edgeA = Polygon.dotProduct(axis, deltaQP);\n const edgeB = Polygon.dotProduct(axis, [\n deltaQP[0] + s[0],\n deltaQP[1] + s[1],\n ]);\n\n // Get overlapping range\n const minOverlap = Math.max(\n Math.min(rayA, rayB),\n Math.min(edgeA, edgeB)\n );\n const maxOverlap = Math.min(\n Math.max(rayA, rayB),\n Math.max(edgeA, edgeB)\n );\n if (minOverlap > maxOverlap) {\n return result;\n }\n result.collision = true;\n\n // Zero distance ray\n if (rayB === 0) {\n result.closeX = startX;\n result.closeY = startY;\n result.closeSqDist = 0;\n result.farX = startX;\n result.farY = startY;\n result.farSqDist = 0;\n }\n const t1 = minOverlap / Math.abs(rayB);\n const t2 = maxOverlap / Math.abs(rayB);\n result.closeX = startX + t1 * r[0];\n result.closeY = startY + t1 * r[1];\n result.closeSqDist = t1 * t1 * (r[0] * r[0] + r[1] * r[1]);\n result.farX = startX + t2 * r[0];\n result.farY = startY + t2 * r[1];\n result.farSqDist = t2 * t2 * (r[0] * r[0] + r[1] * r[1]);\n return result;\n } else {\n if (crossRS !== 0 && 0 <= t && t <= 1 && 0 <= u && u <= 1) {\n const x = p[0] + t * r[0];\n const y = p[1] + t * r[1];\n const sqDist =\n (x - startX) * (x - startX) + (y - startY) * (y - startY);\n if (sqDist < minSqDist) {\n if (!result.collision) {\n result.farX = x;\n result.farY = y;\n result.farSqDist = sqDist;\n }\n minSqDist = sqDist;\n result.closeX = x;\n result.closeY = y;\n result.closeSqDist = sqDist;\n result.collision = true;\n } else {\n result.farX = x;\n result.farY = y;\n result.farSqDist = sqDist;\n }\n }\n }\n }\n return result;\n }\n\n //Tools functions :\n static normalise(v: FloatPoint): void {\n const len = Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n if (len != 0) {\n v[0] /= len;\n v[1] /= len;\n }\n }\n\n static dotProduct(a: FloatPoint, b: FloatPoint): float {\n const dp = a[0] * b[0] + a[1] * b[1];\n return dp;\n }\n\n static crossProduct(a: FloatPoint, b: FloatPoint): float {\n const cp = a[0] * b[1] - a[1] * b[0];\n return cp;\n }\n\n static project(\n axis: FloatPoint,\n p: gdjs.Polygon,\n result: FloatPoint\n ): void {\n let dp = Polygon.dotProduct(axis, p.vertices[0]);\n result[0] = dp;\n result[1] = dp;\n for (let i = 1, len = p.vertices.length; i < len; ++i) {\n dp = Polygon.dotProduct(axis, p.vertices[i]);\n if (dp < result[0]) {\n result[0] = dp;\n } else {\n if (dp > result[1]) {\n result[1] = dp;\n }\n }\n }\n }\n\n static distance(minA: float, maxA: float, minB: float, maxB: float): float {\n if (minA < minB) {\n return minB - maxA;\n } else {\n return minA - maxB;\n }\n }\n\n /**\n * Check if a point is inside a polygon.\n *\n * Uses <a href=\"https://wrf.ecse.rpi.edu//Research/Short_Notes/pnpoly.html\">PNPOLY</a> by W. Randolph Franklin.\n *\n * @param poly The polygon to test\n * @param x The point x coordinate\n * @param y The point y coordinate\n * @return true if the point is inside the polygon\n */\n static isPointInside(poly: gdjs.Polygon, x: float, y: float): boolean {\n let inside = false;\n for (\n let i = 0, j = poly.vertices.length - 1;\n i < poly.vertices.length;\n j = i++\n ) {\n let vi = poly.vertices[i];\n let vj = poly.vertices[j];\n if (\n vi[1] > y != vj[1] > y &&\n x < ((vj[0] - vi[0]) * (y - vi[1])) / (vj[1] - vi[1]) + vi[0]\n ) {\n inside = !inside;\n }\n }\n return inside;\n }\n\n /**\n * Copy a `CollisionTestResult` into another one.\n * Use `gdjs.Polygon.makeNewCollisionTestResult()` to build a new\n * destination before copying the existing source inside it.\n */\n static copyCollisionTestResult(\n source: CollisionTestResult,\n dest: CollisionTestResult\n ) {\n dest.collision = source.collision;\n dest.move_axis[0] = source.move_axis[0];\n dest.move_axis[1] = source.move_axis[1];\n }\n\n static makeNewCollisionTestResult = makeNewCollisionTestResult;\n\n /**\n * Copy a `RaycastTestResult` into another one.\n * Use `gdjs.Polygon.makeNewRaycastTestResult()` to build a new\n * destination before copying the existing source inside it.\n */\n static copyRaycastTestResult(\n source: RaycastTestResult,\n dest: RaycastTestResult\n ) {\n dest.collision = source.collision;\n dest.closeX = source.closeX;\n dest.closeY = source.closeY;\n dest.closeSqDist = source.closeSqDist;\n dest.farX = source.farX;\n dest.farY = source.farY;\n dest.farSqDist = source.farSqDist;\n }\n\n static makeNewRaycastTestResult = makeNewRaycastTestResult;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAKA,IAAU,MAAAA,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", "collisionTestStatics", "raycastTestStatics", "Polygon", "x", "y", "len", "angle", "t", "cosa", "sina", "i", "v1", "v2", "edgesLen", "zProductIsPositive", "width", "height", "rect", "p1", "p2", "ignoreTouchingEdges", "edge", "move_axis", "result", "minDist", "len1", "len2", "axis", "minMaxA", "minMaxB", "dist", "absDist", "p1Center", "p2Center", "d", "poly", "startX", "startY", "endX", "endY", "p", "q", "r", "s", "minSqDist", "deltaQP", "crossRS", "u", "rayA", "rayB", "edgeA", "edgeB", "minOverlap", "maxOverlap", "t1", "t2", "sqDist", "v", "a", "b", "dp", "minA", "maxA", "minB", "maxB", "inside", "j", "vi", "vj", "source", "dest"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var gdjs;(m=>{class a{_framesMeasures=[];_currentFrameIndex=0;_currentFrameMeasure={parent:null,time:0,lastStartTime:0,subsections:{}};_currentSection=null;_maxFramesCount=600;_framesCount=0;_getTimeNow;constructor(){for(;this._framesMeasures.length<this._maxFramesCount;)this._framesMeasures.push({parent:null,time:0,lastStartTime:0,subsections:{}});this._getTimeNow=window.performance&&typeof window.performance.now=="function"?window.performance.now.bind(window.performance):Date.now}beginFrame(){this._currentFrameMeasure={parent:null,time:0,lastStartTime:this._getTimeNow(),subsections:{}},this._currentSection=this._currentFrameMeasure}begin(t){if(this._currentSection===null)throw new Error("Impossible to call Profiler.begin() when not profiling a frame!");const e=this._currentSection.subsections,s=e[t]=e[t]||{parent:this._currentSection,time:0,lastStartTime:0,subsections:{}};this._currentSection=s,this._currentSection.lastStartTime=this._getTimeNow()}end(t){if(this._currentSection===null)throw new Error("Impossible to call Profiler.end() when not profiling a frame!");const e=this._getTimeNow()-this._currentSection.lastStartTime;this._currentSection.time=(this._currentSection.time||0)+e,this._currentSection.parent!==null&&(this._currentSection=this._currentSection.parent)}endFrame(){if(this._currentSection===null)throw new Error("Impossible to end profiling a frame when profiling has not started a frame!");if(this._currentSection.parent!==null)throw new Error("Mismatch in profiler, endFrame should be called on root section");this.end(),this._framesCount++,this._framesCount>this._maxFramesCount&&(this._framesCount=this._maxFramesCount),this._framesMeasures[this._currentFrameIndex]=this._currentFrameMeasure,this._currentFrameIndex++,this._currentFrameIndex>=this._maxFramesCount&&(this._currentFrameIndex=0)}static _addAverageSectionTimes(t,e,s,o){e.time=(e.time||0)+t.time/s;for(const r in t.subsections)if(t.subsections.hasOwnProperty(r)){const n=e.subsections,i=n[r]=n[r]||{parent:e,time:0,subsections:{}};a._addAverageSectionTimes(t.subsections[r],i,s,o)}}getFramesAverageMeasures(){const t={parent:null,time:0,lastStartTime:0,subsections:{}};for(let e=0;e<this._framesCount;++e)a._addAverageSectionTimes(this._framesMeasures[e],t,this._framesCount,e);return t}getStats(){return{framesCount:this._framesCount}}static getProfilerSectionTexts(t,e,s){const o=e.parent&&e.parent.time!==0?(e.time/e.parent.time*100).toFixed(1):"100%",r=e.time.toFixed(2);s.push(t+": "+r+"ms ("+o+")");const n=[];for(const i in e.subsections)e.subsections.hasOwnProperty(i)&&a.getProfilerSectionTexts(i,e.subsections[i],n);s.push.apply(s,n)}}m.Profiler=a})(gdjs||={});
|
|
2
|
+
//# sourceMappingURL=profiler.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../GDevelop/GDJS/Runtime/profiler.ts"],
|
|
4
|
+
"sourcesContent": ["namespace gdjs {\n export type ProfilerStats = {\n framesCount: integer;\n };\n\n export type FrameMeasure = {\n parent: FrameMeasure | null;\n time: float;\n lastStartTime: float;\n subsections: Record<string, FrameMeasure>;\n };\n\n /**\n * A basic profiling tool that can be used to measure time spent in sections of the engine.\n */\n export class Profiler {\n /** All the measures for the last frames */\n _framesMeasures: Array<FrameMeasure> = [];\n\n _currentFrameIndex: float = 0;\n\n /** The measures being done */\n _currentFrameMeasure: FrameMeasure = {\n parent: null,\n time: 0,\n lastStartTime: 0,\n subsections: {},\n };\n\n /** The section being measured */\n _currentSection: FrameMeasure | null = null;\n\n _maxFramesCount: number = 600;\n\n /** The number of frames that have been measured */\n _framesCount: number = 0;\n\n /** A function to get the current time. If available, corresponds to performance.now(). */\n _getTimeNow: () => float;\n\n constructor() {\n while (this._framesMeasures.length < this._maxFramesCount) {\n this._framesMeasures.push({\n parent: null,\n time: 0,\n lastStartTime: 0,\n subsections: {},\n });\n }\n this._getTimeNow =\n window.performance && typeof window.performance.now === 'function'\n ? window.performance.now.bind(window.performance)\n : Date.now;\n }\n\n beginFrame(): void {\n this._currentFrameMeasure = {\n parent: null,\n time: 0,\n lastStartTime: this._getTimeNow(),\n subsections: {},\n };\n this._currentSection = this._currentFrameMeasure;\n }\n\n begin(sectionName: string): void {\n if (this._currentSection === null)\n throw new Error(\n 'Impossible to call Profiler.begin() when not profiling a frame!'\n );\n\n // Push the new section\n const subsections = this._currentSection.subsections;\n const subsection = (subsections[sectionName] = subsections[\n sectionName\n ] || {\n parent: this._currentSection,\n time: 0,\n lastStartTime: 0,\n subsections: {},\n });\n this._currentSection = subsection;\n\n // Start the timer\n this._currentSection.lastStartTime = this._getTimeNow();\n }\n\n end(sectionName?: string): void {\n if (this._currentSection === null)\n throw new Error(\n 'Impossible to call Profiler.end() when not profiling a frame!'\n );\n\n // Stop the timer\n const sectionTime =\n this._getTimeNow() - this._currentSection.lastStartTime;\n this._currentSection.time =\n (this._currentSection.time || 0) + sectionTime;\n\n // Pop the section\n if (this._currentSection.parent !== null)\n this._currentSection = this._currentSection.parent;\n }\n\n endFrame(): void {\n if (this._currentSection === null)\n throw new Error(\n 'Impossible to end profiling a frame when profiling has not started a frame!'\n );\n if (this._currentSection.parent !== null) {\n throw new Error(\n 'Mismatch in profiler, endFrame should be called on root section'\n );\n }\n this.end();\n this._framesCount++;\n if (this._framesCount > this._maxFramesCount) {\n this._framesCount = this._maxFramesCount;\n }\n this._framesMeasures[this._currentFrameIndex] = this\n ._currentFrameMeasure as FrameMeasure;\n this._currentFrameIndex++;\n if (this._currentFrameIndex >= this._maxFramesCount) {\n this._currentFrameIndex = 0;\n }\n }\n\n static _addAverageSectionTimes(\n section: FrameMeasure,\n destinationSection: FrameMeasure,\n totalCount: integer,\n i: integer\n ): void {\n destinationSection.time =\n (destinationSection.time || 0) + section.time / totalCount;\n for (const sectionName in section.subsections) {\n if (section.subsections.hasOwnProperty(sectionName)) {\n const destinationSubsections = destinationSection.subsections;\n const destinationSubsection = (destinationSubsections[\n sectionName\n ] = destinationSubsections[sectionName] || {\n parent: destinationSection,\n time: 0,\n subsections: {},\n });\n Profiler._addAverageSectionTimes(\n section.subsections[sectionName],\n destinationSubsection,\n totalCount,\n i\n );\n }\n }\n }\n\n /**\n * Return the measures for all the section of the game during the frames\n * captured.\n */\n getFramesAverageMeasures(): FrameMeasure {\n const framesAverageMeasures = {\n parent: null,\n time: 0,\n lastStartTime: 0,\n subsections: {},\n };\n for (let i = 0; i < this._framesCount; ++i) {\n Profiler._addAverageSectionTimes(\n this._framesMeasures[i],\n framesAverageMeasures,\n this._framesCount,\n i\n );\n }\n return framesAverageMeasures;\n }\n\n /**\n * Get stats measured during the frames captured.\n */\n getStats(): ProfilerStats {\n return { framesCount: this._framesCount };\n }\n\n /**\n * Convert measures for a section into texts.\n * Useful for ingame profiling.\n *\n * @param sectionName The name of the section\n * @param profilerSection The section measures\n * @param outputs The array where to push the results\n */\n static getProfilerSectionTexts(\n sectionName: string,\n profilerSection: any,\n outputs: any\n ): void {\n const percent =\n profilerSection.parent && profilerSection.parent.time !== 0\n ? (\n (profilerSection.time / profilerSection.parent.time) *\n 100\n ).toFixed(1)\n : '100%';\n const time = profilerSection.time.toFixed(2);\n outputs.push(sectionName + ': ' + time + 'ms (' + percent + ')');\n const subsectionsOutputs = [];\n for (const subsectionName in profilerSection.subsections) {\n if (profilerSection.subsections.hasOwnProperty(subsectionName)) {\n Profiler.getProfilerSectionTexts(\n subsectionName,\n profilerSection.subsections[subsectionName],\n subsectionsOutputs\n );\n }\n }\n outputs.push.apply(outputs, subsectionsOut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AAqB,CAAC,EAC5B,UAAWC,KAAkBL,EAAgB,YACvCA,EAAgB,YAAY,eAAeK,CAAc,GAC3DjB,EAAS,wBACPiB,EACAL,EAAgB,YAAYK,CAAc,EAC1CD,CACF,EAGJH,EAAQ,KAAK,MAAMA,EAASG,CAAkB,CAChD,CACF,CA3MOjB,EAAM,SAAAC,IAfL",
|
|
6
|
+
"names": ["gdjs", "Profiler", "sectionName", "subsections", "subsection", "sectionTime", "section", "destinationSection", "totalCount", "i", "destinationSubsections", "destinationSubsection", "framesAverageMeasures", "profilerSection", "outputs", "percent", "time", "subsectionsOutputs", "subsectionName"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var gdjs;(i=>{class n{minX=0;minY=0;maxX=0;maxY=0;behavior;constructor(e){this.behavior=e,this.updateAABBFromOwner()}updateAABBFromOwner(){this.minX=this.behavior.owner.getAABB().min[0],this.minY=this.behavior.owner.getAABB().min[1],this.maxX=this.behavior.owner.getAABB().max[0],this.maxY=this.behavior.owner.getAABB().max[1]}}i.BehaviorRBushAABB=n;class o{constructor(e,t,s){this.owner=s;this.name=t.name||"",this.type=t.type||"",this._nameId=i.RuntimeObject.getNameIdentifier(this.name)}name;type;_nameId;_activated=!0;updateFromBehaviorData(e,t){return!1}getName(){return this.name}getNameId(){return this._nameId}stepPreEvents(e){if(this._activated){const t=e.getScene().getProfiler();t&&t.begin(this.name),this.doStepPreEvents(e),t&&t.end(this.name)}}stepPostEvents(e){if(this._activated){const t=e.getScene().getProfiler();t&&t.begin(this.name),this.doStepPostEvents(e),t&&t.end(this.name)}}activate(e){e===void 0&&(e=!0),!this._activated&&e?(this._activated=!0,this.onActivate()):this._activated&&!e&&(this._activated=!1,this.onDeActivate())}onCreated(){}activated(){return this._activated}onActivate(){}onDeActivate(){}doStepPreEvents(e){}doStepPostEvents(e){}onDestroy(){}onObjectHotReloaded(){}}i.RuntimeBehavior=o,i.registerBehavior("",i.RuntimeBehavior)})(gdjs||={});
|
|
2
|
+
//# sourceMappingURL=runtimebehavior.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../GDevelop/GDJS/Runtime/runtimebehavior.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * GDevelop JS Platform\n * Copyright 2013-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.\n * This project is released under the MIT License.\n */\nnamespace gdjs {\n /**\n * Allow to store a behavior in a RBush (spatial data structure).\n * Because this duplicates the AABB, this ensures the RBush AABB\n * stays the same even if the underlying object is moved\n * (in which case the behavior is responsible for removing/adding\n * back/updating this BehaviorRBushAABB).\n */\n export class BehaviorRBushAABB<T extends RuntimeBehavior> {\n minX: float = 0;\n minY: float = 0;\n maxX: float = 0;\n maxY: float = 0;\n behavior: T;\n\n constructor(behavior: T) {\n this.behavior = behavior;\n this.updateAABBFromOwner();\n }\n\n updateAABBFromOwner() {\n this.minX = this.behavior.owner.getAABB().min[0];\n this.minY = this.behavior.owner.getAABB().min[1];\n this.maxX = this.behavior.owner.getAABB().max[0];\n this.maxY = this.behavior.owner.getAABB().max[1];\n }\n }\n\n /**\n * RuntimeBehavior represents a behavior being used by a RuntimeObject.\n */\n export class RuntimeBehavior {\n name: string;\n type: string;\n _nameId: integer;\n _activated: boolean = true;\n\n /**\n * @param instanceContainer The container owning the object of the behavior\n * @param behaviorData The properties used to setup the behavior\n * @param owner The object owning the behavior\n */\n constructor(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n behaviorData: BehaviorData,\n public owner: gdjs.RuntimeObject\n ) {\n this.name = behaviorData.name || '';\n this.type = behaviorData.type || '';\n this._nameId = gdjs.RuntimeObject.getNameIdentifier(this.name);\n }\n\n /**\n * Called when the behavior must be updated using the specified behaviorData. This is the\n * case during hot-reload, and is only called if the behavior was modified.\n *\n * @see gdjs.RuntimeBehavior#onObjectHotReloaded\n *\n * @param oldBehaviorData The previous data for the behavior.\n * @param newBehaviorData The new data for the behavior.\n * @returns true if the behavior was updated, false if it could not (i.e: hot-reload is not supported).\n */\n updateFromBehaviorData(\n oldBehaviorData: BehaviorData,\n newBehaviorData: BehaviorData\n ): boolean {\n // If not redefined, mark by default the hot-reload as failed.\n return false;\n }\n\n /**\n * Get the name of the behavior.\n * @return The behavior's name.\n */\n getName(): string {\n return this.name;\n }\n\n /**\n * Get the name identifier of the behavior.\n * @return The behavior's name identifier.\n */\n getNameId(): integer {\n return this._nameId;\n }\n\n /**\n * Called at each frame before events. Call doStepPreEvents.<br>\n * Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead.\n * @param instanceContainer The instanceContainer owning the object\n */\n stepPreEvents(instanceContainer: gdjs.RuntimeInstanceContainer): void {\n if (this._activated) {\n const profiler = instanceContainer.getScene().getProfiler();\n if (profiler) {\n profiler.begin(this.name);\n }\n this.doStepPreEvents(instanceContainer);\n if (profiler) {\n profiler.end(this.name);\n }\n }\n }\n\n /**\n * Called at each frame after events. Call doStepPostEvents.<br>\n * Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead.\n * @param instanceContainer The instanceContainer owning the object\n */\n stepPostEvents(instanceContainer: gdjs.RuntimeInstanceContainer): void {\n if (this._activated) {\n const profiler = instanceContainer.getScene().getProfiler();\n if (profiler) {\n profiler.begin(this.name);\n }\n this.doStepPostEvents(instanceContainer);\n if (profiler) {\n profiler.end(this.name);\n }\n }\n }\n\n /**\n * De/Activate the behavior\n * @param enable true to enable the behavior, false to disable it\n */\n activate(enable: boolean): void {\n if (enable === undefined) {\n enable = true;\n }\n if (!this._activated && enable) {\n this._activated = true;\n this.onActivate();\n } else {\n if (this._activated && !enable) {\n this._activated = false;\n this.onDeActivate();\n }\n }\n }\n\n /**\n * Reimplement this to do extra work when the behavior is created (i.e: an\n * object using it was created), after the object is fully initialized (so\n * you can use `this.owner` without risk).\n */\n onCreated(): void {}\n\n /**\n * Return true if the behavior is activated\n */\n activated(): boolean {\n return this._activated;\n }\n\n /**\n * Reimplement this method to do extra work when the behavior is activated (after\n * it has been deactivated, see `onDeActivate`).\n */\n onActivate(): void {}\n\n /**\n * Reimplement this method to do extra work when the behavior is deactivated.\n */\n onDeActivate(): void {}\n\n /**\n * This method is called each tick before events are done.\n * @param instanceContainer The instanceContainer owning the object\n */\n doStepPreEvents(instanceContainer: gdjs.RuntimeInstanceContainer): void {}\n\n /**\n * This method is called each tick after events are done.\n * @param instanceContainer The instanceContainer owning the object\n */\n doStepPostEvents(instanceContainer: gdjs.RuntimeInstanceContainer): void {}\n\n /**\n * This method is called when the owner of the behavior\n * is being removed from the scene and is about to be destroyed/reused later\n * or when the behavior is removed from an object (can happen in case of\n * hot-reloading only. Otherwise, behaviors are just de-activated,\n * not removed. See `onDeActivate`).\n */\n onDestroy(): void {}\n\n /**\n * This method is called when the owner of the behavior\n * was hot reloaded, so its position, angle, size can have been changed outside\n * of events.\n */\n onObjectHotReloaded(): void {}\n }\n gdjs.registerBehavior('', gdjs.RuntimeBehavior);\n}\n"],
|
|
5
|
+
"mappings": "AAKA,IAAU,MAAAA,GAAV,CAQS,MAAMC,CAA6C,CACxD,KAAc,EACd,KAAc,EACd,KAAc,EACd,KAAc,EACd,SAEA,YAAYC,EAAa,CACvB,KAAK,SAAWA,EAChB,KAAK,oBAAoB,CAC3B,CAEA,qBAAsB,CACpB,KAAK,KAAO,KAAK,SAAS,MAAM,QAAQ,EAAE,IAAI,CAAC,EAC/C,KAAK,KAAO,KAAK,SAAS,MAAM,QAAQ,EAAE,IAAI,CAAC,EAC/C,KAAK,KAAO,KAAK,SAAS,MAAM,QAAQ,EAAE,IAAI,CAAC,EAC/C,KAAK,KAAO,KAAK,SAAS,MAAM,QAAQ,EAAE,IAAI,CAAC,CACjD,CACF,CAlBOF,EAAM,kBAAAC,EAuBN,MAAME,CAAgB,CAW3B,YACEC,EACAC,EACOC,EACP,CADO,WAAAA,EAEP,KAAK,KAAOD,EAAa,MAAQ,GACjC,KAAK,KAAOA,EAAa,MAAQ,GACjC,KAAK,QAAUL,EAAK,cAAc,kBAAkB,KAAK,IAAI,CAC/D,CAlBA,KACA,KACA,QACA,WAAsB,GA2BtB,uBACEO,EACAC,EACS,CAET,MAAO,EACT,CAMA,SAAkB,CAChB,OAAO,KAAK,IACd,CAMA,WAAqB,CACnB,OAAO,KAAK,OACd,CAOA,cAAcJ,EAAwD,CACpE,GAAI,KAAK,WAAY,CACnB,MAAMK,EAAWL,EAAkB,SAAS,EAAE,YAAY,EACtDK,GACFA,EAAS,MAAM,KAAK,IAAI,EAE1B,KAAK,gBAAgBL,CAAiB,EAClCK,GACFA,EAAS,IAAI,KAAK,IAAI,CAE1B,CACF,CAOA,eAAeL,EAAwD,CACrE,GAAI,KAAK,WAAY,CACnB,MAAMK,EAAWL,EAAkB,SAAS,EAAE,YAAY,EACtDK,GACFA,EAAS,MAAM,KAAK,IAAI,EAE1B,KAAK,iBAAiBL,CAAiB,EACnCK,GACFA,EAAS,IAAI,KAAK,IAAI,CAE1B,CACF,CAMA,SAASC,EAAuB,CAC1BA,IAAW,SACbA,EAAS,IAEP,CAAC,KAAK,YAAcA,GACtB,KAAK,WAAa,GAClB,KAAK,WAAW,GAEZ,KAAK,YAAc,CAACA,IACtB,KAAK,WAAa,GAClB,KAAK,aAAa,EAGxB,CAOA,WAAkB,CAAC,CAKnB,WAAqB,CACnB,OAAO,KAAK,UACd,CAMA,YAAmB,CAAC,CAKpB,cAAqB,CAAC,CAMtB,gBAAgBN,EAAwD,CAAC,CAMzE,iBAAiBA,EAAwD,CAAC,CAS1E,WAAkB,CAAC,CAOnB,qBAA4B,CAAC,CAC/B,CAlKOJ,EAAM,gBAAAG,EAmKbH,EAAK,iBAAiB,GAAIA,EAAK,eAAe,IAlMtC",
|
|
6
|
+
"names": ["gdjs", "BehaviorRBushAABB", "behavior", "RuntimeBehavior", "instanceContainer", "behaviorData", "owner", "oldBehaviorData", "newBehaviorData", "profiler", "enable"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var gdjs;(i=>{const g=new i.Logger("Game manager"),p=(d,e,t)=>{if(d.startsWith("data:")||d.startsWith("blob:"))return d;const s=d.indexOf("?")===-1?"?":"&";return d+s+e+"="+t},m=d=>d.startsWith("https://project-resources.gdevelop.io/")||d.startsWith("https://project-resources-dev.gdevelop.io/");class f{_runtimeGame;constructor(e){this._runtimeGame=e}getFullUrl(e){const{gdevelopResourceToken:t}=this._runtimeGame._options;return!t||!m(e)?e:p(e,"gd_resource_token",encodeURIComponent(t))}checkIfCredentialsRequired(e){return this._runtimeGame._options.gdevelopResourceToken?!1:!!m(e)}}i.RuntimeGameResourcesLoader=f;class M{_resourcesLoader;_variables;_data;_eventsBasedObjectDatas;_imageManager;_soundManager;_fontManager;_jsonManager;_model3DManager;_effectsManager;_bitmapFontManager;_maxFPS;_minFPS;_gameResolutionWidth;_gameResolutionHeight;_originalWidth;_originalHeight;_resizeMode;_adaptGameResolutionAtRuntime;_scaleMode;_pixelsRounding;_antialiasingMode;_isAntialisingEnabledOnMobile;_renderer;_sessionId;_playerId;_watermark;_sceneStack;_notifyScenesForGameResolutionResize=!1;_paused=!1;_hasJustResumed=!1;_inputManager;_injectExternalLayout;_options;_embeddedResourcesMappings;_debuggerClient;_sessionMetricsInitialized=!1;_disableMetrics=!1;_isPreview;constructor(e,t){this._options=t||{},this._variables=new i.VariablesContainer(e.variables),this._data=e,this._resourcesLoader=new i.RuntimeGameResourcesLoader(this),this._imageManager=new i.ImageManager(this._data.resources.resources,this._resourcesLoader),this._soundManager=new i.SoundManager(this._data.resources.resources,this._resourcesLoader),this._fontManager=new i.FontManager(this._data.resources.resources,this._resourcesLoader),this._jsonManager=new i.JsonManager(this._data.resources.resources,this._resourcesLoader),this._bitmapFontManager=new i.BitmapFontManager(this._data.resources.resources,this._resourcesLoader,this._imageManager),this._model3DManager=new i.Model3DManager(this._data.resources.resources,this._resourcesLoader),this._effectsManager=new i.EffectsManager,this._maxFPS=this._data.properties.maxFPS,this._minFPS=this._data.properties.minFPS,this._gameResolutionWidth=this._data.properties.windowWidth,this._gameResolutionHeight=this._data.properties.windowHeight,this._originalWidth=this._gameResolutionWidth,this._originalHeight=this._gameResolutionHeight,this._resizeMode=this._data.properties.sizeOnStartupMode,this._adaptGameResolutionAtRuntime=this._data.properties.adaptGameResolutionAtRuntime,this._scaleMode=e.properties.scaleMode||"linear",this._pixelsRounding=this._data.properties.pixelsRounding,this._antialiasingMode=this._data.properties.antialiasingMode,this._isAntialisingEnabledOnMobile=this._data.properties.antialisingEnabledOnMobile,this._renderer=new i.RuntimeGameRenderer(this,this._options.forceFullscreen||!1),this._watermark=new i.watermark.RuntimeWatermark(this,e.properties.authorUsernames,this._data.properties.watermark),this._sceneStack=new i.SceneStack(this),this._inputManager=new i.InputManager,this._injectExternalLayout=this._options.injectExternalLayout||"",this._debuggerClient=i.DebuggerClient?new i.DebuggerClient(this):null,this._isPreview=this._options.isPreview||!1,this._sessionId=null,this._playerId=null,this._embeddedResourcesMappings=new Map;for(const s of this._data.resources.resources)if(s.metadata)try{const n=JSON.parse(s.metadata);n?.embeddedResourcesMapping&&this._embeddedResourcesMappings.set(s.name,n.embeddedResourcesMapping)}catch{g.error("Some metadata of resources can not be successfully parsed.")}if(this._eventsBasedObjectDatas=new Map,this._data.eventsFunctionsExtensions)for(const s of this._data.eventsFunctionsExtensions)for(const n of s.eventsBasedObjects)this._eventsBasedObjectDatas.set(s.name+"::"+n.name,n);this.isUsingGDevelopDevelopmentEnvironment()&&g.info("This game will run on the development version of GDevelop APIs.")}setProjectData(e){this._data=e,this._imageManager.setResources(this._data.resources.resources),this._soundManager.setResources(this._data.resources.resources),this._fontManager.setResources(this._data.resources.resources),this._jsonManager.setResources(this._data.resources.resources),this._bitmapFontManager.setResources(this._data.resources.resources),this._model3DManager.setResources(this._data.resources.resources)}getAdditionalOptions(){return this._options}getRenderer(){return this._renderer}getVariables(){return this._variables}getSoundManager(){return this._soundManager}getImageManager(){return this._imageManager}getFontManager(){return this._fontManager}getBitmapFontManager(){return this._bitmapFontManager}getInputManager(){return this._inputManager}getJsonManager(){return this._jsonManager}getModel3DManager(){return this._model3DManager}getEffectsManager(){return this._effectsManager}getGameData(){return this._data}getEventsBasedObjectData(e){const t=this._eventsBasedObjectDatas.get(e);return t||(g.error('The game has no events-based object of the type "'+e+'"'),null)}getSceneData(e){let t=null;for(let s=0,n=this._data.layouts.length;s<n;++s){const a=this._data.layouts[s];if(e===void 0||a.name===e){t=a;break}}return t===null&&g.error('The game has no scene called "'+e+'"'),t}hasScene(e){let t=!1;for(let s=0,n=this._data.layouts.length;s<n;++s){const a=this._data.layouts[s];if(e===void 0||a.name==e){t=!0;break}}return t}getExternalLayoutData(e){let t=null;for(let s=0,n=this._data.externalLayouts.length;s<n;++s){const a=this._data.externalLayouts[s];if(a.name===e){t=a;break}}return t}getInitialObjectsData(){return this._data.objects||[]}getOriginalWidth(){return this._originalWidth}getOriginalHeight(){return this._originalHeight}getGameResolutionWidth(){return this._gameResolutionWidth}getGameResolutionHeight(){return this._gameResolutionHeight}setGameResolutionSize(e,t){if(this._gameResolutionWidth=e,this._gameResolutionHeight=t,this._adaptGameResolutionAtRuntime&&i.RuntimeGameRenderer&&i.RuntimeGameRenderer.getWindowInnerWidth&&i.RuntimeGameRenderer.getWindowInnerHeight){const s=i.RuntimeGameRenderer.getWindowInnerWidth(),n=i.RuntimeGameRenderer.getWindowInnerHeight();this._resizeMode==="adaptWidth"?this._gameResolutionWidth=this._gameResolutionHeight*s/n:this._resizeMode==="adaptHeight"&&(this._gameResolutionHeight=this._gameResolutionWidth*n/s)}this._renderer.updateRendererSize(),this._notifyScenesForGameResolutionResize=!0}setGameResolutionResizeMode(e){this._resizeMode=e,this._forceGameResolutionUpdate()}getGameResolutionResizeMode(){return this._resizeMode}setAdaptGameResolutionAtRuntime(e){this._adaptGameResolutionAtRuntime=e,this._forceGameResolutionUpdate()}getAdaptGameResolutionAtRuntime(){return this._adaptGameResolutionAtRuntime}getMinimalFramerate(){return this._minFPS}getScaleMode(){return this._scaleMode}getPixelsRounding(){return this._pixelsRounding}getAntialiasingMode(){return this._antialiasingMode}isAntialisingEnabledOnMobile(){return this._isAntialisingEnabledOnMobile}pause(e){this._paused!==e&&(this._paused=e,this._debuggerClient&&(this._paused?this._debuggerClient.sendGamePaused():this._debuggerClient.sendGameResumed()))}hasJustResumed(){return this._hasJustResumed}loadAllAssets(e,t){const s=new i.LoadingScreenRenderer(this.getRenderer(),this._imageManager,this._data.properties.loadingScreen),n=this._data.resources.resources.length,a=this;this._imageManager.loadTextures(function(r,o){const u=Math.floor(r/n*100);s.setPercent(u),t&&t(u)},function(r){a._soundManager.preloadAudio(function(o,u){const l=Math.floor((r+o)/n*100);s.setPercent(l),t&&t(l)},function(o){a._fontManager.loadFonts(function(u,l){const h=Math.floor((r+o+u)/n*100);s.setPercent(h),t&&t(h)},function(u){a._jsonManager.preloadJsons(function(l,h){const c=Math.floor((r+o+u+l)/n*100);s.setPercent(c),t&&t(c)},function(l){a._model3DManager.loadModels(function(h,c){const _=Math.floor((r+o+u+l+h)/n*100);s.setPercent(_),t&&t(_)},function(h){a._bitmapFontManager.loadBitmapFontData(c=>{var _=Math.floor((r+o+u+l+h+c)/n*100);s.setPercent(_),t&&t(_)}).then(()=>s.unload()).then(()=>i.getAllAsynchronouslyLoadingLibraryPromise()).then(()=>{e()})})})})})})}startGameLoop(){try{if(!this.hasScene()){g.error("The game has no scene.");return}this._forceGameResolutionUpdate();const e=this._data.firstLayout;this._sceneStack.push(this.hasScene(e)?e:this.getSceneData().name,this._injectExternalLayout),this._watermark.displayAtStartup(),this._setupGameVisibilityEvents();const t=this;let s=0;this._hasJustResumed=!1,this._renderer.startGameLoop(function(n){if(t._paused||(s+=n,t._maxFPS>0&&1e3/s>t._maxFPS+7))return!0;const a=s;return s=0,t._notifyScenesForGameResolutionResize&&(t._sceneStack.onGameResolutionResized(),t._notifyScenesForGameResolutionResize=!1),t._sceneStack.step(a)?(t.getInputManager().onFrameEnded(),t._hasJustResumed=!1,!0):!1}),setTimeout(()=>{this._setupSessionMetrics()},1e4)}catch(e){throw g.error("Internal crash: "+e),e}}enableMetrics(e){this._disableMetrics=!e,e&&this._setupSessionMetrics()}_setupGameVisibilityEvents(){typeof navigator<"u"&&typeof document<"u"&&(document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(this._hasJustResumed=!0)}),window.addEventListener("resume",()=>{this._hasJustResumed=!0},!1))}_setupSessionMetrics(){if(this._sessionMetricsInitialized||this._disableMetrics||this.isPreview()||typeof fetch>"u"||!this._data.properties.projectUuid)return;const e="https://api.gdevelop-app.com/analytics";this._playerId=this._makePlayerUuid();let t=0,s=0,n=Date.now();fetch(e+"/session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gameId:this._data.properties.projectUuid,playerId:this._playerId,game:{name:this._data.properties.name||"",packageName:this._data.properties.packageName||"",version:this._data.properties.version||"",location:window.location.href},platform:{isCordova:!!window.cordova,devicePlatform:typeof device<"u"&&device.platform||"",navigatorPlatform:typeof navigator<"u"?navigator.platform:"",hasTouch:typeof navigator<"u"?!!navigator.maxTouchPoints&&navigator.maxTouchPoints>2:!1}})}).then(r=>{if(!r.ok)throw console.error("Error while creating the session",r),new Error("Error while creating the session");return r}).then(r=>r.text()).then(r=>{this._sessionId=r}).catch(()=>{});const a=()=>{if(!this._sessionId)return;const r=Date.now();if(s+=r-n,n=r,s<5*1e3)return;const o=Math.floor(s/1e3)*1e3;t+=o,s-=o,navigator.sendBeacon(e+"/session-hit",JSON.stringify({gameId:this._data.properties.projectUuid,playerId:this._playerId,sessionId:this._sessionId,duration:Math.floor(t/1e3)}))};if(typeof navigator<"u"&&typeof document<"u"){document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?n=Date.now():a()}),window.addEventListener("pagehide",a,!1),window.addEventListener("pause",a,!1),window.addEventListener("resume",()=>{n=Date.now()},!1);const r=typeof safari=="object"&&safari.pushNotification,o=/electron/i.test(navigator.userAgent);(r||o)&&window.addEventListener("beforeunload",()=>{a()})}this._sessionMetricsInitialized=!0,this._sessionId=this._sessionId}_makePlayerUuid(){try{const e="GDJS-internal-player-uuid",t=localStorage.getItem(e);if(t)return t;const s=i.makeUuid();return localStorage.setItem(e,s),s}catch{return i.makeUuid()}}getSessionId(){return this._sessionId}getPlayerId(){return this._playerId}onWindowInnerSizeChanged(){this._forceGameResolutionUpdate()}_forceGameResolutionUpdate(){this.setGameResolutionSize(this._gameResolutionWidth,this._gameResolutionHeight)}startCurrentSceneProfiler(e){const t=this._sceneStack.getCurrentScene();return t?(t.startProfiler(e),!0):!1}stopCurrentSceneProfiler(){const e=this._sceneStack.getCurrentScene();e&&e.stopProfiler()}wasFirstSceneLoaded(){return this._sceneStack.wasFirstSceneLoaded()}getSceneStack(){return this._sceneStack}isPreview(){return this._isPreview}isUsingGDevelopDevelopmentEnvironment(){return this._options.environment==="dev"}getExtensionProperty(e,t){for(let s of this._data.properties.extensionProperties)if(s.extension===e&&s.property===t)return s.value;return null}resolveEmbeddedResource(e,t){const s=this._embeddedResourcesMappings.get(e);return s&&s[t]?s[t]:t}}i.RuntimeGame=M})(gdjs||={});
|
|
2
|
+
//# sourceMappingURL=runtimegame.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../GDevelop/GDJS/Runtime/runtimegame.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * GDevelop JS Platform\n * Copyright 2013-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.\n * This project is released under the MIT License.\n */\nnamespace gdjs {\n const logger = new gdjs.Logger('Game manager');\n\n /** Identify a script file, with its content hash (useful for hot-reloading). */\n export type RuntimeGameOptionsScriptFile = {\n /** The path for this script file. */\n path: string;\n /** The hash of the script file content. */\n hash: number;\n };\n\n /** Options given to the game at startup. */\n export type RuntimeGameOptions = {\n /** if true, force fullscreen. */\n forceFullscreen?: boolean;\n /** if true, game is run as a preview launched from an editor. */\n isPreview?: boolean;\n /** The name of the external layout to create in the scene at position 0;0. */\n injectExternalLayout?: string;\n /** Script files, used for hot-reloading. */\n scriptFiles?: Array<RuntimeGameOptionsScriptFile>;\n /** if true, export is a partial preview without events. */\n projectDataOnlyExport?: boolean;\n /** The address of the debugger server, to reach out using WebSocket. */\n websocketDebuggerServerAddress?: string;\n /** The port of the debugger server, to reach out using WebSocket. */\n websocketDebuggerServerPort?: string;\n\n /**\n * The path to require `@electron/remote` module.\n * This is only useful in a preview, where this can't be required from\n * `@electron/remote` directly as previews don't have any node_modules.\n * On the contrary, a game packaged with Electron as a standalone app\n * has its node_modules.\n * This can be removed once there are no more dependencies on\n * `@electron/remote` in the game engine and extensions.\n */\n electronRemoteRequirePath?: string;\n\n /**\n * the token to use by the game engine when requiring any resource stored on\n * GDevelop Cloud buckets. Note that this is only useful during previews.\n */\n gdevelopResourceToken?: string;\n\n /**\n * Check if, in some exceptional cases, we allow authentication\n * to be done through a iframe.\n * This is usually discouraged as the user can't verify that the authentication\n * window is a genuine one. It's only to be used in trusted contexts.\n */\n allowAuthenticationUsingIframeForPreview?: boolean;\n\n /**\n * If set, the game should use the specified environment for making calls\n * to GDevelop APIs (\"dev\" = development APIs).\n */\n environment?: 'dev';\n };\n\n const addSearchParameterToUrl = (\n url: string,\n urlEncodedParameterName: string,\n urlEncodedValue: string\n ) => {\n if (url.startsWith('data:') || url.startsWith('blob:')) {\n // blob/data protocol does not support search parameters, which are useless anyway.\n return url;\n }\n\n const separator = url.indexOf('?') === -1 ? '?' : '&';\n return url + separator + urlEncodedParameterName + '=' + urlEncodedValue;\n };\n\n const checkIfIsGDevelopCloudBucketUrl = (url: string): boolean => {\n return (\n url.startsWith('https://project-resources.gdevelop.io/') ||\n url.startsWith('https://project-resources-dev.gdevelop.io/')\n );\n };\n\n /**\n * Gives helper methods used when resources are loaded from an URL.\n */\n export class RuntimeGameResourcesLoader {\n _runtimeGame: RuntimeGame;\n\n constructor(runtimeGame: RuntimeGame) {\n this._runtimeGame = runtimeGame;\n }\n\n /**\n * Complete the given URL with any specific parameter required to access\n * the resource (this can be for example a token needed to access the resource).\n */\n getFullUrl(url: string) {\n const { gdevelopResourceToken } = this._runtimeGame._options;\n if (!gdevelopResourceToken) return url;\n\n if (!checkIfIsGDevelopCloudBucketUrl(url)) return url;\n\n return addSearchParameterToUrl(\n url,\n 'gd_resource_token',\n encodeURIComponent(gdevelopResourceToken)\n );\n }\n\n /**\n * Return true if the specified URL must be loaded with cookies (\"credentials\")\n * sent to grant access to them.\n */\n checkIfCredentialsRequired(url: string) {\n if (this._runtimeGame._options.gdevelopResourceToken) return false;\n\n // Any resource stored on the GDevelop Cloud buckets needs the \"credentials\" of the user,\n // i.e: its gdevelop.io cookie, to be passed.\n // Note that this is only useful during previews.\n if (checkIfIsGDevelopCloudBucketUrl(url)) return true;\n\n // For other resources, use the default way of loading resources (\"anonymous\" or \"same-site\").\n return false;\n }\n }\n\n /**\n * Represents a game being played.\n */\n export class RuntimeGame {\n _resourcesLoader: RuntimeGameResourcesLoader;\n _variables: VariablesContainer;\n _data: ProjectData;\n _eventsBasedObjectDatas: Map<String, EventsBasedObjectData>;\n _imageManager: ImageManager;\n _soundManager: SoundManager;\n _fontManager: FontManager;\n _jsonManager: JsonManager;\n _model3DManager: Model3DManager;\n _effectsManager: EffectsManager;\n _bitmapFontManager: BitmapFontManager;\n _maxFPS: integer;\n _minFPS: integer;\n _gameResolutionWidth: integer;\n _gameResolutionHeight: integer;\n _originalWidth: float;\n _originalHeight: float;\n _resizeMode: 'adaptWidth' | 'adaptHeight' | string;\n _adaptGameResolutionAtRuntime: boolean;\n _scaleMode: 'linear' | 'nearest';\n _pixelsRounding: boolean;\n _antialiasingMode: 'none' | 'MSAA';\n _isAntialisingEnabledOnMobile: boolean;\n /**\n * Game loop management (see startGameLoop method)\n */\n _renderer: RuntimeGameRenderer;\n _sessionId: string | null;\n _playerId: string | null;\n _watermark: watermark.RuntimeWatermark;\n\n _sceneStack: SceneStack;\n /**\n * When set to true, the scenes are notified that game resolution size changed.\n */\n _notifyScenesForGameResolutionResize: boolean = false;\n\n /**\n * When paused, the game won't step and will be freezed. Useful for debugging.\n */\n _paused: boolean = false;\n\n /**\n * True during the first frame the game is back from being hidden.\n * This has nothing to do with `_paused`.\n */\n _hasJustResumed: boolean = false;\n\n //Inputs :\n _inputManager: InputManager;\n\n /**\n * Allow to specify an external layout to insert in the first scene.\n */\n _injectExternalLayout: any;\n _options: RuntimeGameOptions;\n\n /**\n * The mappings for embedded resources\n */\n _embeddedResourcesMappings: Map<string, Record<string, string>>;\n\n /**\n * Optional client to connect to a debugger server.\n */\n _debuggerClient: gdjs.AbstractDebuggerClient | null;\n _sessionMetricsInitialized: boolean = false;\n _disableMetrics: boolean = false;\n _isPreview: boolean;\n\n /**\n * @param data The object (usually stored in data.json) containing the full project data\n * @param\n */\n constructor(data: ProjectData, options?: RuntimeGameOptions) {\n this._options = options || {};\n this._variables = new gdjs.VariablesContainer(data.variables);\n this._data = data;\n this._resourcesLoader = new gdjs.RuntimeGameResourcesLoader(this);\n this._imageManager = new gdjs.ImageManager(\n this._data.resources.resources,\n this._resourcesLoader\n );\n this._soundManager = new gdjs.SoundManager(\n this._data.resources.resources,\n this._resourcesLoader\n );\n this._fontManager = new gdjs.FontManager(\n this._data.resources.resources,\n this._resourcesLoader\n );\n this._jsonManager = new gdjs.JsonManager(\n this._data.resources.resources,\n this._resourcesLoader\n );\n this._bitmapFontManager = new gdjs.BitmapFontManager(\n this._data.resources.resources,\n this._resourcesLoader,\n this._imageManager\n );\n this._model3DManager = new gdjs.Model3DManager(\n this._data.resources.resources,\n this._resourcesLoader\n );\n this._effectsManager = new gdjs.EffectsManager();\n this._maxFPS = this._data.properties.maxFPS;\n this._minFPS = this._data.properties.minFPS;\n this._gameResolutionWidth = this._data.properties.windowWidth;\n this._gameResolutionHeight = this._data.properties.windowHeight;\n this._originalWidth = this._gameResolutionWidth;\n this._originalHeight = this._gameResolutionHeight;\n this._resizeMode = this._data.properties.sizeOnStartupMode;\n this._adaptGameResolutionAtRuntime = this._data.properties.adaptGameResolutionAtRuntime;\n this._scaleMode = data.properties.scaleMode || 'linear';\n this._pixelsRounding = this._data.properties.pixelsRounding;\n this._antialiasingMode = this._data.properties.antialiasingMode;\n this._isAntialisingEnabledOnMobile = this._data.properties.antialisingEnabledOnMobile;\n this._renderer = new gdjs.RuntimeGameRenderer(\n this,\n this._options.forceFullscreen || false\n );\n this._watermark = new gdjs.watermark.RuntimeWatermark(\n this,\n data.properties.authorUsernames,\n this._data.properties.watermark\n );\n this._sceneStack = new gdjs.SceneStack(this);\n this._inputManager = new gdjs.InputManager();\n this._injectExternalLayout = this._options.injectExternalLayout || '';\n this._debuggerClient = gdjs.DebuggerClient\n ? new gdjs.DebuggerClient(this)\n : null;\n this._isPreview = this._options.isPreview || false;\n this._sessionId = null;\n this._playerId = null;\n\n this._embeddedResourcesMappings = new Map();\n for (const resource of this._data.resources.resources) {\n if (resource.metadata) {\n try {\n const metadata = JSON.parse(resource.metadata);\n if (metadata?.embeddedResourcesMapping) {\n this._embeddedResourcesMappings.set(\n resource.name,\n metadata.embeddedResourcesMapping\n );\n }\n } catch {\n logger.error(\n 'Some metadata of resources can not be successfully parsed.'\n );\n }\n }\n }\n\n this._eventsBasedObjectDatas = new Map<String, EventsBasedObjectData>();\n if (this._data.eventsFunctionsExtensions) {\n for (const extension of this._data.eventsFunctionsExtensions) {\n for (const eventsBasedObject of extension.eventsBasedObjects) {\n this._eventsBasedObjectDatas.set(\n extension.name + '::' + eventsBasedObject.name,\n eventsBasedObject\n );\n }\n }\n }\n\n if (this.isUsingGDevelopDevelopmentEnvironment()) {\n logger.info(\n 'This game will run on the development version of GDevelop APIs.'\n );\n }\n }\n\n /**\n * Update the project data. Useful for hot-reloading, should not be used otherwise.\n *\n * @param projectData The object (usually stored in data.json) containing the full project data\n */\n setProjectData(projectData: ProjectData): void {\n this._data = projectData;\n this._imageManager.setResources(this._data.resources.resources);\n this._soundManager.setResources(this._data.resources.resources);\n this._fontManager.setResources(this._data.resources.resources);\n this._jsonManager.setResources(this._data.resources.resources);\n this._bitmapFontManager.setResources(this._data.resources.resources);\n this._model3DManager.setResources(this._data.resources.resources);\n }\n\n /**\n * Return the additional options passed to the RuntimeGame when created.\n * @returns The additional options, if any.\n */\n getAdditionalOptions(): RuntimeGameOptions | null {\n return this._options;\n }\n\n getRenderer(): gdjs.RuntimeGameRenderer {\n return this._renderer;\n }\n\n /**\n * Get the variables of the RuntimeGame.\n * @return The global variables\n */\n getVariables(): gdjs.VariablesContainer {\n return this._variables;\n }\n\n /**\n * Get the gdjs.SoundManager of the RuntimeGame.\n * @return The sound manager.\n */\n getSoundManager(): gdjs.HowlerSoundManager {\n return this._soundManager;\n }\n\n /**\n * Get the gdjs.ImageManager of the RuntimeGame.\n * @return The image manager.\n */\n getImageManager(): gdjs.PixiImageManager {\n return this._imageManager;\n }\n\n /**\n * Get the gdjs.FontManager of the RuntimeGame.\n * @return The font manager.\n */\n getFontManager(): gdjs.FontFaceObserverFontManager {\n return this._fontManager;\n }\n\n /**\n * Get the gdjs.BitmapFontManager of the RuntimeGame.\n * @return The bitmap font manager.\n */\n getBitmapFontManager(): gdjs.BitmapFontManager {\n // @ts-ignore\n return this._bitmapFontManager;\n }\n\n /**\n * Get the input manager of the game, storing mouse, keyboard\n * and touches states.\n * @return The input manager owned by the game\n */\n getInputManager(): gdjs.InputManager {\n return this._inputManager;\n }\n\n /**\n * Get the JSON manager of the game, used to load JSON from game\n * resources.\n * @return The json manager for the game\n */\n getJsonManager(): gdjs.JsonManager {\n return this._jsonManager;\n }\n\n /**\n * Get the 3D model manager of the game, used to load 3D model from game\n * resources.\n * @return The 3D model manager for the game\n */\n getModel3DManager(): gdjs.Model3DManager {\n return this._model3DManager;\n }\n\n /**\n * Get the effects manager of the game, which allows to manage\n * effects on runtime objects or runtime layers.\n * @return The effects manager for the game\n */\n getEffectsManager(): gdjs.EffectsManager {\n return this._effectsManager;\n }\n\n /**\n * Get the object containing the game data\n * @return The object associated to the game.\n */\n getGameData(): ProjectData {\n return this._data;\n }\n\n getEventsBasedObjectData(type: string): EventsBasedObjectData | null {\n const eventsBasedObjectData = this._eventsBasedObjectDatas.get(type);\n if (!eventsBasedObjectData) {\n logger.error(\n 'The game has no events-based object of the type \"' + type + '\"'\n );\n return null;\n }\n return eventsBasedObjectData;\n }\n\n /**\n * Get the data associated to a scene.\n *\n * @param sceneName The name of the scene. If not defined, the first scene will be returned.\n * @return The data associated to the scene.\n */\n getSceneData(sceneName?: string): LayoutData | null {\n let scene: LayoutData | null = null;\n for (let i = 0, len = this._data.layouts.length; i < len; ++i) {\n const sceneData = this._data.layouts[i];\n if (sceneName === undefined || sceneData.name === sceneName) {\n scene = sceneData;\n break;\n }\n }\n if (scene === null) {\n logger.error('The game has no scene called \"' + sceneName + '\"');\n }\n return scene;\n }\n\n /**\n * Check if a scene exists\n *\n * @param sceneName The name of the scene to search.\n * @return true if the scene exists. If sceneName is undefined, true if the game has a scene.\n */\n hasScene(sceneName?: string): boolean {\n let isTrue = false;\n for (let i = 0, len = this._data.layouts.length; i < len; ++i) {\n const sceneData = this._data.layouts[i];\n if (sceneName === undefined || sceneData.name == sceneName) {\n isTrue = true;\n break;\n }\n }\n return isTrue;\n }\n\n /**\n * Get the data associated to an external layout.\n *\n * @param name The name of the external layout.\n * @return The data associated to the external layout or null if not found.\n */\n getExternalLayoutData(name: string): ExternalLayoutData | null {\n let externalLayout: ExternalLayoutData | null = null;\n for (let i = 0, len = this._data.externalLayouts.length; i < len; ++i) {\n const layoutData = this._data.externalLayouts[i];\n if (layoutData.name === name) {\n externalLayout = layoutData;\n break;\n }\n }\n return externalLayout;\n }\n\n /**\n * Get the data representing all the global objects of the game.\n * @return The data associated to the global objects.\n */\n getInitialObjectsData(): ObjectData[] {\n return this._data.objects || [];\n }\n\n /**\n * Get the original width of the game, as set on the startup of the game.\n *\n * This is guaranteed to never change, even if the size of the game is changed afterwards.\n */\n getOriginalWidth(): float {\n return this._originalWidth;\n }\n\n /**\n * Get the original height of the game, as set on the startup of the game.\n *\n * This is guaranteed to never change, even if the size of the game is changed afterwards.\n */\n getOriginalHeight(): float {\n return this._originalHeight;\n }\n\n /**\n * Get the game resolution (the size at which the game is played and rendered) width.\n * @returns The game resolution width, in pixels.\n */\n getGameResolutionWidth(): float {\n return this._gameResolutionWidth;\n }\n\n /**\n * Get the game resolution (the size at which the game is played and rendered) height.\n * @returns The game resolution height, in pixels.\n */\n getGameResolutionHeight(): float {\n return this._gameResolutionHeight;\n }\n\n /**\n * Change the game resolution.\n *\n * @param width The new width\n * @param height The new height\n */\n setGameResolutionSize(width: float, height: float): void {\n this._gameResolutionWidth = width;\n this._gameResolutionHeight = height;\n if (this._adaptGameResolutionAtRuntime) {\n if (\n gdjs.RuntimeGameRenderer &&\n gdjs.RuntimeGameRenderer.getWindowInnerWidth &&\n gdjs.RuntimeGameRenderer.getWindowInnerHeight\n ) {\n const windowInnerWidth = gdjs.RuntimeGameRenderer.getWindowInnerWidth();\n const windowInnerHeight = gdjs.RuntimeGameRenderer.getWindowInnerHeight();\n\n // Enlarge either the width or the eight to fill the inner window space.\n if (this._resizeMode === 'adaptWidth') {\n this._gameResolutionWidth =\n (this._gameResolutionHeight * windowInnerWidth) /\n windowInnerHeight;\n } else {\n if (this._resizeMode === 'adaptHeight') {\n this._gameResolutionHeight =\n (this._gameResolutionWidth * windowInnerHeight) /\n windowInnerWidth;\n }\n }\n }\n } else {\n }\n\n // Don't alter the game resolution. The renderer\n // will maybe adapt the size of the canvas or whatever is used to render the\n // game in the window, but this does not change the \"game resolution\".\n\n // Notify the renderer that game resolution changed (so that the renderer size\n // can be updated, and maybe other things like the canvas size), and let the\n // scenes know too.\n this._renderer.updateRendererSize();\n this._notifyScenesForGameResolutionResize = true;\n }\n\n /**\n * Set if the width or the height of the game resolution\n * should be changed to fit the game window - or if the game\n * resolution should not be updated automatically.\n *\n * @param resizeMode Either \"\" (don't change game resolution), \"adaptWidth\" or \"adaptHeight\".\n */\n setGameResolutionResizeMode(resizeMode: string): void {\n this._resizeMode = resizeMode;\n this._forceGameResolutionUpdate();\n }\n\n /**\n * Returns if the width or the height of the game resolution\n * should be changed to fit the game window - or if the game\n * resolution should not be updated automatically (empty string).\n *\n * @returns Either \"\" (don't change game resolution), \"adaptWidth\" or \"adaptHeight\".\n */\n getGameResolutionResizeMode(): string {\n return this._resizeMode;\n }\n\n /**\n * Set if the game resolution should be automatically adapted\n * when the game window or screen size change. This will only\n * be the case if the game resolution resize mode is\n * configured to adapt the width or the height of the game.\n * @param enable true to change the game resolution according to the window/screen size.\n */\n setAdaptGameResolutionAtRuntime(enable: boolean): void {\n this._adaptGameResolutionAtRuntime = enable;\n this._forceGameResolutionUpdate();\n }\n\n /**\n * Returns if the game resolution should be automatically adapted\n * when the game window or screen size change. This will only\n * be the case if the game resolution resize mode is\n * configured to adapt the width or the height of the game.\n * @returns true if the game resolution is automatically changed according to the window/screen size.\n */\n getAdaptGameResolutionAtRuntime(): boolean {\n return this._adaptGameResolutionAtRuntime;\n }\n\n /**\n * Return the minimal fps that must be guaranteed by the game\n * (otherwise, game is slowed down).\n */\n getMinimalFramerate(): integer {\n return this._minFPS;\n }\n\n /**\n * Return the scale mode of the game (\"linear\" or \"nearest\").\n */\n getScaleMode(): 'linear' | 'nearest' {\n return this._scaleMode;\n }\n\n /**\n * Return if the game is rounding pixels when rendering.\n */\n getPixelsRounding(): boolean {\n return this._pixelsRounding;\n }\n\n /**\n * Return the antialiasing mode used by the game (\"none\" or \"MSAA\").\n */\n getAntialiasingMode(): 'none' | 'MSAA' {\n return this._antialiasingMode;\n }\n\n /**\n * Return true if antialising is enabled on mobiles.\n */\n isAntialisingEnabledOnMobile(): boolean {\n return this._isAntialisingEnabledOnMobile;\n }\n\n /**\n * Set or unset the game as paused.\n * When paused, the game won't step and will be freezed. Useful for debugging.\n * @param enable true to pause the game, false to unpause\n */\n pause(enable: boolean) {\n if (this._paused === enable) return;\n\n this._paused = enable;\n if (this._debuggerClient) {\n if (this._paused) this._debuggerClient.sendGamePaused();\n else this._debuggerClient.sendGameResumed();\n }\n }\n\n /**\n * @returns true during the first frame the game is back from being hidden.\n * This has nothing to do with `_paused`.\n */\n hasJustResumed() {\n return this._hasJustResumed;\n }\n\n /**\n * Load all assets, displaying progress in renderer.\n */\n loadAllAssets(callback: () => void, progressCallback?: (float) => void) {\n const loadingScreen = new gdjs.LoadingScreenRenderer(\n this.getRenderer(),\n this._imageManager,\n this._data.properties.loadingScreen\n );\n const allAssetsTotal = this._data.resources.resources.length;\n const that = this;\n\n // TODO: All the `loadXXX` (or `preloadXXX`) methods would be\n // better converted to return promises, for better readability of the code.\n // See how `loadBitmapFontData` is done.\n this._imageManager.loadTextures(\n function (count, total) {\n const percent = Math.floor((count / allAssetsTotal) * 100);\n loadingScreen.setPercent(percent);\n if (progressCallback) {\n progressCallback(percent);\n }\n },\n function (texturesTotalCount) {\n that._soundManager.preloadAudio(\n function (count, total) {\n const percent = Math.floor(\n ((texturesTotalCount + count) / allAssetsTotal) * 100\n );\n loadingScreen.setPercent(percent);\n if (progressCallback) {\n progressCallback(percent);\n }\n },\n function (audioTotalCount) {\n that._fontManager.loadFonts(\n function (count, total) {\n const percent = Math.floor(\n ((texturesTotalCount + audioTotalCount + count) /\n allAssetsTotal) *\n 100\n );\n loadingScreen.setPercent(percent);\n if (progressCallback) {\n progressCallback(percent);\n }\n },\n function (fontTotalCount) {\n that._jsonManager.preloadJsons(\n function (count, total) {\n const percent = Math.floor(\n ((texturesTotalCount +\n audioTotalCount +\n fontTotalCount +\n count) /\n allAssetsTotal) *\n 100\n );\n loadingScreen.setPercent(percent);\n if (progressCallback) {\n progressCallback(percent);\n }\n },\n function (jsonTotalCount) {\n that._model3DManager.loadModels(\n function (count, total) {\n const percent = Math.floor(\n ((texturesTotalCount +\n audioTotalCount +\n fontTotalCount +\n jsonTotalCount +\n count) /\n allAssetsTotal) *\n 100\n );\n loadingScreen.setPercent(percent);\n if (progressCallback) {\n progressCallback(percent);\n }\n },\n function (model3DTotalCount) {\n that._bitmapFontManager\n .loadBitmapFontData((count) => {\n var percent = Math.floor(\n ((texturesTotalCount +\n audioTotalCount +\n fontTotalCount +\n jsonTotalCount +\n model3DTotalCount +\n count) /\n allAssetsTotal) *\n 100\n );\n loadingScreen.setPercent(percent);\n if (progressCallback) progressCallback(percent);\n })\n .then(() => loadingScreen.unload())\n .then(() =>\n gdjs.getAllAsynchronouslyLoadingLibraryPromise()\n )\n .then(() => {\n callback();\n });\n }\n );\n }\n );\n }\n );\n }\n );\n }\n );\n }\n\n /**\n * Start the game loop, to be called once assets are loaded.\n */\n startGameLoop() {\n try {\n if (!this.hasScene()) {\n logger.error('The game has no scene.');\n return;\n }\n this._forceGameResolutionUpdate();\n\n // Load the first scene\n const firstSceneName = this._data.firstLayout;\n this._sceneStack.push(\n this.hasScene(firstSceneName)\n ? firstSceneName\n : // @ts-ignore - no risk of null object.\n this.getSceneData().name,\n this._injectExternalLayout\n );\n this._watermark.displayAtStartup();\n\n //Uncomment to profile the first x frames of the game.\n // var x = 500;\n // var startTime = Date.now();\n // console.profile(\"Stepping for \" + x + \" frames\")\n // for(var i = 0; i < x; ++i) {\n // this._sceneStack.step(16);\n // }\n // console.profileEnd();\n // var time = Date.now() - startTime;\n // logger.log(\"Took\", time, \"ms\");\n // return;\n\n this._setupGameVisibilityEvents();\n\n // The standard game loop\n const that = this;\n let accumulatedElapsedTime = 0;\n this._hasJustResumed = false;\n this._renderer.startGameLoop(function (lastCallElapsedTime) {\n if (that._paused) {\n return true;\n }\n\n // Skip the frame if we rendering frames too fast\n accumulatedElapsedTime += lastCallElapsedTime;\n if (\n that._maxFPS > 0 &&\n 1000.0 / accumulatedElapsedTime > that._maxFPS + 7\n ) {\n // Only skip frame if the framerate is 7 frames above the maximum framerate.\n // Most browser/engines will try to run at slightly more than 60 frames per second.\n // If game is set to have a maximum FPS to 60, then one out of two frames will be dropped.\n // Hence, we use a 7 frames margin to ensure that we're not skipping frames too much.\n return true;\n }\n const elapsedTime = accumulatedElapsedTime;\n accumulatedElapsedTime = 0;\n\n // Manage resize events.\n if (that._notifyScenesForGameResolutionResize) {\n that._sceneStack.onGameResolutionResized();\n that._notifyScenesForGameResolutionResize = false;\n }\n\n // Render and step the scene.\n if (that._sceneStack.step(elapsedTime)) {\n that.getInputManager().onFrameEnded();\n that._hasJustResumed = false;\n return true;\n }\n return false;\n });\n setTimeout(() => {\n this._setupSessionMetrics();\n }, 10000);\n } catch (e) {\n logger.error('Internal crash: ' + e);\n throw e;\n }\n }\n\n /**\n * Set if the session should be registered.\n */\n enableMetrics(enable: boolean): void {\n this._disableMetrics = !enable;\n if (enable) {\n this._setupSessionMetrics();\n }\n }\n\n _setupGameVisibilityEvents() {\n if (typeof navigator !== 'undefined' && typeof document !== 'undefined') {\n document.addEventListener('visibilitychange', () => {\n if (document.visibilityState === 'visible') {\n this._hasJustResumed = true;\n }\n });\n window.addEventListener(\n 'resume',\n () => {\n this._hasJustResumed = true;\n },\n false\n );\n }\n }\n\n /**\n * Register a new session for the game, and set up listeners to follow the session\n * time.\n */\n _setupSessionMetrics() {\n if (this._sessionMetricsInitialized) {\n return;\n }\n if (this._disableMetrics) {\n return;\n }\n if (this.isPreview()) {\n return;\n }\n if (typeof fetch === 'undefined') {\n return;\n }\n if (!this._data.properties.projectUuid) {\n return;\n }\n const baseUrl = 'https://api.gdevelop-app.com/analytics';\n this._playerId = this._makePlayerUuid();\n /**\n * The duration that is already sent to the service\n * (in milliseconds).\n **/\n let sentDuration = 0;\n /**\n * The duration that is not yet sent to the service to avoid flooding\n * (in milliseconds).\n **/\n let notYetSentDuration = 0;\n /**\n * The last time when duration has been counted\n * either in sendedDuration or notYetSentDuration.\n **/\n let lastSessionResumeTime = Date.now();\n fetch(baseUrl + '/session', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n // It's important to ensure that the data sent here does not contain\n // any personal information from the player or that would allow to\n // precisely identify someone.\n body: JSON.stringify({\n gameId: this._data.properties.projectUuid,\n playerId: this._playerId,\n game: {\n name: this._data.properties.name || '',\n packageName: this._data.properties.packageName || '',\n version: this._data.properties.version || '',\n location: window.location.href,\n },\n platform: {\n // @ts-ignore\n isCordova: !!window.cordova,\n devicePlatform:\n // @ts-ignore\n typeof device !== 'undefined' ? device.platform || '' : '',\n navigatorPlatform:\n typeof navigator !== 'undefined' ? navigator.platform : '',\n hasTouch:\n typeof navigator !== 'undefined'\n ? !!navigator.maxTouchPoints && navigator.maxTouchPoints > 2\n : false,\n },\n }),\n })\n .then((response) => {\n // Ensure the session is correctly created to avoid sending hits that will fail.\n if (!response.ok) {\n console.error('Error while creating the session', response);\n throw new Error('Error while creating the session');\n }\n return response;\n })\n .then((response) => response.text())\n .then((returnedSessionId) => {\n this._sessionId = returnedSessionId;\n })\n .catch(() => {});\n\n /* Ignore any error */\n const sendSessionHit = () => {\n if (!this._sessionId) {\n return;\n }\n\n const now = Date.now();\n notYetSentDuration += now - lastSessionResumeTime;\n lastSessionResumeTime = now;\n\n // Group repeated calls to sendSessionHit - which could\n // happen because of multiple event listeners being fired.\n if (notYetSentDuration < 5 * 1000) {\n return;\n }\n // The backend use seconds for duration.\n // The milliseconds will stay in notYetSentDuration.\n const toBeSentDuration = Math.floor(notYetSentDuration / 1000) * 1000;\n sentDuration += toBeSentDuration;\n notYetSentDuration -= toBeSentDuration;\n\n navigator.sendBeacon(\n baseUrl + '/session-hit',\n JSON.stringify({\n gameId: this._data.properties.projectUuid,\n playerId: this._playerId,\n sessionId: this._sessionId,\n duration: Math.floor(sentDuration / 1000),\n })\n );\n };\n if (typeof navigator !== 'undefined' && typeof document !== 'undefined') {\n document.addEventListener('visibilitychange', () => {\n if (document.visibilityState === 'visible') {\n // Skip the duration the game was hidden.\n lastSessionResumeTime = Date.now();\n } else {\n sendSessionHit();\n }\n });\n window.addEventListener('pagehide', sendSessionHit, false);\n // Cordova events\n window.addEventListener('pause', sendSessionHit, false);\n window.addEventListener(\n 'resume',\n () => {\n // Skip the duration the game was hidden.\n lastSessionResumeTime = Date.now();\n },\n false\n );\n\n // Detect Safari to work around Safari-specific bugs:\n // - https://bugs.webkit.org/show_bug.cgi?id=151610\n // - https://bugs.webkit.org/show_bug.cgi?id=151234\n // @ts-ignore\n const isSafari = typeof safari === 'object' && safari.pushNotification;\n const isElectron = /electron/i.test(navigator.userAgent);\n if (isSafari || isElectron) {\n window.addEventListener('beforeunload', () => {\n sendSessionHit();\n });\n }\n }\n this._sessionMetricsInitialized = true;\n this._sessionId = this._sessionId;\n }\n\n /**\n * Generate an anonymous unique identifier to differentiate\n * the player from others in the game metrics.\n */\n _makePlayerUuid(): string {\n try {\n const key = 'GDJS-internal-player-uuid';\n const existingPlayerUuid = localStorage.getItem(key);\n if (existingPlayerUuid) {\n return existingPlayerUuid;\n }\n const newPlayerUuid = gdjs.makeUuid();\n localStorage.setItem(key, newPlayerUuid);\n return newPlayerUuid;\n } catch (err) {\n return gdjs.makeUuid();\n }\n }\n\n getSessionId(): string | null {\n return this._sessionId;\n }\n\n getPlayerId(): string | null {\n return this._playerId;\n }\n\n /**\n * Called by the game renderer when the window containing the game\n * has changed size (this can result from a resize of the window,\n * but also other factors like a device orientation change on mobile).\n */\n onWindowInnerSizeChanged() {\n this._forceGameResolutionUpdate();\n }\n\n /**\n * Enlarge/reduce the width (or the height) of the game to fill the inner window.\n */\n _forceGameResolutionUpdate() {\n this.setGameResolutionSize(\n this._gameResolutionWidth,\n this._gameResolutionHeight\n );\n }\n\n /**\n * Start a profiler for the currently running scene.\n * @param onProfilerStopped Function to be called when the profiler is stopped. Will be passed the profiler as argument.\n */\n startCurrentSceneProfiler(\n onProfilerStopped: (oldProfiler: Profiler) => void\n ) {\n const currentScene = this._sceneStack.getCurrentScene();\n if (!currentScene) {\n return false;\n }\n currentScene.startProfiler(onProfilerStopped);\n return true;\n }\n\n /**\n * Stop the profiler for the currently running scene.\n */\n stopCurrentSceneProfiler() {\n const currentScene = this._sceneStack.getCurrentScene();\n if (!currentScene) {\n return;\n }\n currentScene.stopProfiler();\n }\n\n /**\n * Return true if a scene was loaded, false otherwise (i.e: game not yet started).\n */\n wasFirstSceneLoaded(): boolean {\n return this._sceneStack.wasFirstSceneLoaded();\n }\n\n /**\n * Return the stack of {@link gdjs.RuntimeScene} being played.\n */\n getSceneStack(): gdjs.SceneStack {\n return this._sceneStack;\n }\n\n /**\n * Check if the game is running as a preview, launched from an editor.\n * @returns true if the current game is a preview.\n */\n isPreview(): boolean {\n return this._isPreview;\n }\n\n /**\n * Check if the game should call GDevelop development APIs or not.\n *\n * Unless you are contributing to GDevelop, avoid using this.\n */\n isUsingGDevelopDevelopmentEnvironment(): boolean {\n return this._options.environment === 'dev';\n }\n\n /**\n * Gets an extension property from the project data.\n * @param extensionName The extension name.\n * @param propertyName The property name.\n * @return The property value.\n */\n getExtensionProperty(\n extensionName: string,\n propertyName: string\n ): string | null {\n for (let property of this._data.properties.extensionProperties) {\n if (\n property.extension === extensionName &&\n property.property === propertyName\n ) {\n return property.value;\n }\n }\n return null;\n }\n\n /**\n * Resolves the name of an embedded resource.\n * @param mainResourceName The name of the resource containing the embedded resource.\n * @param embeddedResourceName The name of the embedded resource.\n * @return The resource name.\n */\n resolveEmbeddedResource(\n mainResourceName: string,\n embeddedResourceName: string\n ): string {\n const mapping = this._embeddedResourcesMappings.get(mainResourceName);\n return mapping && mapping[embeddedResourceName]\n ? mapping[embeddedResourceName]\n : embeddedResourceName;\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAKA,IAAU,MAAAA,GAAV,CACE,MAAMC,EAAS,IAAID,EAAK,OAAO,cAAc,EA2DvCE,EAA0B,CAC9BC,EACAC,EACAC,IACG,CACH,GAAIF,EAAI,WAAW,OAAO,GAAKA,EAAI,WAAW,OAAO,EAEnD,OAAOA,EAGT,MAAMG,EAAYH,EAAI,QAAQ,GAAG,IAAM,GAAK,IAAM,IAClD,OAAOA,EAAMG,EAAYF,EAA0B,IAAMC,CAC3D,EAEME,EAAmCJ,GAErCA,EAAI,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BACEC,EACAC,EACe,CACf,QAASC,KAAY,KAAK,MAAM,WAAW,oBACzC,GACEA,EAAS,YAAcF,GACvBE,EAAS,WAAaD,EAEtB,OAAOC,EAAS,MAGpB,OAAO,IACT,CAQA,wBACEC,EACAC,EACQ,CACR,MAAMC,EAAU,KAAK,2BAA2B,IAAIF,CAAgB,EACpE,OAAOE,GAAWA,EAAQD,CAAoB,EAC1CC,EAAQD,CAAoB,EAC5BA,CACN,CACF,CApiCOzE,EAAM,YAAAW,IAhIL",
|
|
6
|
+
"names": ["gdjs", "logger", "addSearchParameterToUrl", "url", "urlEncodedParameterName", "urlEncodedValue", "separator", "checkIfIsGDevelopCloudBucketUrl", "RuntimeGameResourcesLoader", "runtimeGame", "gdevelopResourceToken", "RuntimeGame", "data", "options", "resource", "metadata", "extension", "eventsBasedObject", "projectData", "type", "eventsBasedObjectData", "sceneName", "scene", "i", "len", "sceneData", "isTrue", "name", "externalLayout", "layoutData", "width", "height", "windowInnerWidth", "windowInnerHeight", "resizeMode", "enable", "callback", "progressCallback", "loadingScreen", "allAssetsTotal", "that", "count", "total", "percent", "texturesTotalCount", "audioTotalCount", "fontTotalCount", "jsonTotalCount", "model3DTotalCount", "firstSceneName", "accumulatedElapsedTime", "lastCallElapsedTime", "elapsedTime", "baseUrl", "sentDuration", "notYetSentDuration", "lastSessionResumeTime", "response", "returnedSessionId", "sendSessionHit", "now", "toBeSentDuration", "isSafari", "isElectron", "key", "existingPlayerUuid", "newPlayerUuid", "onProfilerStopped", "currentScene", "extensionName", "propertyName", "property", "mainResourceName", "embeddedResourceName", "mapping"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var gdjs;(n=>{const y=(p,e,t,i)=>{const s=Math.max(t,p-t),r=Math.max(i,e-i);return Math.pow(s,2)+Math.pow(r,2)},x={moveXArray:[],moveYArray:[]},D={result:n.Polygon.makeNewRaycastTestResult()},_=(p,e,t)=>{if(e.length===0)return e.length=0,t.length=0,!1;if(e.length===1)return p.setPosition(p.getX()+e[0],p.getY()+t[0]),e.length=0,t.length=0,!0;let i=0,s=0;for(let b=0;b<e.length;b++){const C=e[b],d=t[b],A=C*C+d*d;A>i&&(i=A,s=b)}const r=Math.sqrt(i),a=e[s]/r,c=-(t[s]/r),g=a;let f=0,h=0;for(let b=0;b<e.length;b++){const C=e[b],d=t[b],A=C*c+d*g;f=Math.min(f,A),h=Math.max(h,A)}let u=e[s],m=t[s];const v=-f<h/1048576,B=h<-f/1048576;return v!==B&&(B?(u+=f*c,m+=f*g):(u+=h*c,m+=h*g)),p.setPosition(p.getX()+u,p.getY()+m),e.length=0,t.length=0,!0};class o{name;type;x=0;y=0;angle=0;zOrder=0;hidden=!1;layer="";_nameId;_livingOnScene=!0;id;destroyCallbacks=new Set;_runtimeScene;persistentUuid=null;pick=!1;_defaultHitBoxes=[];hitBoxes;hitBoxesDirty=!0;aabb={min:[0,0],max:[0,0]};_isIncludedInParentCollisionMask=!0;_variables;_rendererEffects={};_forces=[];_averageForce;_behaviors=[];_behaviorsTable;_timers;constructor(e,t){this.name=t.name||"",this.type=t.type||"",this._nameId=o.getNameIdentifier(this.name),this.id=e.getScene().createNewUniqueId(),this._runtimeScene=e,this._defaultHitBoxes.push(n.Polygon.createRectangle(0,0)),this.hitBoxes=this._defaultHitBoxes,this._variables=new n.VariablesContainer(t?t.variables:void 0),this._averageForce=new n.Force(0,0,0),this._behaviorsTable=new Hashtable;for(let i=0;i<t.effects.length;++i)this._runtimeScene.getGame().getEffectsManager().initializeEffect(t.effects[i],this._rendererEffects,this),this.updateAllEffectParameters(t.effects[i]);for(let i=0,s=t.behaviors.length;i<s;++i){const r=t.behaviors[i],a=n.getBehaviorConstructor(r.type);this._behaviors.push(new a(e,r,this)),this._behaviorsTable.put(r.name,this._behaviors[i])}this._timers=new Hashtable}onCreated(){if(this.getRendererObject())for(const t in this._rendererEffects)this._rendererEffects[t].applyEffect(this);for(let t=0;t<this._behaviors.length;++t)this._behaviors[t].onCreated()}reinitialize(e){const t=this._runtimeScene;this.x=0,this.y=0,this.angle=0,this.zOrder=0,this.hidden=!1,this.layer="",this._livingOnScene=!0,this.id=t.createNewUniqueId(),this.persistentUuid=null,this.pick=!1,this.hitBoxesDirty=!0,this._defaultHitBoxes.length=0,this._defaultHitBoxes.push(n.Polygon.createRectangle(0,0)),this.aabb.min[0]=0,this.aabb.min[1]=0,this.aabb.max[0]=0,this.aabb.max[1]=0,this._variables=new n.VariablesContainer(e.variables),this.clearForces(),this._behaviorsTable.clear();let i=0;for(const s=e.behaviors.length;i<s;++i){const r=e.behaviors[i],a=n.getBehaviorConstructor(r.type);i<this._behaviors.length?this._behaviors[i]=new a(t,r,this):this._behaviors.push(new a(t,r,this)),this._behaviorsTable.put(r.name,this._behaviors[i])}this._behaviors.length=i;for(let s=0;s<e.effects.length;++s)this._runtimeScene.getGame().getEffectsManager().initializeEffect(e.effects[s],this._rendererEffects,this),this.updateAllEffectParameters(e.effects[s]);this._timers.clear(),this.destroyCallbacks.clear(),this.invalidateHitboxes()}static supportsReinitialization=!1;getElapsedTime(e){return this._runtimeScene.getLayer(this.layer).getElapsedTime()}getParent(){return this._runtimeScene}getRuntimeScene(){return this._runtimeScene.getScene()}getInstanceContainer(){return this._runtimeScene}update(e){}updatePreRender(e){}extraInitializationFromInitialInstance(e){}updateFromObjectData(e,t){return!1}deleteFromScene(e){this._livingOnScene&&(e.markObjectForDeletion(this),this._livingOnScene=!1)}registerDestroyCallback(e){this.destroyCallbacks.add(e)}unregisterDestroyCallback(e){this.destroyCallbacks.delete(e)}onDestroyFromScene(e){const t=e.getLayer(this.layer),i=this.getRendererObject();i&&t.getRenderer().removeRendererObject(i);const s=this.get3DRendererObject();s&&t.getRenderer().remove3DRendererObject(s);for(let r=0,a=this._behaviors.length;r<a;++r)this._behaviors[r].onDestroy();this.destroyCallbacks.forEach(r=>r()),this.clearEffects()}onScenePaused(e){}onSceneResumed(e){}getRendererObject(){}get3DRendererObject(){}getName(){return this.name}getNameId(){return this._nameId}getUniqueId(){return this.id}setPosition(e,t){this.setX(e),this.setY(t)}setX(e){e!==this.x&&(this.x=e,this.invalidateHitboxes())}invalidateHitboxes(){this.hitBoxesDirty=!0,this._runtimeScene.onChildrenLocationChanged()}getX(){return this.x}setY(e){e!==this.y&&(this.y=e,this.invalidateHitboxes())}getY(){return this.y}getDrawableX(){return this.getX()}getDrawableY(){return this.getY()}rotateTowardPosition(e,t,i,s){this.rotateTowardAngle(n.toDegrees(Math.atan2(t-(this.getDrawableY()+this.getCenterY()),e-(this.getDrawableX()+this.getCenterX()))),i,s)}rotateTowardAngle(e,t,i){if(t===0){this.setAngle(e);return}const r=n.evtTools.common.angleDifference(this.getAngle(),e)>=0;let a=this.getAngle()+(r?-1:1)*t*this.getElapsedTime()/1e3;n.evtTools.common.angleDifference(a,e)>0^r&&(a=e),this.setAngle(a),this.getAngle()!==a&&this.setAngle(e)}rotate(e,t){this.setAngle(this.getAngle()+e*this.getElapsedTime()/1e3)}setAngle(e){this.angle!==e&&(this.angle=e,this.invalidateHitboxes())}getAngle(){return this.angle}setLayer(e){if(e===this.layer)return;const t=this._runtimeScene.getLayer(this.layer);this.layer=e;const i=this._runtimeScene.getLayer(this.layer),s=this.getRendererObject();s&&(t.getRenderer().removeRendererObject(s),i.getRenderer().addRendererObject(s,this.zOrder));const r=this.get3DRendererObject();r&&(t.getRenderer().remove3DRendererObject(r),i.getRenderer().add3DRendererObject(r))}getLayer(){return this.layer}isOnLayer(e){return this.layer===e}setZOrder(e){if(e===this.zOrder)return;this.zOrder=e;const t=this.getRendererObject();t&&this._runtimeScene.getLayer(this.layer).getRenderer().changeRendererObjectZOrder(t,e)}getZOrder(){return this.zOrder}getVariables(){return this._variables}static getVariableNumber(e){return e.getAsNumber()}static returnVariable(e){return e}static getVariableString(e){return e.getAsString()}static setVariableBoolean=function(e,t){e.setBoolean(t)};static getVariableBoolean=function(e,t){return n.evtTools.common.getVariableBoolean(e,t)};static toggleVariableBoolean=function(e){n.evtTools.common.toggleVariableBoolean(e)};static getVariableChildCount(e){return e.getChildrenCount()}static setVariableNumber(e,t){e.setNumber(t)}static setVariableString(e,t){e.setString(t)}static variableChildExists(e,t){return e.hasChild(t)}static variableRemoveChild(e,t){e.removeChild(t)}static variableClearChildren(e){e.clearChildren()}static variablePushCopy=function(e,t){e.pushVariableCopy(t)};static valuePush=function(e,t){e.pushValue(t)};static variableRemoveAt=function(e,t){e.removeAtIndex(t)};static getFirstVariableString=function(e){return e.getChildrenCount()===0?"":e.getAllChildrenArray()[0].getAsString()};static getFirstVariableNumber=function(e){return e.getChildrenCount()===0?0:e.getAllChildrenArray()[0].getAsNumber()};static getLastVariableString=function(e){const t=e.getAllChildrenArray();return t.length===0?"":t[t.length-1].getAsString()};static getLastVariableNumber=function(e){const t=e.getAllChildrenArray();return t.length===0?0:t[t.length-1].getAsNumber()};hasVariable(e){return this._variables.has(e)}getRendererEffects(){return this._rendererEffects}addEffect(e){return this.getRendererObject()?this._runtimeScene.getGame().getEffectsManager().addEffect(e,this._rendererEffects,this):!1}removeEffect(e){return this.getRendererObject()?this._runtimeScene.getGame().getEffectsManager().removeEffect(this._rendererEffects,this,e):!1}clearEffects(){const e=this.getRendererObject();return e?(this._rendererEffects={},this._runtimeScene.getGame().getEffectsManager().clearEffects(e)):!1}setEffectDoubleParameter(e,t,i){return this._runtimeScene.getGame().getEffectsManager().setEffectDoubleParameter(this._rendererEffects,e,t,i)}setEffectStringParameter(e,t,i){return this._runtimeScene.getGame().getEffectsManager().setEffectStringParameter(this._rendererEffects,e,t,i)}setEffectBooleanParameter(e,t,i){return this._runtimeScene.getGame().getEffectsManager().setEffectBooleanParameter(this._rendererEffects,e,t,i)}updateAllEffectParameters(e){return this._runtimeScene.getGame().getEffectsManager().updateAllEffectParameters(this._rendererEffects,e)}enableEffect(e,t){this._runtimeScene.getGame().getEffectsManager().enableEffect(this._rendererEffects,this,e,t)}isEffectEnabled(e){return this._runtimeScene.getGame().getEffectsManager().isEffectEnabled(this._rendererEffects,this,e)}hasEffect(e){return this._runtimeScene.getGame().getEffectsManager().hasEffect(this._rendererEffects,e)}hide(e){e===void 0&&(e=!0),this.hidden=e}isVisible(){return!this.hidden}isHidden(){return this.hidden}setWidth(e){}setHeight(e){}getWidth(){return 0}getHeight(){return 0}getCenterX(){return this.getWidth()/2}getCenterY(){return this.getHeight()/2}getCenterXInScene(){return this.getDrawableX()+this.getCenterX()}getCenterYInScene(){return this.getDrawableY()+this.getCenterY()}setCenterPositionInScene(e,t){this.setX(e+this.x-(this.getDrawableX()+this.getCenterX())),this.setY(t+this.y-(this.getDrawableY()+this.getCenterY()))}setCenterXInScene(e){this.setX(e+this.x-(this.getDrawableX()+this.getCenterX()))}setCenterYInScene(e){this.setY(e+this.y-(this.getDrawableY()+this.getCenterY()))}_getRecycledForce(e,t,i){if(o.forcesGarbage.length===0)return new n.Force(e,t,i);{const s=o.forcesGarbage.pop();return s.setX(e),s.setY(t),s.setMultiplier(i),s}}addForce(e,t,i){this._forces.push(this._getRecycledForce(e,t,i))}addPolarForce(e,t,i){const s=n.toRad(e),r=Math.cos(s)*t,a=Math.sin(s)*t;this._forces.push(this._getRecycledForce(r,a,i))}addForceTowardPosition(e,t,i,s){const r=Math.atan2(t-(this.getDrawableY()+this.getCenterY()),e-(this.getDrawableX()+this.getCenterX())),a=Math.cos(r)*i,l=Math.sin(r)*i;this._forces.push(this._getRecycledForce(a,l,s))}addForceTowardObject(e,t,i){e!=null&&this.addForceTowardPosition(e.getDrawableX()+e.getCenterX(),e.getDrawableY()+e.getCenterY(),t,i)}clearForces(){o.forcesGarbage.push.apply(o.forcesGarbage,this._forces),this._forces.length=0}hasNoForces(){return this._forces.length===0}updateForces(e){for(let t=0;t<this._forces.length;){const i=this._forces[t],s=i.getMultiplier();s===1?++t:s===0||i.getLength()<=.001?(o.forcesGarbage.push(i),this._forces.splice(t,1)):(i.setLength(i.getLength()-i.getLength()*(1-s)*e),++t)}}getAverageForce(){let e=0,t=0;for(let i=0,s=this._forces.length;i<s;++i)e+=this._forces[i].getX(),t+=this._forces[i].getY();return this._averageForce.setX(e),this._averageForce.setY(t),this._averageForce}averageForceAngleIs(e,t){let i=this.getAverageForce().getAngle();return i<0&&(i+=360),Math.abs(e-i)<t/2}getHitBoxes(){return this.hitBoxesDirty&&(this.updateHitBoxes(),this.updateAABB(),this.hitBoxesDirty=!1),this.hitBoxes}getHitBoxesAround(e,t,i,s){return this.getHitBoxes()}updateHitBoxes(){this.hitBoxes=this._defaultHitBoxes;const e=this.getWidth(),t=this.getHeight(),i=this.getCenterX(),s=this.getCenterY();i===e/2&&s===t/2?(this.hitBoxes[0].vertices[0][0]=-i,this.hitBoxes[0].vertices[0][1]=-s,this.hitBoxes[0].vertices[1][0]=+i,this.hitBoxes[0].vertices[1][1]=-s,this.hitBoxes[0].vertices[2][0]=+i,this.hitBoxes[0].vertices[2][1]=+s,this.hitBoxes[0].vertices[3][0]=-i,this.hitBoxes[0].vertices[3][1]=+s):(this.hitBoxes[0].vertices[0][0]=0-i,this.hitBoxes[0].vertices[0][1]=0-s,this.hitBoxes[0].vertices[1][0]=e-i,this.hitBoxes[0].vertices[1][1]=0-s,this.hitBoxes[0].vertices[2][0]=e-i,this.hitBoxes[0].vertices[2][1]=t-s,this.hitBoxes[0].vertices[3][0]=0-i,this.hitBoxes[0].vertices[3][1]=t-s),this.hitBoxes[0].rotate(n.toRad(this.getAngle())),this.hitBoxes[0].move(this.getDrawableX()+i,this.getDrawableY()+s)}isIncludedInParentCollisionMask(){return this._isIncludedInParentCollisionMask}setIncludedInParentCollisionMask(e){const t=this._isIncludedInParentCollisionMask;this._isIncludedInParentCollisionMask=e,t!==e&&this._runtimeScene.onChildrenLocationChanged()}getAABB(){return this.hitBoxesDirty&&(this.updateHitBoxes(),this.updateAABB(),this.hitBoxesDirty=!1),this.aabb}getVisibilityAABB(){return this.getAABB()}updateAABB(){if(this.getAngle()===0)this.aabb.min[0]=this.getDrawableX(),this.aabb.min[1]=this.getDrawableY(),this.aabb.max[0]=this.aabb.min[0]+this.getWidth(),this.aabb.max[1]=this.aabb.min[1]+this.getHeight();else{let e=!0;for(let t=0;t<this.hitBoxes.length;t++)for(let i=0;i<this.hitBoxes[t].vertices.length;i++){const s=this.hitBoxes[t].vertices[i];e?(this.aabb.min[0]=s[0],this.aabb.max[0]=s[0],this.aabb.min[1]=s[1],this.aabb.max[1]=s[1],e=!1):(this.aabb.min[0]=Math.min(this.aabb.min[0],s[0]),this.aabb.max[0]=Math.max(this.aabb.max[0],s[0]),this.aabb.min[1]=Math.min(this.aabb.min[1],s[1]),this.aabb.max[1]=Math.max(this.aabb.max[1],s[1]))}}}getAABBLeft(){return this.getAABB().min[0]}getAABBTop(){return this.getAABB().min[1]}getAABBRight(){return this.getAABB().max[0]}getAABBBottom(){return this.getAABB().max[1]}getAABBCenterX(){return this.getAABB().min[0]/2+this.getAABB().max[0]/2}getAABBCenterY(){return this.getAABB().min[1]/2+this.getAABB().max[1]/2}stepBehaviorsPreEvents(e){for(let t=0,i=this._behaviors.length;t<i;++t)this._behaviors[t].stepPreEvents(e)}stepBehaviorsPostEvents(e){for(let t=0,i=this._behaviors.length;t<i;++t)this._behaviors[t].stepPostEvents(e)}notifyBehaviorsObjectHotReloaded(){for(let e=0,t=this._behaviors.length;e<t;++e)this._behaviors[e].onObjectHotReloaded()}getBehavior(e){return this._behaviorsTable.get(e)}hasBehavior(e){return this._behaviorsTable.containsKey(e)}activateBehavior(e,t){this._behaviorsTable.containsKey(e)&&this._behaviorsTable.get(e).activate(t)}behaviorActivated(e){return this._behaviorsTable.containsKey(e)?this._behaviorsTable.get(e).activated():!1}removeBehavior(e){const t=this._behaviorsTable.get(e);if(!t)return!1;t.onDestroy();const i=this._behaviors.indexOf(t);return i!==-1&&this._behaviors.splice(i,1),this._behaviorsTable.remove(e),!0}addNewBehavior(e){const t=n.getBehaviorConstructor(e.type);if(!t)return!1;const i=new t(this._runtimeScene,e,this);return this._behaviors.push(i),this._behaviorsTable.put(e.name,i),!0}updateTimers(e){for(const t in this._timers.items)this._timers.items.hasOwnProperty(t)&&this._timers.items[t].updateTime(e)}timerElapsedTime(e,t){return this._timers.containsKey(e)?this.getTimerElapsedTimeInSeconds(e)>=t:(this._timers.put(e,new n.Timer(e)),!1)}timerPaused(e){return this._timers.containsKey(e)?this._timers.get(e).isPaused():!1}resetTimer(e){this._timers.containsKey(e)||this._timers.put(e,new n.Timer(e)),this._timers.get(e).reset()}pauseTimer(e){this._timers.containsKey(e)||this._timers.put(e,new n.Timer(e)),this._timers.get(e).setPaused(!0)}unpauseTimer(e){this._timers.containsKey(e)||this._timers.put(e,new n.Timer(e)),this._timers.get(e).setPaused(!1)}removeTimer(e){this._timers.containsKey(e)&&this._timers.remove(e)}getTimerElapsedTimeInSeconds(e){return this._timers.containsKey(e)?this._timers.get(e).getTime()/1e3:0}getTimerElapsedTimeInSecondsOrNaN(e){return this._timers.containsKey(e)?this._timers.get(e).getTime()/1e3:Number.NaN}separateFromObjects(e,t){let i=x.moveXArray,s=x.moveYArray;i.length=0,s.length=0;const r=this.getHitBoxes();let a=null;for(const l of e){if(l.id===this.id)continue;let c=l.getHitBoxes(),g=c;c.length>4&&(a||(a=this.getAABB()),g=l.getHitBoxesAround(a.min[0],a.min[1],a.max[0],a.max[1]));for(const f of r)for(const h of g){const u=n.Polygon.collisionTest(f,h,t);u.collision&&(i.push(u.move_axis[0]),s.push(u.move_axis[1]))}}return _(this,i,s)}separateFromObjectsList(e,t){let i=x.moveXArray,s=x.moveYArray;i.length=0,s.length=0;const r=this.getHitBoxes();let a=null;for(const l in e.items)if(e.items.hasOwnProperty(l)){const c=e.items[l];for(const g of c){if(g.id===this.id)continue;let f=g.getHitBoxes(),h=f;f.length>4&&(a||(a=this.getAABB()),h=g.getHitBoxesAround(a.min[0],a.min[1],a.max[0],a.max[1]));for(const u of r)for(const m of h){const v=n.Polygon.collisionTest(u,m,t);v.collision&&(i.push(v.move_axis[0]),s.push(v.move_axis[1]))}}}return _(this,i,s)}getDistanceToObject(e){return Math.sqrt(this.getSqDistanceToObject(e))}getSqDistanceToObject(e){if(e===null)return 0;const t=this.getDrawableX()+this.getCenterX()-(e.getDrawableX()+e.getCenterX()),i=this.getDrawableY()+this.getCenterY()-(e.getDrawableY()+e.getCenterY());return t*t+i*i}getDistanceToPosition(e,t){return Math.sqrt(this.getSqDistanceToPosition(e,t))}getSqDistanceToPosition(e,t){const i=this.getDrawableX()+this.getCenterX()-e,s=this.getDrawableY()+this.getCenterY()-t;return i*i+s*s}getAngleToObject(e){if(e===null)return 0;const t=this.getDrawableX()+this.getCenterX()-(e.getDrawableX()+e.getCenterX()),i=this.getDrawableY()+this.getCenterY()-(e.getDrawableY()+e.getCenterY());return n.toDegrees(Math.atan2(-i,-t))}getXFromAngleAndDistance(e,t){return this.getDrawableX()+this.getCenterX()+t*Math.cos(n.toRad(e))}getYFromAngleAndDistance(e,t){return this.getDrawableY()+this.getCenterY()+t*Math.sin(n.toRad(e))}getAngleToPosition(e,t){const i=this.getDrawableX()+this.getCenterX()-e,s=this.getDrawableY()+this.getCenterY()-t;return n.toDegrees(Math.atan2(-s,-i))}putAround(e,t,i,s){const r=n.toRad(s);this.setCenterXInScene(e+Math.cos(r)*i),this.setCenterYInScene(t+Math.sin(r)*i)}putAroundObject(e,t,i){this.putAround(e.getDrawableX()+e.getCenterX(),e.getDrawableY()+e.getCenterY(),t,i)}separateObjectsWithoutForces(e){const t=n.staticArray(o.prototype.separateObjectsWithoutForces);t.length=0;const i=n.staticArray2(o.prototype.separateObjectsWithoutForces);e.values(i);for(let s=0,r=i.length;s<r;++s)t.push.apply(t,i[s]);for(let s=0,r=t.length;s<r;++s)t[s].id!=this.id&&(this.getDrawableX()<t[s].getDrawableX()?this.setX(t[s].getDrawableX()-this.getWidth()):this.getDrawableX()+this.getWidth()>t[s].getDrawableX()+t[s].getWidth()&&this.setX(t[s].getDrawableX()+t[s].getWidth()),this.getDrawableY()<t[s].getDrawableY()?this.setY(t[s].getDrawableY()-this.getHeight()):this.getDrawableY()+this.getHeight()>t[s].getDrawableY()+t[s].getHeight()&&this.setY(t[s].getDrawableY()+t[s].getHeight()))}separateObjectsWithForces(e){const t=n.staticArray(o.prototype.separateObjectsWithForces);t.length=0;const i=n.staticArray2(o.prototype.separateObjectsWithForces);e.values(i);for(let s=0,r=i.length;s<r;++s)t.push.apply(t,i[s]);for(let s=0,r=t.length;s<r;++s)if(t[s].id!=this.id){if(this.getDrawableX()+this.getCenterX()<t[s].getDrawableX()+t[s].getCenterX()){let a=this.hasNoForces()?0:this.getAverageForce().getX();this.addForce(-a-10,0,0)}else{let a=this.hasNoForces()?0:this.getAverageForce().getX();this.addForce(-a+10,0,0)}if(this.getDrawableY()+this.getCenterY()<t[s].getDrawableY()+t[s].getCenterY()){let a=this.hasNoForces()?0:this.getAverageForce().getY();this.addForce(0,-a-10,0)}else{let a=this.hasNoForces()?0:this.getAverageForce().getY();this.addForce(0,-a+10,0)}}}static collisionTest(e,t,i){const s=e.getCenterX(),r=e.getCenterY(),a=Math.sqrt(y(e.getWidth(),e.getHeight(),s,r)),l=t.getCenterX(),c=t.getCenterY(),g=Math.sqrt(y(t.getWidth(),t.getHeight(),l,c)),f=e.getDrawableX()+s,h=e.getDrawableY()+r,u=t.getDrawableX()+l,m=t.getDrawableY()+c,v=f-u,B=h-m;if(Math.sqrt(v*v+B*B)>a+g)return!1;const b=e.getHitBoxesAround(u-g,m-g,u+g,m+g),C=t.getHitBoxesAround(f-a,h-a,f+a,h+a);for(const d of b)for(const A of C)if(n.Polygon.collisionTest(d,A,i).collision)return!0;return!1}raycastTest(e,t,i,s,r){const a=this.getCenterX(),l=this.getCenterY(),c=y(this.getWidth(),this.getHeight(),a,l),g=(e+i)/2,f=(t+s)/2,h=(i-e)*(i-e)+(s-t)*(s-t),u=this.getDrawableX()+a-g,m=this.getDrawableY()+l-f;let v=D.result;if(v.collision=!1,u*u+m*m>c+h+2*Math.sqrt(h*c))return v;if(r){let B=Number.MAX_VALUE;const b=this.getHitBoxesAround(e,t,i,s);for(const C of b){const d=n.Polygon.raycastTest(C,e,t,i,s);d.collision&&d.closeSqDist<B&&(B=d.closeSqDist,n.Polygon.copyRaycastTestResult(d,v))}}else{let B=-Number.MAX_VALUE;const b=this.getHitBoxesAround(e,t,i,s);for(const C of b){const d=n.Polygon.raycastTest(C,e,t,i,s);d.collision&&d.farSqDist>B&&d.farSqDist<=h&&(B=d.farSqDist,n.Polygon.copyRaycastTestResult(d,v))}}return v}insideObject(e,t){return this.hitBoxesDirty&&(this.updateHitBoxes(),this.updateAABB(),this.hitBoxesDirty=!1),this.aabb.min[0]<=e&&this.aabb.max[0]>=e&&this.aabb.min[1]<=t&&this.aabb.max[1]>=t}static distanceTest(e,t,i){return e.getSqDistanceToObject(t)<=i}cursorOnObject(e){const t=n.staticArray(o.prototype.cursorOnObject);t.length=2;const i=e.getGame().getInputManager(),s=e.getLayer(this.layer),r=s.convertCoords(i.getCursorX(),i.getCursorY(),0,t);if(this.insideObject(r[0],r[1]))return!0;const a=i.getAllTouchIdentifiers();for(let l=0;l<a.length;++l){const c=s.convertCoords(i.getTouchX(a[l]),i.getTouchY(a[l]),0,t);if(this.insideObject(c[0],c[1]))return!0}return!1}isCollidingWithPoint(e,t){const i=this.getHitBoxesAround(e,t,e,t);for(const s of i)if(n.Polygon.isPointInside(s,e,t))return!0;return!1}static getNameIdentifier(e){if(o._identifiers.containsKey(e))return o._identifiers.get(e);o._newId=(o._newId||0)+1;const t=o._newId;return o._identifiers.put(e,t),t}static _identifiers=new Hashtable;static _newId=0;static forcesGarbage=[];getVariableNumber=o.getVariableNumber;returnVariable=o.returnVariable;getVariableString=o.getVariableString;setVariableNumber=o.setVariableNumber;setVariableString=o.setVariableString;getVariableBoolean=o.getVariableBoolean;setVariableBoolean=o.setVariableBoolean;getVariableChildCount=o.getVariableChildCount;getFirstVariableNumber=o.getFirstVariableNumber;getFirstVariableString=o.getFirstVariableString;getLastVariableNumber=o.getLastVariableNumber;getLastVariableString=o.getLastVariableString;toggleVariableBoolean=o.toggleVariableBoolean;variableChildExists=o.variableChildExists;variableRemoveChild=o.variableRemoveChild;variableClearChildren=o.variableClearChildren;variablePushCopy=o.variablePushCopy;valuePush=o.valuePush;variableRemoveAt=o.variableRemoveAt;getSqDistanceTo=o.prototype.getSqDistanceToPosition}n.RuntimeObject=o,n.registerObject("",n.RuntimeObject)})(gdjs||={});
|
|
2
|
+
//# sourceMappingURL=runtimeobject.js.map
|