diff --git a/examples/3d-shark-frenzy/3d-shark-frenzy.json b/examples/3d-shark-frenzy/3d-shark-frenzy.json new file mode 100644 index 000000000..04736f298 --- /dev/null +++ b/examples/3d-shark-frenzy/3d-shark-frenzy.json @@ -0,0 +1,63325 @@ +{ + "firstLayout": "Menu", + "gdVersion": { + "build": 212, + "major": 5, + "minor": 4, + "revision": 0 + }, + "properties": { + "adaptGameResolutionAtRuntime": true, + "antialiasingMode": "MSAA", + "antialisingEnabledOnMobile": false, + "folderProject": false, + "orientation": "landscape", + "packageName": "com.example.gamename", + "pixelsRounding": false, + "projectUuid": "ba9ed0e0-6910-4a5f-8b1e-91322fbaad2e", + "scaleMode": "linear", + "sizeOnStartupMode": "adaptWidth", + "templateSlug": "", + "useExternalSourceFiles": false, + "version": "1.0.0", + "name": "Shark Frenzy", + "description": "Controls:\nPC:\n- Arrow keys to move\n- Left shift to sprint\nMobile:\n- Joystick for movement\n- Button for sprint", + "author": "", + "windowWidth": 1280, + "windowHeight": 720, + "latestCompilationDirectory": "", + "maxFPS": 60, + "minFPS": 20, + "verticalSync": false, + "platformSpecificAssets": {}, + "loadingScreen": { + "backgroundColor": 0, + "backgroundFadeInDuration": 0.2, + "backgroundImageResourceName": "", + "gdevelopLogoStyle": "light", + "logoAndProgressFadeInDuration": 0.2, + "logoAndProgressLogoFadeInDelay": 0, + "minDuration": 1.5, + "progressBarColor": 16777215, + "progressBarHeight": 20, + "progressBarMaxWidth": 200, + "progressBarMinWidth": 40, + "progressBarWidthPercent": 30, + "showGDevelopSplash": true, + "showProgressBar": true + }, + "watermark": { + "placement": "bottom-left", + "showWatermark": false + }, + "authorIds": [ + "dt0tRnf2kHWJnjkrpnzTzNj9Yc63" + ], + "authorUsernames": [ + "Jurfix" + ], + "categories": [], + "playableDevices": [ + "keyboard", + "mobile" + ], + "extensionProperties": [], + "platforms": [ + { + "name": "GDevelop JS platform" + } + ], + "currentPlatform": "GDevelop JS platform" + }, + "resources": { + "resources": [ + { + "file": "assets/Shark.glb", + "kind": "model3D", + "metadata": "", + "name": "Shark.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Pirate Kit/Animal/Shark/faa36d6ea8fb228bb6415ad7958732439803ff83af4997a7e0173998863ff8c0_Shark.glb", + "name": "Shark.glb" + } + }, + { + "file": "assets/Cliff 1.glb", + "kind": "model3D", + "metadata": "", + "name": "Cliff 1.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Pirate Kit/Rock/1e019a2d7aa304dc09473a2a74f4aa2e03214c3ff3dd35d2289f032841657169_Cliff 1.glb", + "name": "Cliff 1.glb" + } + }, + { + "file": "assets/Cliff 3.glb", + "kind": "model3D", + "metadata": "", + "name": "Cliff 3.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Pirate Kit/Rock/102919c20fdf62debe87f89162c27b187735bf0da9571316adf0a604018e17b6_Cliff 3.glb", + "name": "Cliff 3.glb" + } + }, + { + "alwaysLoaded": false, + "file": "assets/ExplosionTexture1.png", + "kind": "image", + "metadata": "", + "name": "50be691a42be33a96faa72d0fc17e0463403326c605888adb799bbb2b02e3fd8_ExplosionTexture1.png", + "smoothed": true, + "userAdded": true, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Particles/50be691a42be33a96faa72d0fc17e0463403326c605888adb799bbb2b02e3fd8_ExplosionTexture1.png", + "name": "gdevelop-asset-store" + } + }, + { + "alwaysLoaded": false, + "file": "assets/tiled_Summer Tile Water.png", + "kind": "image", + "metadata": "", + "name": "91910f5fb077be639f7415954118355ac8dc9ad2ae61b49c04f6bcce451f7fda_tiled_Summer Tile Water.png", + "smoothed": true, + "userAdded": true, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/pzUH Pack/Worlds/Summer/91910f5fb077be639f7415954118355ac8dc9ad2ae61b49c04f6bcce451f7fda_tiled_Summer Tile Water.png", + "name": "gdevelop-asset-store" + } + }, + { + "alwaysLoaded": false, + "file": "assets/tiled_Sky Background.png", + "kind": "image", + "metadata": "", + "name": "1532fe7a8e6c84b7b2547f1b3e9c3430546bd0adc86262971d99897b8ebef730_tiled_Sky Background.png", + "smoothed": true, + "userAdded": true, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Western FPS 2D/Background Element/Background/1532fe7a8e6c84b7b2547f1b3e9c3430546bd0adc86262971d99897b8ebef730_tiled_Sky Background.png", + "name": "gdevelop-asset-store" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Line light joystick border.png", + "kind": "image", + "metadata": "", + "name": "Line light joystick border.png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Multitouch joysticks/1da99d3c0a498c8b22ca295dfb33d5f121d13ac6241f68fb81dd730955db5e1f_Line light joystick border.png", + "name": "Line light joystick border.png" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Line light joystick thumb.png", + "kind": "image", + "metadata": "", + "name": "Line light joystick thumb.png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Multitouch joysticks/6e451170154c7ae31c25495ad2d2ac48ba8c8d62e93e90bfcfe3c7e509c9ce66_Line light joystick thumb.png", + "name": "Line light joystick thumb.png" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Red.png", + "kind": "image", + "metadata": "{\"extension\":\".png\",\"pskl\":{}}", + "name": "Red", + "smoothed": true, + "userAdded": true + }, + { + "file": "assets/Red Snapper.glb", + "kind": "model3D", + "metadata": "", + "name": "Red Snapper.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Cute Fish/Animal/2e2dd3bf18f8b3a528a15060af150f792e9420d6f413795de48b073f989a4e97_Red Snapper.glb", + "name": "Red Snapper.glb" + } + }, + { + "file": "assets/Clownfish.glb", + "kind": "model3D", + "metadata": "", + "name": "Clownfish.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Cute Fish/Animal/ad35fc92116d43a6ac7efbc828fa91e5efafa2d254139d538e7922dabb548dd9_Clownfish.glb", + "name": "Clownfish.glb" + } + }, + { + "file": "assets/Parrot Fish.glb", + "kind": "model3D", + "metadata": "", + "name": "Parrot Fish.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Cute Fish/Animal/73fe84865493a90d1dea36893447819dfd22ce86d53ba3540cb3dccb188c5a75_Parrot Fish.glb", + "name": "Parrot Fish.glb" + } + }, + { + "file": "assets/Yellow Tang.glb", + "kind": "model3D", + "metadata": "", + "name": "Yellow Tang.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Cute Fish/Animal/f9b4b1d318e673e33ec832c6008c00c55b85ba6717cd0adeefdba8fa0378fa0a_Yellow Tang.glb", + "name": "Yellow Tang.glb" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Metal Bar Border.png", + "kind": "image", + "metadata": "", + "name": "Metal Bar Border.png", + "smoothed": false, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Resource bars/pixel art/f8e5d88f8b377f182d5d42adf0bf9bc5f94034ac24c410f07ba27c46cda841c3_Metal Bar Border.png", + "name": "Metal Bar Border.png" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Pixel Red Fill Bar.png", + "kind": "image", + "metadata": "", + "name": "Pixel Red Fill Bar.png", + "smoothed": false, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Resource bars/pixel art/3eee053defc4f2944d72ef78b5aebbac31634202712157a3630b84fe08d79cbb_Pixel Red Fill Bar.png", + "name": "Pixel Red Fill Bar.png" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Fire round button.png", + "kind": "image", + "metadata": "", + "name": "Fire round button.png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/On-Screen Controls/Sprites/Line Light/26f1799c05e8db4e40888e34261e418a8aa04908df2f8e17306ae68c0ca321f8_Fire round button.png", + "name": "Fire round button.png" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Shaded Blue Fill Bar.png", + "kind": "image", + "metadata": "", + "name": "efb17aade7ab227ae611ea6c681413bedfaecd4b661b793675b1dd59ca941d2e_Shaded Blue Fill Bar.png", + "smoothed": true, + "userAdded": true, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Resource bars/efb17aade7ab227ae611ea6c681413bedfaecd4b661b793675b1dd59ca941d2e_Shaded Blue Fill Bar.png", + "name": "gdevelop-asset-store" + } + }, + { + "file": "assets/Lionfish.glb", + "kind": "model3D", + "metadata": "", + "name": "Lionfish.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Cute Fish/Animal/fa2eb11ebe3576fd3819c7a34680e9545aaa3de4c01bf8e8be45609d4daad33c_Lionfish.glb", + "name": "Lionfish.glb" + } + }, + { + "file": "assets/Anglerfish.glb", + "kind": "model3D", + "metadata": "", + "name": "Anglerfish.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Cute Fish/Animal/1bae741b3993e440ebea7c3ad82db357cb1556155c02758cca5bce942f1998bb_Anglerfish.glb", + "name": "Anglerfish.glb" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Black.png", + "kind": "image", + "metadata": "{\"extension\":\".png\"}", + "name": "Black", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/Blue Button With Shadow_Hovered.png", + "kind": "image", + "metadata": "", + "name": "Blue Button With Shadow_Hovered.png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Menu buttons/37288d30c2e013a34e415fb35fffd2f7267ebd031c4380927485d7461708f810_Blue Button With Shadow_Hovered.png", + "name": "Blue Button With Shadow_Hovered.png" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Blue Button With Shadow_Idle.png", + "kind": "image", + "metadata": "", + "name": "Blue Button With Shadow_Idle.png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Menu buttons/22930cdc6b25260eef3817f1687842974261b68c84ec2a13d7f32b1a2985240f_Blue Button With Shadow_Idle.png", + "name": "Blue Button With Shadow_Idle.png" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Blue Button With Shadow_Pressed.png", + "kind": "image", + "metadata": "", + "name": "Blue Button With Shadow_Pressed.png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Menu buttons/26efbc7581c47b884f5335aa7581999a75b3062aa24062a1a91955e334826d21_Blue Button With Shadow_Pressed.png", + "name": "Blue Button With Shadow_Pressed.png" + } + }, + { + "file": "assets/CantoraOne-Regular.ttf", + "kind": "font", + "metadata": "", + "name": "CantoraOne-Regular.ttf", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Menu buttons/05b0c1364a92b436b86ca819e66b63480d1bc2fb399f6c0cf8bffbf8199ccc2a_CantoraOne-Regular.ttf", + "name": "CantoraOne-Regular.ttf" + } + }, + { + "file": "assets/Jump_Start_01.wav", + "kind": "audio", + "metadata": "", + "name": "Eat.wav", + "preloadAsMusic": false, + "preloadAsSound": true, + "preloadInCache": false, + "userAdded": true, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/SoundEffects/Footsteps/Gravel/Jump/562cb5c9358cd2865fe25fa5b68c4781368f9d98aa3fc5c28e29c2e9c97d801b_Jump_Start_01.wav", + "name": "gdevelop-asset-store" + } + }, + { + "file": "assets/MetalV1_Jump_Start_04.wav", + "kind": "audio", + "metadata": "", + "name": "FastSwim.wav", + "preloadAsMusic": false, + "preloadAsSound": true, + "preloadInCache": false, + "userAdded": true, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/SoundEffects/Footsteps/Metal/Jump/657f7e47dca2e5d6edb0f433673187cc9bbb9378d24e8008fa131b831e31decf_MetalV1_Jump_Start_04.wav", + "name": "gdevelop-asset-store" + } + }, + { + "file": "assets/Gold 3.aac", + "kind": "audio", + "metadata": "", + "name": "MultiplierActive.aac", + "preloadAsMusic": false, + "preloadAsSound": true, + "preloadInCache": false, + "userAdded": true, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Space Shooter by Pixel boy/Sound/786077b9362268831e792cd25a0aa88c36af896962d3e558c3ff8b563a99f310_Gold 3.aac", + "name": "gdevelop-asset-store" + } + }, + { + "file": "assets/Jump_Land_03.wav", + "kind": "audio", + "metadata": "", + "name": "Damage.wav", + "preloadAsMusic": false, + "preloadAsSound": true, + "preloadInCache": false, + "userAdded": true, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/SoundEffects/Footsteps/DirtyGround/Jump/4731f38d7030727736e0b455bbd5ad28b470538740771ff26d871729876dc566_Jump_Land_03.wav", + "name": "gdevelop-asset-store" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Square Blue Slider Border.png", + "kind": "image", + "metadata": "", + "name": "Square Blue Slider Border.png", + "smoothed": false, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Settings UI/Slider/pixel art/4358a20ce4a1e83f8643b287f37cefadefc1941d23cfdc50a3836ecd0dd209f1_Square Blue Slider Border.png", + "name": "Square Blue Slider Border.png" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Square Blue Slider Fill Bar.png", + "kind": "image", + "metadata": "", + "name": "Square Blue Slider Fill Bar.png", + "smoothed": false, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Settings UI/Slider/pixel art/71e7d4c8549a750e6e7b6bc6508a352176cb64a57129e96bdd8f2c5bbc187820_Square Blue Slider Fill Bar.png", + "name": "Square Blue Slider Fill Bar.png" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Square Blue Slider Thumb.png", + "kind": "image", + "metadata": "", + "name": "Square Blue Slider Thumb.png", + "smoothed": false, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Settings UI/Slider/pixel art/984a68a8bbb562d3f01a8a1993720778df07d37bb3314ed6f1aaf3d4f0edede3_Square Blue Slider Thumb.png", + "name": "Square Blue Slider Thumb.png" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Yellow.png", + "kind": "image", + "metadata": "{\"extension\":\".png\",\"pskl\":{}}", + "name": "Yellow", + "smoothed": true, + "userAdded": true + }, + { + "file": "assets/Spiky Ball.glb", + "kind": "model3D", + "metadata": "", + "name": "Spiky Ball.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Platformer Game Kit/Props/b3083ee63f966b628eba08d319b0ad1d508687a733c74a3923425f9e888567a3_Spiky Ball.glb", + "name": "Spiky Ball.glb" + } + }, + { + "alwaysLoaded": false, + "file": "assets/LightGlow.png", + "kind": "image", + "metadata": "", + "name": "LightGlow.png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Particles/c17e2d500015e598624b763f4942b26e3aac96efca094cd20257a61e15b27fcb_LightGlow.png", + "name": "LightGlow.png" + } + }, + { + "file": "assets/Explosion 6.aac", + "kind": "audio", + "metadata": "", + "name": "20c1edc1dad3064721fc9a0621345e2b79198fae67e5a31cc9c3145b6654ba90_Explosion 6.aac", + "preloadAsMusic": false, + "preloadAsSound": true, + "preloadInCache": false, + "userAdded": true, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Arcade/Sound effects/Explosions/20c1edc1dad3064721fc9a0621345e2b79198fae67e5a31cc9c3145b6654ba90_Explosion 6.aac", + "name": "gdevelop-asset-store" + } + }, + { + "file": "assets/Grass.glb", + "kind": "model3D", + "metadata": "", + "name": "Grass.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Rocks and Trees/Plant/0cb362cb36ecbe654ad32e458334e319e1318ccf79abfadaf0e300eb4fc9e119_Grass.glb", + "name": "Grass.glb" + } + }, + { + "file": "assets/Grass 2.glb", + "kind": "model3D", + "metadata": "", + "name": "Grass 2.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Rocks and Trees/Plant/5f3195330c1a9a0a6b10f0713490dd546fe254010a7a8e632da7ec3cf60381f9_Grass 2.glb", + "name": "Grass 2.glb" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Transperent.png", + "kind": "image", + "metadata": "{\"extension\":\".png\",\"pskl\":{}}", + "name": "Transperent", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/boundary.png", + "kind": "image", + "metadata": "", + "name": "boundary.png", + "smoothed": true, + "userAdded": true, + "origin": { + "identifier": "https://project-resources.gdevelop.io/f934f893-e200-470b-a9d3-1d8da8c5791a/resources/56ca3109210950f63c88ad43114f0f7f4555ec4f7c26e71bd1c92045593886fd-boundary.png", + "name": "cloud-project-resource" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Poison_Bubbles_2.png", + "kind": "image", + "metadata": "{\"localFilePath\":\"assets/Poison_Bubbles_2.png\",\"extension\":\".png\"}", + "name": "92f2ee50b3545a5b2d9d7dd06163ffc35c5e323f3332bf72ed2f4adac09a1733_Poison_Bubbles_2.png", + "smoothed": false, + "userAdded": true, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/GrafxKid Pack/Character Pack 8/Effect/92f2ee50b3545a5b2d9d7dd06163ffc35c5e323f3332bf72ed2f4adac09a1733_Poison_Bubbles_2.png", + "name": "gdevelop-asset-store" + } + } + ], + "resourceFolders": [] + }, + "objects": [], + "objectsFolderStructure": { + "folderName": "__ROOT" + }, + "objectsGroups": [], + "variables": [], + "layouts": [ + { + "b": 231, + "disableInputWhenNotFocused": true, + "mangledName": "Menu", + "name": "Menu", + "r": 55, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 144, + "uiSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 0.6897782140104507, + "windowMask": false + }, + "objectsGroups": [ + { + "name": "AllGroup", + "objects": [ + { + "name": "PlayButton" + }, + { + "name": "Shark" + }, + { + "name": "LeaderboardButton" + }, + { + "name": "SettingsButton" + }, + { + "name": "VolumeSlider" + }, + { + "name": "BackButton" + }, + { + "name": "VolumeText" + }, + { + "name": "Title" + } + ] + } + ], + "variables": [], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 48, + "height": 50, + "layer": "", + "name": "PlayButton", + "persistentUuid": "43f2686e-b26f-407b-8a40-72e3c55e198b", + "width": 300, + "x": 510, + "y": 420, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Shark", + "persistentUuid": "3cde01a0-0d6a-4250-94e8-0a30a774ea3f", + "width": 0, + "x": 523, + "y": 272, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 48, + "height": 50, + "layer": "", + "name": "LeaderboardButton", + "persistentUuid": "205341a9-532b-4cdb-8608-9951e43d4159", + "width": 300, + "x": 510, + "y": 490, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 48, + "height": 50, + "layer": "", + "name": "SettingsButton", + "persistentUuid": "55974360-968f-4bdb-8cfd-f67a4ed4a232", + "width": 300, + "x": 510, + "y": 560, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 720, + "layer": "Settings", + "name": "Black", + "persistentUuid": "4fea0ed0-30aa-4b4f-ad95-0be5b01a7e89", + "width": 1280, + "x": 0, + "y": 0, + "zOrder": 5, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 53, + "height": 20, + "keepRatio": true, + "layer": "Settings", + "name": "VolumeSlider", + "persistentUuid": "589499c8-431b-4690-9001-aae747e69a12", + "width": 292, + "x": 515, + "y": 344, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 48, + "height": 50, + "layer": "Settings", + "name": "BackButton", + "persistentUuid": "6f51687e-cfa4-45a0-ae6a-004fc43fa058", + "width": 300, + "x": 510, + "y": 630, + "zOrder": 7, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "Settings", + "name": "VolumeText", + "persistentUuid": "bd04af52-98cc-439a-8ba5-64d892a9000c", + "width": 0, + "x": 506, + "y": 245, + "zOrder": 8, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 147, + "keepRatio": true, + "layer": "", + "name": "Title", + "persistentUuid": "8661bef8-f502-407b-9bd9-30243a59fd7a", + "width": 1280, + "x": 0, + "y": 58, + "zOrder": 9, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "objects": [ + { + "assetStoreId": "33302f0b615672a2e96316c096e13ad8d7242adba8bd5709538691894f0eae6e", + "name": "PlayButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 16, + "RightPadding": 16, + "PressedLabelOffsetY": 3, + "BottomPadding": 32, + "TopPadding": 32, + "HoveredFadeOutDuration": 0.25 + }, + "childrenContent": { + "Hovered": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Hovered.png", + "tiled": true, + "topMargin": 16, + "width": 192 + }, + "Idle": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Idle.png", + "tiled": true, + "topMargin": 16, + "width": 192 + }, + "Label": { + "bold": false, + "italic": false, + "smoothed": true, + "underlined": false, + "string": "PLAY", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 35, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "PLAY", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 35, + "color": "255;255;255" + } + }, + "Pressed": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Pressed.png", + "tiled": true, + "topMargin": 16, + "width": 192 + } + } + }, + { + "assetStoreId": "e40f8d40cc38bd1ed4082e5810d23d2bde8988816f6f35c782665ce294a31ebf", + "name": "Shark", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "centerLocation": "ObjectCenter", + "depth": 252, + "height": 252, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Shark.glb", + "originLocation": "TopLeft", + "rotationX": 90, + "rotationY": 90, + "rotationZ": 90, + "width": 252, + "animations": [ + { + "loop": true, + "name": "Swim", + "source": "Swim" + }, + { + "loop": true, + "name": "Swim Fast", + "source": "Swim_Fast" + }, + { + "loop": false, + "name": "Swim Bite", + "source": "Swim_Bite" + } + ] + } + }, + { + "assetStoreId": "33302f0b615672a2e96316c096e13ad8d7242adba8bd5709538691894f0eae6e", + "name": "LeaderboardButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 16, + "RightPadding": 16, + "PressedLabelOffsetY": 3, + "BottomPadding": 32, + "TopPadding": 32, + "HoveredFadeOutDuration": 0.25 + }, + "childrenContent": { + "Hovered": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Hovered.png", + "tiled": true, + "topMargin": 16, + "width": 192 + }, + "Idle": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Idle.png", + "tiled": true, + "topMargin": 16, + "width": 192 + }, + "Label": { + "bold": false, + "italic": false, + "smoothed": true, + "underlined": false, + "string": "LEADERBOARD", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 35, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "LEADERBOARD", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 35, + "color": "255;255;255" + } + }, + "Pressed": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Pressed.png", + "tiled": true, + "topMargin": 16, + "width": 192 + } + } + }, + { + "assetStoreId": "33302f0b615672a2e96316c096e13ad8d7242adba8bd5709538691894f0eae6e", + "name": "SettingsButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 16, + "RightPadding": 16, + "PressedLabelOffsetY": 3, + "BottomPadding": 32, + "TopPadding": 32, + "HoveredFadeOutDuration": 0.25 + }, + "childrenContent": { + "Hovered": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Hovered.png", + "tiled": true, + "topMargin": 16, + "width": 192 + }, + "Idle": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Idle.png", + "tiled": true, + "topMargin": 16, + "width": 192 + }, + "Label": { + "bold": false, + "italic": false, + "smoothed": true, + "underlined": false, + "string": "SETTINGS", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 35, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "SETTINGS", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 35, + "color": "255;255;255" + } + }, + "Pressed": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Pressed.png", + "tiled": true, + "topMargin": 16, + "width": 192 + } + } + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Black", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ], + "animations": [ + { + "name": "Black", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "Black", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 64, + "y": 0 + }, + { + "x": 64, + "y": 64 + }, + { + "x": 0, + "y": 64 + } + ] + ] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "d32eb2703c5acb4488d36fef28164ddf46d8f5b2f3f7a97fa11640cf8d1d91e9", + "name": "VolumeSlider", + "type": "PanelSpriteSlider::PanelSpriteSlider", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "BarTopPadding": 3, + "BarLeftPadding": 3, + "BarRightPadding": 3, + "BarBottomPadding": 4, + "LabelMargin": 4, + "InitialValue": 100 + }, + "childrenContent": { + "Background": { + "bottomMargin": 4, + "height": 18, + "leftMargin": 2, + "rightMargin": 2, + "texture": "Square Blue Slider Border.png", + "tiled": false, + "topMargin": 4, + "width": 215 + }, + "FillBar": { + "bottomMargin": 1, + "height": 11, + "leftMargin": 1, + "rightMargin": 1, + "texture": "Square Blue Slider Fill Bar.png", + "tiled": false, + "topMargin": 1, + "width": 11 + }, + "Label": { + "bold": true, + "italic": false, + "smoothed": true, + "underlined": false, + "string": "It displays the value when it changes.", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "", + "characterSize": 16, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": true, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "It displays the value when it changes.", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "", + "characterSize": 16, + "color": "255;255;255" + } + }, + "Thumb": { + "bottomMargin": 3, + "height": 42, + "leftMargin": 3, + "rightMargin": 3, + "texture": "Square Blue Slider Thumb.png", + "tiled": false, + "topMargin": 3, + "width": 21 + } + } + }, + { + "assetStoreId": "33302f0b615672a2e96316c096e13ad8d7242adba8bd5709538691894f0eae6e", + "name": "BackButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "LeftPadding": 16, + "RightPadding": 16, + "PressedLabelOffsetY": 3, + "BottomPadding": 32, + "TopPadding": 32, + "HoveredFadeOutDuration": 0.25 + }, + "childrenContent": { + "Hovered": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Hovered.png", + "tiled": true, + "topMargin": 16, + "width": 192 + }, + "Idle": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Idle.png", + "tiled": true, + "topMargin": 16, + "width": 192 + }, + "Label": { + "bold": false, + "italic": false, + "smoothed": true, + "underlined": false, + "string": "BACK", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 35, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "BACK", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 35, + "color": "255;255;255" + } + }, + "Pressed": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Pressed.png", + "tiled": true, + "topMargin": 16, + "width": 192 + } + } + }, + { + "assetStoreId": "", + "bold": true, + "italic": false, + "name": "VolumeText", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Sound volume:", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "left", + "characterSize": 50, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": true, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Sound volume:", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "left", + "characterSize": 50, + "color": "255;255;255" + } + }, + { + "assetStoreId": "", + "bold": true, + "italic": false, + "name": "Title", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "string": "Shark Frenzy", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 120, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": true, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Shark Frenzy", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 120, + "color": "255;255;255" + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "folderName": "Menu", + "children": [ + { + "objectName": "Title" + }, + { + "objectName": "Shark" + }, + { + "objectName": "PlayButton" + }, + { + "objectName": "LeaderboardButton" + }, + { + "objectName": "SettingsButton" + } + ] + }, + { + "folderName": "Settings", + "children": [ + { + "objectName": "Black" + }, + { + "objectName": "VolumeText" + }, + { + "objectName": "VolumeSlider" + }, + { + "objectName": "BackButton" + } + ] + } + ] + }, + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "HideLayer" + }, + "parameters": [ + "", + "\"Settings\"" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GroupExists" + }, + "parameters": [ + "\"Save\"", + "\"Volume\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ReadNumberFromStorage" + }, + "parameters": [ + "\"Save\"", + "\"Volume\"", + "", + "Volume" + ] + }, + { + "type": { + "value": "ModGlobalVolume" + }, + "parameters": [ + "", + "=", + "Volume" + ] + } + ], + "variables": [ + { + "folded": true, + "name": "Volume", + "type": "number", + "value": 0 + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "LayerVisible" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" + }, + "parameters": [ + "PlayButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene" + }, + "parameters": [ + "", + "\"Game\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" + }, + "parameters": [ + "LeaderboardButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Leaderboards::DisplayLeaderboard" + }, + "parameters": [ + "", + "\"8a96ea39-7db0-4e4e-8334-ab404ff58785\"", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" + }, + "parameters": [ + "SettingsButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "HideLayer" + }, + "parameters": [ + "", + "" + ] + }, + { + "type": { + "value": "ShowLayer" + }, + "parameters": [ + "", + "\"Settings\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Leaderboards::IsLeaderboardViewErrored" + }, + "parameters": [] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "PlayerAuthentication::DisplayAuthenticationBanner" + }, + "parameters": [ + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "LayerVisible" + }, + "parameters": [ + "", + "\"Settings\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "Black", + "Opacity", + "=", + "100" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::SetValue" + }, + "parameters": [ + "VolumeSlider", + "=", + "GlobalVolume()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" + }, + "parameters": [ + "BackButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModGlobalVolume" + }, + "parameters": [ + "", + "=", + "VolumeSlider.Value()" + ] + }, + { + "type": { + "value": "EcrireFichierExp" + }, + "parameters": [ + "\"Save\"", + "\"Volume\"", + "VolumeSlider.Value()" + ] + }, + { + "type": { + "value": "HideLayer" + }, + "parameters": [ + "", + "\"Settings\"" + ] + }, + { + "type": { + "value": "ShowLayer" + }, + "parameters": [ + "", + "" + ] + } + ] + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [ + { + "effectType": "Scene3D::HemisphereLight", + "name": "3D Light", + "doubleParameters": { + "elevation": 45, + "intensity": 1, + "rotation": 0 + }, + "stringParameters": { + "groundColor": "64;64;64", + "skyColor": "255;255;255", + "top": "Y-" + }, + "booleanParameters": {} + }, + { + "effectType": "Scene3D::AmbientLight", + "name": "Effect", + "doubleParameters": { + "intensity": 0.75 + }, + "stringParameters": { + "color": "255;255;255" + }, + "booleanParameters": {} + } + ] + }, + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "Settings", + "renderingType": "", + "visibility": false, + "cameras": [], + "effects": [] + } + ], + "behaviorsSharedData": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior" + }, + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, + { + "name": "Effect", + "type": "EffectCapability::EffectBehavior" + }, + { + "name": "Flippable", + "type": "FlippableCapability::FlippableBehavior" + }, + { + "name": "Object3D", + "type": "Scene3D::Base3DBehavior" + }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, + { + "name": "Resizable", + "type": "ResizableCapability::ResizableBehavior" + }, + { + "name": "Scale", + "type": "ScalableCapability::ScalableBehavior" + }, + { + "name": "Text", + "type": "TextContainerCapability::TextContainerBehavior" + } + ] + }, + { + "b": 231, + "disableInputWhenNotFocused": true, + "mangledName": "Game", + "name": "Game", + "r": 55, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 144, + "uiSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 640, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 0.6364557169127479, + "windowMask": false + }, + "objectsGroups": [ + { + "name": "Obstacles", + "objects": [ + { + "name": "Obstacle" + } + ] + }, + { + "name": "FishObstacles", + "objects": [ + { + "name": "SeaAndSky" + }, + { + "name": "Obstacle" + } + ] + }, + { + "name": "Fish", + "objects": [ + { + "name": "RedSnapper" + }, + { + "name": "Clownfish" + }, + { + "name": "ParrotFish" + }, + { + "name": "YellowTang" + }, + { + "name": "Lionfish" + }, + { + "name": "Anglerfish" + } + ] + }, + { + "name": "DangerFish", + "objects": [ + { + "name": "Lionfish" + }, + { + "name": "Anglerfish" + } + ] + }, + { + "name": "GameOver", + "objects": [ + { + "name": "GameOverScoreText" + }, + { + "name": "MenuButton" + }, + { + "name": "SumbitScoreButton" + }, + { + "name": "HighscoreScoreText" + } + ] + }, + { + "name": "CameraBoundaries", + "objects": [ + { + "name": "LeftBoundary" + }, + { + "name": "TopBoundary" + }, + { + "name": "RightBoundary" + }, + { + "name": "BottomBoundary" + } + ] + }, + { + "name": "TouchControls", + "objects": [ + { + "name": "MoveJoystick" + }, + { + "name": "FastSwimButton" + } + ] + } + ], + "variables": [ + { + "folded": true, + "name": "Score", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "Highscore", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "Multiplier", + "type": "number", + "value": 1 + }, + { + "folded": true, + "name": "SharkSize", + "type": "number", + "value": 1 + } + ], + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "UI", + "name": "MoveJoystick", + "persistentUuid": "0323ca9b-ab3a-4734-ad65-15d1ee47cbb4", + "width": 0, + "x": 200, + "y": 600, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 48, + "height": 32, + "keepRatio": true, + "layer": "UI", + "name": "HealthBar", + "persistentUuid": "38f26359-830a-47b1-a575-aa33739e8401", + "width": 363, + "x": 910, + "y": 4, + "zOrder": 17, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "UI", + "name": "ScoreText", + "persistentUuid": "598ca78e-0d3c-4de1-b57b-3afc3cc64262", + "width": 0, + "x": 10, + "y": 0, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": true, + "depth": 1, + "height": 107, + "keepRatio": true, + "layer": "UI", + "name": "FastSwimButton", + "persistentUuid": "0afe5fb3-ccde-43a8-a3ff-4cc30a042321", + "width": 107, + "x": 1064, + "y": 565, + "zOrder": 19, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 48, + "height": 32, + "keepRatio": true, + "layer": "UI", + "name": "StaminaBar", + "persistentUuid": "80999799-147a-415f-b348-8b3ea1d1c6bc", + "width": 272, + "x": 1000, + "y": 36, + "zOrder": 20, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "UI", + "name": "MultiplierText", + "persistentUuid": "03d976a8-c951-482c-bbf3-5d9d0dfb29a3", + "width": 0, + "x": 608.5, + "y": 100, + "zOrder": 21, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 720, + "layer": "Game Over", + "name": "Black", + "persistentUuid": "c718870a-3e86-4ff3-a689-49738e33fa58", + "width": 1280, + "x": 0, + "y": 0, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0.9976617303195635, + "height": 61.85502727981294, + "keepRatio": true, + "layer": "Game Over", + "name": "GameOverScoreText", + "persistentUuid": "5a2011e4-dd10-480d-b543-cc1e36e45962", + "width": 1280, + "x": 0, + "y": 190, + "zOrder": 23, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 48, + "height": 50, + "layer": "Game Over", + "name": "MenuButton", + "persistentUuid": "1d167346-068c-4701-8b28-752458aed79f", + "width": 300, + "x": 507, + "y": 490, + "zOrder": 24, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 48, + "height": 50, + "layer": "Game Over", + "name": "SumbitScoreButton", + "persistentUuid": "6055497a-dfa0-4ba9-8558-4866b1fa7a66", + "width": 300, + "x": 505, + "y": 420, + "zOrder": 25, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 62, + "layer": "Game Over", + "name": "HighscoreScoreText", + "persistentUuid": "89d66aa1-004d-4c3a-beb9-0716540bb075", + "width": 1280, + "x": 0, + "y": 287, + "zOrder": 26, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "objects": [ + { + "assetStoreId": "e40f8d40cc38bd1ed4082e5810d23d2bde8988816f6f35c782665ce294a31ebf", + "name": "Shark", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Health", + "type": "Health::Health", + "Health": 100, + "CurrentHealth": 0, + "MaxHealth": 100, + "DamageCooldown": 0, + "AllowOverHealing": false, + "IsHealthJustDamaged": false, + "DamageToBeApplied": 0, + "HitAtLeastOnce": false, + "ChanceToDodge": 0, + "IsJustDodged": false, + "HealToBeApplied": 0, + "HealthRegenRate": 0, + "HealthRegenDelay": 0, + "IsJustHealed": false, + "CurrentShieldPoints": 2.0247e-320, + "MaxShieldPoints": 0, + "ShieldDuration": 5, + "ShieldRegenRate": 0, + "BlockExcessDamage": false, + "ShieldRegenDelay": 0, + "IsShieldJustDamaged": false, + "ShieldDamageTaken": 2.0247e-320, + "FlatDamageReduction": 0, + "PercentDamageReduction": 0 + }, + { + "name": "RepeatTimer", + "type": "RepeatEveryXSeconds::RepeatTimer", + "TimerName": "MyTimer", + "TimerLength": 1, + "Limit": -1, + "Counter": 0 + }, + { + "name": "ShakeModel3D", + "type": "ShakeObject3D::ShakeModel3D", + "TranslationAmplitudeX": 0, + "TranslationAmplitudeY": 0, + "TranslationAmplitudeZ": 0, + "RotationAmplitudeX": 5, + "RotationAmplitudeY": 5, + "RotationAmplitudeZ": 5, + "Time": 5.00000000000364, + "Duration": 5.00000000000364, + "StartEasingDuration": 5.00000000000364, + "StopEasingDuration": 5.00000000000364, + "Frequency": 5.00000000000364, + "DeltaX": 5.00000000000364, + "DeltaY": 5.00000000000364, + "DeltaZ": 5.00000000000364, + "DeltaAngleX": 5.00000000000364, + "DeltaAngleY": 5.00000000000364, + "DeltaAngleZ": 5.00000000000364, + "NoiseTime": 5.00000000000364, + "Object3D": "Object3D", + "IsStartingAtCreation": false + }, + { + "name": "SmoothCamera", + "type": "SmoothCamera::SmoothCamera", + "LeftwardSpeed": 0.95, + "RightwardSpeed": 0.95, + "UpwardSpeed": 0.95, + "DownwardSpeed": 0.95, + "FollowOnX": true, + "FollowOnY": true, + "FollowFreeAreaLeft": 0, + "FollowFreeAreaRight": 0, + "FollowFreeAreaTop": 0, + "FollowFreeAreaBottom": 0, + "CameraOffsetX": 0, + "CameraOffsetY": 0, + "CameraDelay": 0, + "ForecastTime": 0, + "ForecastHistoryDuration": 0, + "LogLeftwardSpeed": 2.0247e-320, + "LogRightwardSpeed": 2.0247e-320, + "LogDownwardSpeed": 2.0247e-320, + "LogUpwardSpeed": 2.0247e-320, + "DelayedCenterX": 2.0247e-320, + "DelayedCenterY": 2.0247e-320, + "ForecastHistoryMeanX": 2.0247e-320, + "ForecastHistoryMeanY": 2.0247e-320, + "ForecastHistoryVarianceX": 2.0247e-320, + "ForecastHistoryCovariance": 2.0247e-320, + "ForecastHistoryLinearA": 2.0247e-320, + "ForecastHistoryLinearB": 2.0247e-320, + "ForecastedX": 2.0247e-320, + "ForecastedY": 2.0247e-320, + "ProjectedNewestX": 2.0247e-320, + "ProjectedNewestY": 2.0247e-320, + "ProjectedOldestX": 2.0247e-320, + "ProjectedOldestY": 2.0247e-320, + "ForecastHistoryVarianceY": 2.0247e-320, + "Index": 2.0247e-320, + "CameraDelayCatchUpSpeed": 0, + "CameraExtraDelay": 2.0247e-320, + "WaitingSpeedXMax": 2.0247e-320, + "WaitingSpeedYMax": 2.0247e-320, + "WaitingEnd": 2.0247e-320, + "CameraDelayCatchUpDuration": 2.0247e-320, + "LeftwardSpeedMax": 10000, + "RightwardSpeedMax": 10000, + "UpwardSpeedMax": 10000, + "DownwardSpeedMax": 10000, + "OldX": 9000.000000007454, + "OldY": 9000.000000007454, + "IsCalledManually": false + }, + { + "name": "TopDownMovement", + "type": "TopDownMovementBehavior::TopDownMovementBehavior", + "acceleration": 700, + "deceleration": 1000, + "maxSpeed": 300, + "allowDiagonals": true, + "angleOffset": 0, + "angularMaxSpeed": 180, + "customIsometryAngle": 30, + "ignoreDefaultControls": false, + "movementAngleOffset": 0, + "rotateObject": true, + "viewpoint": "TopDown" + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + }, + { + "name": "Tween3D", + "type": "Tween3D::Tween3D", + "Object3D": "Object3D", + "Scale": "Scale", + "Tween": "Tween" + } + ], + "content": { + "centerLocation": "ModelOrigin", + "depth": 252, + "height": 252, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Shark.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 90, + "rotationZ": 90, + "width": 252, + "animations": [ + { + "loop": true, + "name": "Swim", + "source": "Swim" + }, + { + "loop": true, + "name": "Swim Fast", + "source": "Swim_Fast" + }, + { + "loop": false, + "name": "Swim Bite", + "source": "Swim_Bite" + } + ] + } + }, + { + "assetStoreId": "6190440bad520f1b6a13a9bd8c280c6b41eaa8ddd4d6facfa047346b3d7d738a", + "name": "Cliff1", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 169, + "height": 169, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Cliff 1.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 90, + "rotationZ": 90, + "width": 169, + "animations": [] + } + }, + { + "assetStoreId": "0e86e7e87f49ec0926853ab7ac1e75d8244384be57f005d2c3dff83905eb5bed", + "name": "Cliff3", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 206, + "height": 206, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Cliff 3.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 90, + "rotationZ": 90, + "width": 206, + "animations": [] + } + }, + { + "assetStoreId": "6d3db6815965204d2834e8cad91e32297418907dfed0ebd1e03104e0f2c6139c", + "name": "BloodParticleEmitter", + "type": "ParticleEmitter3D::ParticleEmitter3D", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "EndColor": "192;64;80", + "StartColor": "201;34;54", + "StartOpacity": 200, + "SpayConeAngle": 360, + "StartSizeMin": 16, + "StartSizeMax": 32, + "EndScale": 5, + "Flow": 1, + "LifespanMin": 1, + "LifespanMax": 1.5, + "Duration": 0.5, + "StartSpeedMin": 30, + "StartSpeedMax": 45, + "ShouldAutodestruct": true, + "Blending": "Normal", + "EndOpacity": 0 + }, + "childrenContent": { + "Particle": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Image", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "50be691a42be33a96faa72d0fc17e0463403326c605888adb799bbb2b02e3fd8_ExplosionTexture1.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 31, + "y": 48 + }, + { + "x": 199, + "y": 48 + }, + { + "x": 199, + "y": 182 + }, + { + "x": 31, + "y": 182 + } + ] + ] + } + ] + } + ] + } + ] + } + } + }, + { + "assetStoreId": "", + "name": "SeaAndSky", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "width": 100, + "height": 100, + "depth": 100, + "enableTextureTransparency": true, + "facesOrientation": "Y", + "frontFaceResourceName": "", + "backFaceResourceName": "1532fe7a8e6c84b7b2547f1b3e9c3430546bd0adc86262971d99897b8ebef730_tiled_Sky Background.png", + "backFaceUpThroughWhichAxisRotation": "Y", + "leftFaceResourceName": "", + "rightFaceResourceName": "", + "topFaceResourceName": "", + "bottomFaceResourceName": "91910f5fb077be639f7415954118355ac8dc9ad2ae61b49c04f6bcce451f7fda_tiled_Summer Tile Water.png", + "frontFaceVisible": false, + "backFaceVisible": true, + "leftFaceVisible": false, + "rightFaceVisible": false, + "topFaceVisible": false, + "bottomFaceVisible": true, + "frontFaceResourceRepeat": false, + "backFaceResourceRepeat": false, + "leftFaceResourceRepeat": false, + "rightFaceResourceRepeat": false, + "topFaceResourceRepeat": false, + "bottomFaceResourceRepeat": false, + "materialType": "Basic" + } + }, + { + "assetStoreId": "112c69f62e03fa6df7716cc6b8f174c17857fbf71c8d3fffd16fa8fdbfa49bf1", + "name": "MoveJoystick", + "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "variables": [], + "effects": [], + "behaviors": [], + "content": {}, + "childrenContent": { + "Border": { + "adaptCollisionMaskAutomatically": false, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Line light joystick border.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + "Thumb": { + "adaptCollisionMaskAutomatically": false, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Line light joystick thumb.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + } + } + }, + { + "assetStoreId": "", + "name": "FishSpawner", + "type": "Scene3D::Cube3DObject", + "variables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "0" + } + ], + "effects": [], + "behaviors": [ + { + "name": "InOnScreen", + "type": "IsOnScreen::InOnScreen" + } + ], + "content": { + "width": 100, + "height": 100, + "depth": 100, + "enableTextureTransparency": false, + "facesOrientation": "Y", + "frontFaceResourceName": "Red", + "backFaceResourceName": "", + "backFaceUpThroughWhichAxisRotation": "X", + "leftFaceResourceName": "", + "rightFaceResourceName": "", + "topFaceResourceName": "", + "bottomFaceResourceName": "", + "frontFaceVisible": true, + "backFaceVisible": false, + "leftFaceVisible": false, + "rightFaceVisible": false, + "topFaceVisible": false, + "bottomFaceVisible": false, + "frontFaceResourceRepeat": false, + "backFaceResourceRepeat": false, + "leftFaceResourceRepeat": false, + "rightFaceResourceRepeat": false, + "topFaceResourceRepeat": false, + "bottomFaceResourceRepeat": false, + "materialType": "Basic" + } + }, + { + "assetStoreId": "1750710b107e134bc45c3fa9bb0105e288b3bd21663d081750446c8c459405b0", + "name": "RedSnapper", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "BoidsMovement", + "type": "BoidsMovement::BoidsMovement", + "MaxSpeed": 450, + "MaxAcceleration": 640, + "ShouldRotate": true, + "CohesionRadius": 64, + "AlignmentRadius": 48, + "SeparationRadius": 32, + "CohesionWeight": 1, + "AlignmentWeight": 1, + "SeparationWeight": 2, + "TrajectoryDistance": 2.00000000000182 + }, + { + "name": "InOnScreen", + "type": "IsOnScreen::InOnScreen" + } + ], + "content": { + "centerLocation": "ModelOrigin", + "depth": 30, + "height": 30, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Red Snapper.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 90, + "rotationZ": 90, + "width": 30, + "animations": [ + { + "loop": true, + "name": "Idle", + "source": "Swimming_Normal" + }, + { + "loop": true, + "name": "Run", + "source": "Swimming_Fast" + }, + { + "loop": false, + "name": "Attack", + "source": "Attack" + }, + { + "loop": false, + "name": "Death", + "source": "Death" + }, + { + "loop": true, + "name": "OutOfWater", + "source": "Out_Of_Water" + }, + { + "loop": true, + "name": "SwimmingImpulse", + "source": "Swimming_Impulse" + } + ] + } + }, + { + "assetStoreId": "02c82e04b89819c41b68a9d190e768e6abedead82f5575e5d91cdc4d514dd401", + "name": "Clownfish", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "BoidsMovement", + "type": "BoidsMovement::BoidsMovement", + "MaxSpeed": 450, + "MaxAcceleration": 640, + "ShouldRotate": true, + "CohesionRadius": 64, + "AlignmentRadius": 48, + "SeparationRadius": 32, + "CohesionWeight": 1, + "AlignmentWeight": 1, + "SeparationWeight": 2, + "TrajectoryDistance": 2.00000000000182 + }, + { + "name": "InOnScreen", + "type": "IsOnScreen::InOnScreen" + } + ], + "content": { + "centerLocation": "ModelOrigin", + "depth": 30, + "height": 30, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Clownfish.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 90, + "rotationZ": 90, + "width": 30, + "animations": [ + { + "loop": true, + "name": "Idle", + "source": "Swimming_Normal" + }, + { + "loop": true, + "name": "Run", + "source": "Swimming_Fast" + }, + { + "loop": false, + "name": "Attack", + "source": "Attack" + }, + { + "loop": false, + "name": "Death", + "source": "Death" + }, + { + "loop": true, + "name": "OutOfWater", + "source": "Out_Of_Water" + }, + { + "loop": true, + "name": "SwimmingImpulse", + "source": "Swimming_Impulse" + } + ] + } + }, + { + "assetStoreId": "88ba8d1e39b868a329f229ed1fccfb57cd249c113ea41589b2c0636296559527", + "name": "ParrotFish", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "BoidsMovement", + "type": "BoidsMovement::BoidsMovement", + "MaxSpeed": 450, + "MaxAcceleration": 640, + "ShouldRotate": true, + "CohesionRadius": 64, + "AlignmentRadius": 48, + "SeparationRadius": 32, + "CohesionWeight": 1, + "AlignmentWeight": 1, + "SeparationWeight": 2, + "TrajectoryDistance": 2.00000000000182 + }, + { + "name": "InOnScreen", + "type": "IsOnScreen::InOnScreen" + } + ], + "content": { + "centerLocation": "ModelOrigin", + "depth": 30, + "height": 30, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Parrot Fish.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 90, + "rotationZ": 90, + "width": 30, + "animations": [ + { + "loop": true, + "name": "Idle", + "source": "Swimming_Normal" + }, + { + "loop": true, + "name": "Run", + "source": "Swimming_Fast" + }, + { + "loop": false, + "name": "Attack", + "source": "Attack" + }, + { + "loop": false, + "name": "Death", + "source": "Death" + }, + { + "loop": true, + "name": "OutOfWater", + "source": "Out_Of_Water" + }, + { + "loop": true, + "name": "SwimmingImpulse", + "source": "Swimming_Impulse" + } + ] + } + }, + { + "assetStoreId": "fb360a8ea6767da282bf5eaaac8543aa733e8905010234a4550b3eb63d88a74d", + "name": "YellowTang", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "BoidsMovement", + "type": "BoidsMovement::BoidsMovement", + "MaxSpeed": 450, + "MaxAcceleration": 640, + "ShouldRotate": true, + "CohesionRadius": 64, + "AlignmentRadius": 48, + "SeparationRadius": 32, + "CohesionWeight": 1, + "AlignmentWeight": 1, + "SeparationWeight": 2, + "TrajectoryDistance": 2.00000000000182 + }, + { + "name": "InOnScreen", + "type": "IsOnScreen::InOnScreen" + } + ], + "content": { + "centerLocation": "ModelOrigin", + "depth": 30, + "height": 30, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Yellow Tang.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 90, + "rotationZ": 90, + "width": 30, + "animations": [ + { + "loop": true, + "name": "Idle", + "source": "Swimming_Normal" + }, + { + "loop": true, + "name": "Run", + "source": "Swimming_Fast" + }, + { + "loop": false, + "name": "Attack", + "source": "Attack" + }, + { + "loop": false, + "name": "Death", + "source": "Death" + }, + { + "loop": true, + "name": "OutOfWater", + "source": "Out_Of_Water" + }, + { + "loop": true, + "name": "SwimmingImpulse", + "source": "Swimming_Impulse" + } + ] + } + }, + { + "assetStoreId": "17a00ca25428306c8db067b2dd8379e9fe1cb562c10443ae2f65f3d561e54f1e", + "name": "HealthBar", + "type": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 0, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "PreviousHighValueDuration": 1, + "InitialValue": 100, + "MaxValue": 100, + "BarTopPadding": 7, + "BarLeftPadding": 9, + "BarBottomPadding": 7, + "BarRightPadding": 9 + }, + "childrenContent": { + "Background": { + "bottomMargin": 7, + "height": 32, + "leftMargin": 9, + "rightMargin": 9, + "texture": "Metal Bar Border.png", + "tiled": false, + "topMargin": 7, + "width": 98 + }, + "Buffer": { + "bottomMargin": 0, + "height": 18, + "leftMargin": 0, + "rightMargin": 0, + "texture": "Transperent", + "tiled": false, + "topMargin": 0, + "width": 18 + }, + "FillBar": { + "bottomMargin": 0, + "height": 18, + "leftMargin": 0, + "rightMargin": 0, + "texture": "Pixel Red Fill Bar.png", + "tiled": false, + "topMargin": 0, + "width": 18 + }, + "Label": { + "bold": true, + "italic": false, + "smoothed": true, + "underlined": false, + "string": "100 / 100", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 14, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": true, + "isOutlineEnabled": true, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "0;0;0", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "100 / 100", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 14, + "color": "255;255;255" + } + } + } + }, + { + "assetStoreId": "", + "bold": true, + "italic": false, + "name": "ScoreText", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "ScoreAnimation", + "type": "RollingCounter::RollingCounter", + "Prefix": "★ ", + "Value": 0, + "AnimationDuration": 0.5, + "Text": "Text", + "Suffix": "", + "Increment": 1 + } + ], + "string": "★ 0", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "left", + "characterSize": 35, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": true, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "0;0;0", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "★ 0", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "left", + "characterSize": 35, + "color": "255;255;255" + } + }, + { + "assetStoreId": "", + "bold": true, + "italic": false, + "name": "AddScoreText", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ], + "string": "10", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "left", + "characterSize": 20, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": true, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "10", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "left", + "characterSize": 20, + "color": "255;255;255" + } + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "740b86a167a5f605cb7fc34bd700bdd9cb46e6df891458b3bc8db0c27b460b75", + "name": "FastSwimButton", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 0, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 3, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "MultitouchButton", + "type": "SpriteMultitouchJoystick::MultitouchButton", + "ControllerIdentifier": 1, + "ButtonIdentifier": "FastSwim", + "TouchId": 0, + "TouchIndex": 2.0247e-320, + "IsReleased": false + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": true, + "timeBetweenFrames": 0.025, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "Fire round button.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 80, + "y": 0 + }, + { + "x": 80, + "y": 80 + }, + { + "x": 0, + "y": 80 + } + ] + ] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "17a00ca25428306c8db067b2dd8379e9fe1cb562c10443ae2f65f3d561e54f1e", + "name": "StaminaBar", + "type": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 0, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "PreviousHighValueDuration": 1, + "InitialValue": 100, + "MaxValue": 100, + "BarTopPadding": 7, + "BarLeftPadding": 9, + "BarBottomPadding": 7, + "BarRightPadding": 9 + }, + "childrenContent": { + "Background": { + "bottomMargin": 7, + "height": 32, + "leftMargin": 9, + "rightMargin": 9, + "texture": "Metal Bar Border.png", + "tiled": false, + "topMargin": 7, + "width": 98 + }, + "Buffer": { + "bottomMargin": 0, + "height": 18, + "leftMargin": 0, + "rightMargin": 0, + "texture": "Transperent", + "tiled": false, + "topMargin": 0, + "width": 18 + }, + "FillBar": { + "bottomMargin": 0, + "height": 18, + "leftMargin": 0, + "rightMargin": 0, + "texture": "efb17aade7ab227ae611ea6c681413bedfaecd4b661b793675b1dd59ca941d2e_Shaded Blue Fill Bar.png", + "tiled": false, + "topMargin": 0, + "width": 18 + }, + "Label": { + "bold": true, + "italic": false, + "smoothed": true, + "underlined": false, + "string": "100 / 100", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 14, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": true, + "isOutlineEnabled": true, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "0;0;0", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "100 / 100", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 14, + "color": "255;255;255" + } + } + } + }, + { + "assetStoreId": "", + "bold": true, + "italic": false, + "name": "MultiplierText", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "1X", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "left", + "characterSize": 50, + "color": { + "b": 28, + "g": 231, + "r": 248 + }, + "content": { + "bold": true, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 1, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "1X", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "left", + "characterSize": 50, + "color": "248;231;28" + } + }, + { + "assetStoreId": "5ee2d9cf6e9feb8dc485840fc888a6011e3ac75cbd1f9fe874037b0693ae89e6", + "name": "Lionfish", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "BoidsMovement", + "type": "BoidsMovement::BoidsMovement", + "MaxSpeed": 350, + "MaxAcceleration": 640, + "ShouldRotate": true, + "CohesionRadius": 64, + "AlignmentRadius": 48, + "SeparationRadius": 36, + "CohesionWeight": 1, + "AlignmentWeight": 1, + "SeparationWeight": 2, + "TrajectoryDistance": 2.00000000000182 + }, + { + "name": "InOnScreen", + "type": "IsOnScreen::InOnScreen" + } + ], + "content": { + "centerLocation": "ModelOrigin", + "depth": 45, + "height": 45, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Lionfish.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 90, + "rotationZ": 90, + "width": 45, + "animations": [ + { + "loop": true, + "name": "Idle", + "source": "Swimming_Normal" + }, + { + "loop": true, + "name": "Run", + "source": "Swimming_Fast" + }, + { + "loop": false, + "name": "Attack", + "source": "Attack" + }, + { + "loop": false, + "name": "Death", + "source": "Death" + }, + { + "loop": true, + "name": "OutOfWater", + "source": "Out_Of_Water" + }, + { + "loop": true, + "name": "SwimmingImpulse", + "source": "Swimming_Impulse" + } + ] + } + }, + { + "assetStoreId": "541fbeef885b820c831d37b99d145194a50cfe19213a3bf05b09d9822a03933e", + "name": "Anglerfish", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "BoidsMovement", + "type": "BoidsMovement::BoidsMovement", + "MaxSpeed": 450, + "MaxAcceleration": 640, + "ShouldRotate": true, + "CohesionRadius": 64, + "AlignmentRadius": 48, + "SeparationRadius": 52, + "CohesionWeight": 1, + "AlignmentWeight": 1, + "SeparationWeight": 2, + "TrajectoryDistance": 2.00000000000182 + }, + { + "name": "InOnScreen", + "type": "IsOnScreen::InOnScreen" + } + ], + "content": { + "centerLocation": "ModelOrigin", + "depth": 40, + "height": 40, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Anglerfish.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 90, + "rotationZ": 90, + "width": 40, + "animations": [ + { + "loop": true, + "name": "Idle", + "source": "Swimming_Normal" + }, + { + "loop": true, + "name": "Run", + "source": "Swimming_Fast" + }, + { + "loop": false, + "name": "Attack", + "source": "Attack" + }, + { + "loop": false, + "name": "Death", + "source": "Death" + }, + { + "loop": true, + "name": "OutOfWater", + "source": "Out_Of_Water" + }, + { + "loop": true, + "name": "SwimmingImpulse", + "source": "Swimming_Impulse" + } + ] + } + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Black", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ], + "animations": [ + { + "name": "Black", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "Black", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 64, + "y": 0 + }, + { + "x": 64, + "y": 64 + }, + { + "x": 0, + "y": 64 + } + ] + ] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "", + "bold": true, + "italic": false, + "name": "GameOverScoreText", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "ScoreAnimation", + "type": "RollingCounter::RollingCounter", + "Prefix": "Score: ", + "Value": 0, + "AnimationDuration": 1, + "Text": "Text" + } + ], + "string": "Score: 0", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 50, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": true, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Score: 0", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 50, + "color": "255;255;255" + } + }, + { + "assetStoreId": "33302f0b615672a2e96316c096e13ad8d7242adba8bd5709538691894f0eae6e", + "name": "MenuButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 16, + "RightPadding": 16, + "PressedLabelOffsetY": 3, + "BottomPadding": 32, + "TopPadding": 32, + "HoveredFadeOutDuration": 0.25 + }, + "childrenContent": { + "Hovered": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Hovered.png", + "tiled": true, + "topMargin": 16, + "width": 192 + }, + "Idle": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Idle.png", + "tiled": true, + "topMargin": 16, + "width": 192 + }, + "Label": { + "bold": false, + "italic": false, + "smoothed": true, + "underlined": false, + "string": "MENU", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 35, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "MENU", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 35, + "color": "255;255;255" + } + }, + "Pressed": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Pressed.png", + "tiled": true, + "topMargin": 16, + "width": 192 + } + } + }, + { + "assetStoreId": "33302f0b615672a2e96316c096e13ad8d7242adba8bd5709538691894f0eae6e", + "name": "SumbitScoreButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 16, + "RightPadding": 16, + "PressedLabelOffsetY": 3, + "BottomPadding": 32, + "TopPadding": 32, + "HoveredFadeOutDuration": 0.25 + }, + "childrenContent": { + "Hovered": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Hovered.png", + "tiled": true, + "topMargin": 16, + "width": 192 + }, + "Idle": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Idle.png", + "tiled": true, + "topMargin": 16, + "width": 192 + }, + "Label": { + "bold": false, + "italic": false, + "smoothed": true, + "underlined": false, + "string": "SUBMIT SCORE", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 35, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "SUBMIT SCORE", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 35, + "color": "255;255;255" + } + }, + "Pressed": { + "bottomMargin": 16, + "height": 69, + "leftMargin": 16, + "rightMargin": 16, + "texture": "Blue Button With Shadow_Pressed.png", + "tiled": true, + "topMargin": 16, + "width": 192 + } + } + }, + { + "assetStoreId": "", + "bold": true, + "italic": false, + "name": "HighscoreScoreText", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "string": "Highscore: 0", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 50, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": true, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Highscore: 0", + "font": "CantoraOne-Regular.ttf", + "textAlignment": "center", + "characterSize": 50, + "color": "255;255;255" + } + }, + { + "assetStoreId": "", + "name": "SharkSpawnPoint", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "width": 100, + "height": 100, + "depth": 100, + "enableTextureTransparency": false, + "facesOrientation": "Y", + "frontFaceResourceName": "Yellow", + "backFaceResourceName": "", + "backFaceUpThroughWhichAxisRotation": "X", + "leftFaceResourceName": "", + "rightFaceResourceName": "", + "topFaceResourceName": "", + "bottomFaceResourceName": "", + "frontFaceVisible": true, + "backFaceVisible": false, + "leftFaceVisible": false, + "rightFaceVisible": false, + "topFaceVisible": false, + "bottomFaceVisible": false, + "frontFaceResourceRepeat": false, + "backFaceResourceRepeat": false, + "leftFaceResourceRepeat": false, + "rightFaceResourceRepeat": false, + "topFaceResourceRepeat": false, + "bottomFaceResourceRepeat": false, + "materialType": "Basic" + } + }, + { + "assetStoreId": "", + "name": "Obstacle", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "width": 100, + "height": 100, + "depth": 100, + "enableTextureTransparency": false, + "facesOrientation": "Y", + "frontFaceResourceName": "Red", + "backFaceResourceName": "", + "backFaceUpThroughWhichAxisRotation": "X", + "leftFaceResourceName": "", + "rightFaceResourceName": "", + "topFaceResourceName": "", + "bottomFaceResourceName": "", + "frontFaceVisible": true, + "backFaceVisible": false, + "leftFaceVisible": false, + "rightFaceVisible": false, + "topFaceVisible": false, + "bottomFaceVisible": false, + "frontFaceResourceRepeat": false, + "backFaceResourceRepeat": false, + "leftFaceResourceRepeat": false, + "rightFaceResourceRepeat": false, + "topFaceResourceRepeat": false, + "bottomFaceResourceRepeat": false, + "materialType": "Basic" + } + }, + { + "assetStoreId": "2a32220b97261b7d25bfac750227a933a6b98dbf244803baba29c09bfb260144", + "name": "Mine", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 50, + "height": 50, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Spiky Ball.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 50, + "animations": [] + } + }, + { + "assetStoreId": "6d3db6815965204d2834e8cad91e32297418907dfed0ebd1e03104e0f2c6139c", + "name": "RedExplosion", + "type": "ParticleEmitter3D::ParticleEmitter3D", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "EndColor": "255;0;0", + "StartColor": "255;255;64", + "StartOpacity": 255, + "SpayConeAngle": 360, + "StartSizeMin": 50, + "StartSizeMax": 50, + "EndScale": 4, + "Flow": 400, + "LifespanMin": 0.6, + "LifespanMax": 1.2, + "Duration": 0.25, + "StartSpeedMin": 80, + "StartSpeedMax": 140, + "ShouldAutodestruct": true + }, + "childrenContent": { + "Particle": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Image", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "LightGlow.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + } + } + }, + { + "assetStoreId": "74437b0681eb12aa1ea0554e3e9096d9286f060b0aa009cd53fa927ba75c9465", + "name": "Grass", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 91, + "height": 91, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Grass.glb", + "originLocation": "ModelOrigin", + "rotationX": -90, + "rotationY": 90, + "rotationZ": -90, + "width": 91, + "animations": [] + } + }, + { + "assetStoreId": "7e035b0411302b3be7c048769e6af98995c0bf3424c1dfe7c2183da3733e7b70", + "name": "Grass2", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "ShakeModel3D", + "type": "ShakeObject3D::ShakeModel3D", + "TranslationAmplitudeX": 2, + "TranslationAmplitudeY": 1, + "TranslationAmplitudeZ": 0, + "RotationAmplitudeX": 1, + "RotationAmplitudeY": 0, + "RotationAmplitudeZ": 0, + "Time": 5.00000000000364, + "Duration": 5.00000000000364, + "StartEasingDuration": 5.00000000000364, + "StopEasingDuration": 5.00000000000364, + "Frequency": 0.4, + "DeltaX": 5.00000000000364, + "DeltaY": 5.00000000000364, + "DeltaZ": 5.00000000000364, + "DeltaAngleX": 5.00000000000364, + "DeltaAngleY": 5.00000000000364, + "DeltaAngleZ": 5.00000000000364, + "NoiseTime": 5.00000000000364, + "Object3D": "Object3D", + "IsStartingAtCreation": true + } + ], + "content": { + "centerLocation": "ModelOrigin", + "depth": 108, + "height": 108, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Grass 2.glb", + "originLocation": "ModelOrigin", + "rotationX": -90, + "rotationY": 90, + "rotationZ": -90, + "width": 108, + "animations": [] + } + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "LeftBoundary", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "boundary.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 32, + "y": 0 + }, + { + "x": 32, + "y": 32 + }, + { + "x": 0, + "y": 32 + } + ] + ] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "TopBoundary", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "boundary.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 32, + "y": 0 + }, + { + "x": 32, + "y": 32 + }, + { + "x": 0, + "y": 32 + } + ] + ] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "RightBoundary", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "boundary.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 32, + "y": 0 + }, + { + "x": 32, + "y": 32 + }, + { + "x": 0, + "y": 32 + } + ] + ] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "BottomBoundary", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "boundary.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 32, + "y": 0 + }, + { + "x": 32, + "y": 32 + }, + { + "x": 0, + "y": 32 + } + ] + ] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "351f05a136c91ee1d9d6ff4f9cfbc4d40b3744d7c7ea74212b4853862d52d974", + "name": "BubblesParticleEmitter", + "type": "ParticleEmitter3D::ParticleEmitter3D", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Sticker", + "type": "Sticker::Sticker", + "OnlyFollowPosition": true, + "IsDestroyedWithParent": false + } + ], + "content": { + "EndColor": "114;162;218", + "StartColor": "155;186;223", + "StartOpacity": 204, + "SpayConeAngle": 360, + "StartSizeMin": 8, + "StartSizeMax": 12, + "EndScale": 0.5, + "Flow": 5, + "LifespanMin": 20, + "LifespanMax": 30, + "Duration": 123456, + "StartSpeedMin": 256, + "StartSpeedMax": 512, + "ShouldAutodestruct": true, + "Blending": "Normal", + "Gravity": -80 + }, + "childrenContent": { + "Particle": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Image", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "92f2ee50b3545a5b2d9d7dd06163ffc35c5e323f3332bf72ed2f4adac09a1733_Poison_Bubbles_2.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 8, + "y": 0 + }, + { + "x": 8, + "y": 8 + }, + { + "x": 0, + "y": 8 + } + ] + ] + } + ] + } + ] + } + ] + } + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Shark" + }, + { + "objectName": "BubblesParticleEmitter" + }, + { + "objectName": "BloodParticleEmitter" + }, + { + "objectName": "FishSpawner" + }, + { + "objectName": "Obstacle" + }, + { + "objectName": "SharkSpawnPoint" + }, + { + "folderName": "Camera boundaries", + "children": [ + { + "objectName": "LeftBoundary" + }, + { + "objectName": "TopBoundary" + }, + { + "objectName": "RightBoundary" + }, + { + "objectName": "BottomBoundary" + } + ] + }, + { + "folderName": "Decorations", + "children": [ + { + "objectName": "Grass2" + }, + { + "objectName": "Grass" + }, + { + "objectName": "SeaAndSky" + }, + { + "objectName": "Cliff1" + }, + { + "objectName": "Cliff3" + } + ] + }, + { + "folderName": "Mobile controls", + "children": [ + { + "objectName": "MoveJoystick" + }, + { + "objectName": "FastSwimButton" + } + ] + }, + { + "folderName": "Fish", + "children": [ + { + "objectName": "YellowTang" + }, + { + "objectName": "ParrotFish" + }, + { + "objectName": "Clownfish" + }, + { + "objectName": "RedSnapper" + } + ] + }, + { + "folderName": "UI", + "children": [ + { + "objectName": "AddScoreText" + }, + { + "objectName": "HealthBar" + }, + { + "objectName": "StaminaBar" + }, + { + "objectName": "MultiplierText" + }, + { + "objectName": "ScoreText" + } + ] + }, + { + "folderName": "Game Over", + "children": [ + { + "objectName": "SumbitScoreButton" + }, + { + "objectName": "MenuButton" + }, + { + "objectName": "Black" + }, + { + "objectName": "GameOverScoreText" + }, + { + "objectName": "HighscoreScoreText" + } + ] + }, + { + "folderName": "Dangers", + "children": [ + { + "objectName": "Anglerfish" + }, + { + "objectName": "Lionfish" + }, + { + "objectName": "RedExplosion" + }, + { + "objectName": "Mine" + } + ] + } + ] + }, + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "HideLayer" + }, + "parameters": [ + "", + "\"Game Over\"" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::Activate" + }, + "parameters": [ + "SumbitScoreButton", + "", + "" + ] + }, + { + "type": { + "value": "PlayerAuthentication::HideAuthenticationBanner" + }, + "parameters": [ + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GroupExists" + }, + "parameters": [ + "\"Save\"", + "\"Highscore\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ReadNumberFromStorage" + }, + "parameters": [ + "\"Save\"", + "\"Highscore\"", + "", + "Highscore" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "BuiltinExternalLayouts::CreateObjectsFromExternalLayout" + }, + "parameters": [ + "", + "\"Level\"", + "0", + "0", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "FishSpawner" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Obstacle" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "CameraBoundaries" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Random player shark spawn" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "AjoutHasard" + }, + "parameters": [ + "", + "SharkSpawnPoint" + ] + } + ], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Shark", + "SharkSpawnPoint.CenterX()", + "SharkSpawnPoint.CenterY()", + "" + ] + }, + { + "type": { + "value": "CentreCamera" + }, + "parameters": [ + "", + "Shark", + "", + "", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "SharkSpawnPoint", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Create a bubble emitter and attach it to the shark" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "BubblesParticleEmitter", + "Shark.X()", + "Shark.Y() + 1000", + "" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "BubblesParticleEmitter", + "Object3D", + "=", + "-1000" + ] + }, + { + "type": { + "value": "Sticker::Sticker::Stick" + }, + "parameters": [ + "BubblesParticleEmitter", + "Sticker", + "Shark", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SystemInfo::IsMobile" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "TouchControls", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SystemInfo::IsMobile" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "ZoomCamera" + }, + "parameters": [ + "", + "1.2", + "", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Initial fish spawn" + }, + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "FishSpawner", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "RandomInRange(6, 16)", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "SceneInstancesCount(Fish)", + "<", + "200" + ] + } + ], + "actions": [ + { + "type": { + "value": "CreateByName" + }, + "parameters": [ + "", + "Fish", + "FishSpawner.FishType", + "RandomInRange(FishSpawner.X() - 100, FishSpawner.X() + 100)", + "RandomInRange(FishSpawner.Y() - 100, FishSpawner.Y() + 100)", + "" + ] + } + ] + } + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Shark (Player)", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Shark", + "Object3D", + "=", + "Shark.Angle()" + ] + }, + { + "type": { + "value": "SeparateFromObjects" + }, + "parameters": [ + "Shark", + "Obstacles", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::IsDead" + }, + "parameters": [ + "Shark", + "Health", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::TopDownMovementBehavior::SetVelocityY" + }, + "parameters": [ + "Shark", + "TopDownMovement", + "=", + "100" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::IgnoreDefaultControls" + }, + "parameters": [ + "Shark", + "TopDownMovement", + "yes" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "MoveJoystick", + "no", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetSpeedScale" + }, + "parameters": [ + "Shark", + "Animation", + "=", + "0" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "2" + ] + }, + { + "type": { + "value": "HideLayer" + }, + "parameters": [ + "", + "\"UI\"" + ] + }, + { + "type": { + "value": "HideLayer" + }, + "parameters": [ + "", + "\"Mobile Controls\"" + ] + }, + { + "type": { + "value": "ShowLayer" + }, + "parameters": [ + "", + "\"Game Over\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Health::Health::IsDead" + }, + "parameters": [ + "Shark", + "Health", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RepeatEveryXSeconds::RepeatTimer::Repeat2" + }, + "parameters": [ + "Shark", + "RepeatTimer", + "\"HungerDamage\"", + "0.5", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::Hit" + }, + "parameters": [ + "Shark", + "Health", + "1", + "no", + "no", + "" + ] + }, + { + "type": { + "value": "Health::Health::SetMaxHealthOp" + }, + "parameters": [ + "Shark", + "Health", + "=", + "round(100 * SharkSize)", + "" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetMaxValue" + }, + "parameters": [ + "HealthBar", + "=", + "Shark.Health::MaxHealth()", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Limiting the size of the shark to prevent it from getting stuck in caves" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "SharkSize", + "<", + "1.2" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetValue" + }, + "parameters": [ + "Shark", + "Scale", + "=", + "SharkSize" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Eat fish" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionNP" + }, + "parameters": [ + "Shark", + "Fish", + "", + "", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "AnimatableCapability::AnimatableBehavior::Name" + }, + "parameters": [ + "Shark", + "Animation", + "=", + "\"Swim Bite\"" + ] + }, + { + "type": { + "value": "EstTourne" + }, + "parameters": [ + "Shark", + "Fish", + "180", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Shark", + "Animation", + "=", + "\"Swim Bite\"" + ] + }, + { + "type": { + "value": "PlaySound" + }, + "parameters": [ + "", + "Eat.wav", + "", + "100", + "1" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Fish", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Score", + "+", + "10 * floor(Multiplier)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Multiplier", + "+", + "0.2" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "SharkSize", + "+", + "0.001" + ] + }, + { + "type": { + "value": "Health::Health::Heal" + }, + "parameters": [ + "Shark", + "Health", + "10", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "BloodParticleEmitter", + "Fish.X()", + "Fish.Y()", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "AddScoreText", + "Fish.X()", + "Fish.Y()", + "" + ] + }, + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "AddScoreText", + "Text", + "=", + "ToString(10*floor(Multiplier))" + ] + }, + { + "type": { + "value": "Tween::TweenBehavior::AddObjectPositionYTween2" + }, + "parameters": [ + "AddScoreText", + "Tween", + "\"Up\"", + "AddScoreText.Y() - 100", + "\"linear\"", + "2", + "" + ] + }, + { + "type": { + "value": "Tween::TweenBehavior::AddObjectOpacityTween2" + }, + "parameters": [ + "AddScoreText", + "Tween", + "\"Opacity\"", + "0", + "\"linear\"", + "2", + "yes" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Fish", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RollingCounter::RollingCounter::SetValue" + }, + "parameters": [ + "ScoreText", + "ScoreAnimation", + "=", + "Score", + "" + ] + }, + { + "type": { + "value": "ResetTimer" + }, + "parameters": [ + "", + "\"MultiplierTimer\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::Name" + }, + "parameters": [ + "Shark", + "Animation", + "=", + "\"Swim Bite\"" + ] + }, + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::HasAnimationEnded" + }, + "parameters": [ + "Shark", + "Animation" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Shark", + "Animation", + "=", + "\"Swim\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Out of water" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Shark", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::TopDownMovementBehavior::SetVelocityY" + }, + "parameters": [ + "Shark", + "TopDownMovement", + "=", + "100" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Fast swim" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TopDownMovementBehavior::Speed" + }, + "parameters": [ + "Shark", + "TopDownMovement", + ">", + "0" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "LShift" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "FastSwimButton", + "MultitouchButton", + "" + ] + } + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::MaxSpeed" + }, + "parameters": [ + "Shark", + "TopDownMovement", + "=", + "500" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::AngularMaxSpeed" + }, + "parameters": [ + "Shark", + "TopDownMovement", + "=", + "200" + ] + }, + { + "type": { + "value": "PlaySound" + }, + "parameters": [ + "", + "FastSwim.wav", + "", + "100", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TopDownMovementBehavior::MaxSpeed" + }, + "parameters": [ + "Shark", + "TopDownMovement", + "=", + "500" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetValue" + }, + "parameters": [ + "StaminaBar", + "-", + "12 * TimeDelta()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TopDownMovementBehavior::MaxSpeed" + }, + "parameters": [ + "Shark", + "TopDownMovement", + "<", + "500" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::Value" + }, + "parameters": [ + "StaminaBar", + "<", + "100", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetValue" + }, + "parameters": [ + "StaminaBar", + "+", + "6 * TimeDelta()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "KeyReleased" + }, + "parameters": [ + "", + "LShift" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsReleased" + }, + "parameters": [ + "FastSwimButton", + "MultitouchButton", + "" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::Value" + }, + "parameters": [ + "StaminaBar", + "<=", + "0", + "" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::Speed" + }, + "parameters": [ + "Shark", + "TopDownMovement", + "=", + "0" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "AjoutObjConcern" + }, + "parameters": [ + "", + "Shark" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::MaxSpeed" + }, + "parameters": [ + "Shark", + "TopDownMovement", + "=", + "300" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::AngularMaxSpeed" + }, + "parameters": [ + "Shark", + "TopDownMovement", + "=", + "180" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "AnimatableCapability::AnimatableBehavior::Name" + }, + "parameters": [ + "Shark", + "Animation", + "=", + "\"Swim Bite\"" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::Speed" + }, + "parameters": [ + "Shark", + "TopDownMovement", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TopDownMovementBehavior::MaxSpeed" + }, + "parameters": [ + "Shark", + "TopDownMovement", + "<", + "500" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Shark", + "Animation", + "=", + "\"Swim\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TopDownMovementBehavior::MaxSpeed" + }, + "parameters": [ + "Shark", + "TopDownMovement", + "=", + "500" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Shark", + "Animation", + "=", + "\"Swim Fast\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Mobile movement" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" + }, + "parameters": [ + "MoveJoystick", + "\"Up\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Shark", + "TopDownMovement", + "MoveJoystick.StickAngle()", + "MoveJoystick.StickForce()" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetValue" + }, + "parameters": [ + "HealthBar", + "=", + "Shark.Health::Health()", + "" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Camera boundaries", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The left and right boundaries are oblique." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ClampCamera" + }, + "parameters": [ + "", + "LeftBoundary.X() + Shark.Y() / 2", + "TopBoundary.Y()", + "RightBoundary.X() - Shark.Y() / 2", + "BottomBoundary.Y()", + "", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Mines", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Mine", + "Object3D", + "+", + "0.5" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionNP" + }, + "parameters": [ + "Shark", + "Mine", + "", + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "RedExplosion", + "Mine.CenterX()", + "Mine.CenterY()", + "" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Mine", + "" + ] + }, + { + "type": { + "value": "CameraShake::ShakeCamera" + }, + "parameters": [ + "", + "2", + "0.5", + "2", + "" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::Shake" + }, + "parameters": [ + "Shark", + "ShakeModel3D", + "1", + "0.5", + "0.5", + "" + ] + }, + { + "type": { + "value": "Health::Health::Hit" + }, + "parameters": [ + "Shark", + "Health", + "40", + "no", + "no", + "" + ] + }, + { + "type": { + "value": "PlaySound" + }, + "parameters": [ + "", + "20c1edc1dad3064721fc9a0621345e2b79198fae67e5a31cc9c3145b6654ba90_Explosion 6.aac", + "", + "50", + "1" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::TweenTint" + }, + "parameters": [ + "Shark", + "Tween3D", + "\"Flash\"", + "\"208;65;58\"", + "0.2", + "\"easeOutQuad\"", + "" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.3" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::TweenTint" + }, + "parameters": [ + "Shark", + "Tween3D", + "\"Flash\"", + "\"255;255;255\"", + "0.2", + "\"easeInQuad\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::IgnoreDefaultControls" + }, + "parameters": [ + "Shark", + "TopDownMovement", + "yes" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "MoveJoystick", + "no", + "" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "1" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::IgnoreDefaultControls" + }, + "parameters": [ + "Shark", + "TopDownMovement", + "no" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "MoveJoystick", + "yes", + "" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Multiplier", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareTimer" + }, + "parameters": [ + "", + "\"MultiplierTimer\"", + ">=", + "5" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Multiplier", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "MultiplierText", + "Text", + "=", + "ToString(floor(Multiplier)) + \"X\"" + ] + }, + { + "type": { + "value": "SetCenterX" + }, + "parameters": [ + "MultiplierText", + "=", + "SceneWindowWidth() / 2" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "floor(Multiplier)", + "<", + "2" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "MultiplierText" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "floor(Multiplier)", + ">=", + "2" + ] + } + ], + "actions": [ + { + "type": { + "value": "Montre" + }, + "parameters": [ + "MultiplierText", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "PlaySound" + }, + "parameters": [ + "", + "MultiplierActive.aac", + "", + "20", + "1" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Fishes", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Spawn", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RepeatEveryXSeconds::Repeat" + }, + "parameters": [ + "", + "\"SpawnFish\"", + "60", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "IsOnScreen::InOnScreen::IsOnScreen" + }, + "parameters": [ + "FishSpawner", + "InOnScreen", + "200", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "FishSpawner", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "RandomInRange(6, 16)", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "SceneInstancesCount(Fish)", + "<", + "200" + ] + } + ], + "actions": [ + { + "type": { + "value": "CreateByName" + }, + "parameters": [ + "", + "Fish", + "FishSpawner.FishType", + "RandomInRange(FishSpawner.X() - 100, FishSpawner.X() + 100)", + "RandomInRange(FishSpawner.Y() - 100, FishSpawner.Y() + 100)", + "" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Disable fish behavior when they are off screen (for optimization)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RepeatEveryXSeconds::Repeat" + }, + "parameters": [ + "", + "\"Fish\"", + "1", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "IsOnScreen::InOnScreen::IsOnScreen" + }, + "parameters": [ + "Fish", + "InOnScreen", + "200", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Fish", + "BoidsMovement", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "IsOnScreen::InOnScreen::IsOnScreen" + }, + "parameters": [ + "Fish", + "InOnScreen", + "200", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Fish", + "BoidsMovement", + "no" + ] + } + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Danger fishes", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Distance" + }, + "parameters": [ + "Anglerfish", + "Shark", + "400", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::MoveToObject" + }, + "parameters": [ + "Anglerfish", + "BoidsMovement", + "Shark", + "30", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionNP" + }, + "parameters": [ + "DangerFish", + "Shark", + "", + "", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "DangerFish", + "Animation", + "=", + "\"Attack\"" + ] + }, + { + "type": { + "value": "PlaySound" + }, + "parameters": [ + "", + "Damage.wav", + "", + "100", + "1" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::Shake" + }, + "parameters": [ + "Shark", + "ShakeModel3D", + "1", + "0.5", + "0.5", + "" + ] + }, + { + "type": { + "value": "Health::Health::Hit" + }, + "parameters": [ + "Shark", + "Health", + "20", + "no", + "no", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "BloodParticleEmitter", + "DangerFish.X()", + "DangerFish.Y()", + "" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::TweenTint" + }, + "parameters": [ + "Shark", + "Tween3D", + "\"Flash\"", + "\"208;65;58\"", + "0.2", + "\"easeOutQuad\"", + "" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.3" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::TweenTint" + }, + "parameters": [ + "Shark", + "Tween3D", + "\"Flash\"", + "\"255;255;255\"", + "0.2", + "\"easeInQuad\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::Name" + }, + "parameters": [ + "DangerFish", + "Animation", + "=", + "\"Attack\"" + ] + }, + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::HasAnimationEnded" + }, + "parameters": [ + "DangerFish", + "Animation" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "DangerFish", + "Animation", + "=", + "\"Idle\"" + ] + } + ] + } + ], + "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionNP" + }, + "parameters": [ + "Fish", + "FishObstacles", + "100", + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PickNearest" + }, + "parameters": [ + "FishSpawner", + "Fish.X()", + "Fish.Y()", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::MoveToObject" + }, + "parameters": [ + "Fish", + "BoidsMovement", + "FishSpawner", + "100", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Fish", + "Object3D", + "=", + "Fish.Angle()" + ] + }, + { + "type": { + "value": "SeparateFromObjects" + }, + "parameters": [ + "Fish", + "FishObstacles", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Fish dodges shark" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Distance" + }, + "parameters": [ + "Fish", + "Shark", + "200", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::AvoidObject" + }, + "parameters": [ + "Fish", + "BoidsMovement", + "Shark", + "100", + "16", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Game over", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "LayerVisible" + }, + "parameters": [ + "", + "\"Game Over\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "Black", + "Opacity", + "=", + "100" + ] + }, + { + "type": { + "value": "RollingCounter::RollingCounter::SetValue" + }, + "parameters": [ + "GameOverScoreText", + "ScoreAnimation", + "=", + "Score", + "" + ] + }, + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "HighscoreScoreText", + "Text", + "=", + "\"Highscore: \" + Highscore" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Score", + ">", + "Highscore" + ] + } + ], + "actions": [ + { + "type": { + "value": "EcrireFichierExp" + }, + "parameters": [ + "\"Save\"", + "\"Highscore\"", + "Score" + ] + }, + { + "type": { + "value": "PlayerAuthentication::DisplayAuthenticationBanner" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::Activate" + }, + "parameters": [ + "SumbitScoreButton", + "yes", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" + }, + "parameters": [ + "SumbitScoreButton", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PlayerAuthentication::IsPlayerAuthenticated" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "await": true, + "value": "Leaderboards::SaveConnectedPlayerScore" + }, + "parameters": [ + "", + "\"8a96ea39-7db0-4e4e-8334-ab404ff58785\"", + "Score" + ] + }, + { + "type": { + "value": "Leaderboards::DisplayLeaderboard" + }, + "parameters": [ + "", + "\"8a96ea39-7db0-4e4e-8334-ab404ff58785\"", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PlayerAuthentication::IsPlayerAuthenticated" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "await": true, + "value": "PlayerAuthentication::OpenAuthenticationWindow" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "await": true, + "value": "Leaderboards::SaveConnectedPlayerScore" + }, + "parameters": [ + "", + "\"8a96ea39-7db0-4e4e-8334-ab404ff58785\"", + "Score" + ] + }, + { + "type": { + "value": "Leaderboards::DisplayLeaderboard" + }, + "parameters": [ + "", + "\"8a96ea39-7db0-4e4e-8334-ab404ff58785\"", + "yes" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Leaderboards::HasLastSaveErrored" + }, + "parameters": [ + "\"8a96ea39-7db0-4e4e-8334-ab404ff58785\"" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "PlayerAuthentication::DisplayAuthenticationBanner" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelText" + }, + "parameters": [ + "SumbitScoreButton", + "\"ERROR!\"", + "" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "5" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelText" + }, + "parameters": [ + "SumbitScoreButton", + "\"SUBMIT SCORE\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" + }, + "parameters": [ + "MenuButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlayerAuthentication::HideAuthenticationBanner" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "Scene" + }, + "parameters": [ + "", + "\"Menu\"", + "" + ] + } + ] + } + ] + } + ], + "parameters": [] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [ + { + "effectType": "Scene3D::HemisphereLight", + "name": "3D Light", + "doubleParameters": { + "elevation": 45, + "intensity": 1, + "rotation": 0 + }, + "stringParameters": { + "groundColor": "64;64;64", + "skyColor": "255;255;255", + "top": "Y-" + }, + "booleanParameters": {} + }, + { + "effectType": "Scene3D::AmbientLight", + "name": "Effect", + "doubleParameters": { + "intensity": 0.75 + }, + "stringParameters": { + "color": "255;255;255" + }, + "booleanParameters": {} + }, + { + "effectType": "Scene3D::ExponentialFog", + "name": "Effect3", + "doubleParameters": { + "density": 0.0005 + }, + "stringParameters": { + "color": "55;144;231" + }, + "booleanParameters": {} + } + ] + }, + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "UI", + "renderingType": "", + "visibility": true, + "cameras": [], + "effects": [ + { + "effectType": "Scene3D::HemisphereLight", + "name": "3D Light", + "doubleParameters": { + "elevation": 45, + "intensity": 1, + "rotation": 0 + }, + "stringParameters": { + "groundColor": "64;64;64", + "skyColor": "255;255;255", + "top": "Y-" + }, + "booleanParameters": {} + } + ] + }, + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "Game Over", + "renderingType": "", + "visibility": false, + "cameras": [], + "effects": [ + { + "effectType": "Scene3D::HemisphereLight", + "name": "3D Light", + "doubleParameters": { + "elevation": 45, + "intensity": 1, + "rotation": 0 + }, + "stringParameters": { + "groundColor": "64;64;64", + "skyColor": "255;255;255", + "top": "Y-" + }, + "booleanParameters": {} + } + ] + } + ], + "behaviorsSharedData": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior" + }, + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, + { + "name": "BoidsMovement", + "type": "BoidsMovement::BoidsMovement" + }, + { + "name": "Effect", + "type": "EffectCapability::EffectBehavior" + }, + { + "name": "Flippable", + "type": "FlippableCapability::FlippableBehavior" + }, + { + "name": "Health", + "type": "Health::Health" + }, + { + "name": "InOnScreen", + "type": "IsOnScreen::InOnScreen" + }, + { + "name": "MultitouchButton", + "type": "SpriteMultitouchJoystick::MultitouchButton" + }, + { + "name": "Object3D", + "type": "Scene3D::Base3DBehavior" + }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, + { + "name": "RepeatTimer", + "type": "RepeatEveryXSeconds::RepeatTimer" + }, + { + "name": "Resizable", + "type": "ResizableCapability::ResizableBehavior" + }, + { + "name": "Scale", + "type": "ScalableCapability::ScalableBehavior" + }, + { + "name": "ScoreAnimation", + "type": "RollingCounter::RollingCounter" + }, + { + "name": "ShakeModel3D", + "type": "ShakeObject3D::ShakeModel3D", + "EasingFactor": 3.3952047374e-313 + }, + { + "name": "SmoothCamera", + "type": "SmoothCamera::SmoothCamera" + }, + { + "name": "Sticker", + "type": "Sticker::Sticker" + }, + { + "name": "Text", + "type": "TextContainerCapability::TextContainerBehavior" + }, + { + "name": "TopDownMovement", + "type": "TopDownMovementBehavior::TopDownMovementBehavior" + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + }, + { + "name": "Tween3D", + "type": "Tween3D::Tween3D" + } + ] + } + ], + "externalEvents": [], + "eventsFunctionsExtensions": [ + { + "author": "", + "category": "Visual effect", + "extensionNamespace": "", + "fullName": "Advanced 3D tween", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXRlbm5pcy1iYWxsIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEyLDJDMTQuNSwyIDE2Ljc1LDIuOSAxOC41LDQuNEMxNi4zNiw2LjIzIDE1LDguOTYgMTUsMTJDMTUsMTUuMDQgMTYuMzYsMTcuNzcgMTguNSwxOS42QzE2Ljc1LDIxLjEgMTQuNSwyMiAxMiwyMkM5LjUsMjIgNy4yNSwyMS4xIDUuNSwxOS42QzcuNjQsMTcuNzcgOSwxNS4wNCA5LDEyQzksOC45NiA3LjY0LDYuMjMgNS41LDQuNEM3LjI1LDIuOSA5LjUsMiAxMiwyTTIyLDEyQzIyLDE0LjMyIDIxLjIxLDE2LjQ1IDE5Ljg4LDE4LjE1QzE4LjEyLDE2LjY4IDE3LDE0LjQ3IDE3LDEyQzE3LDkuNTMgMTguMTIsNy4zMiAxOS44OCw1Ljg1QzIxLjIxLDcuNTUgMjIsOS42OCAyMiwxMk0yLDEyQzIsOS42OCAyLjc5LDcuNTUgNC4xMiw1Ljg1QzUuODgsNy4zMiA3LDkuNTMgNywxMkM3LDE0LjQ3IDUuODgsMTYuNjggNC4xMiwxOC4xNUMyLjc5LDE2LjQ1IDIsMTQuMzIgMiwxMloiIC8+PC9zdmc+", + "name": "Tween3D", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/30bc03f9cf5f2f42960246a605352a6937ae6b603f0177396a83193849a4724a_tennis-ball.svg", + "shortDescription": "Smoothly squash, strentch, tint and wobble 3D models.", + "version": "0.2.0", + "description": [ + "Change 3D models proportions over time to make smooth animations like wobbling.", + "", + "It's used in this example:", + "* a 3D Bomberman-like game ([open the project online](https://editor.gdevelop.io/?project=example://3d-bomber-bunny))", + "", + "Breaking changes of 0.1.0:", + "- The Tween behavior is now required by the 3D Tween behavior. Add the Tween behavior on any object that uses the 3D Tween behavior" + ], + "origin": { + "identifier": "Tween3D", + "name": "gdevelop-extension-store" + }, + "tags": [ + "3d", + "tween", + "smooth", + "interpolation", + "wobble", + "color" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "dt0tRnf2kHWJnjkrpnzTzNj9Yc63" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Define helper classes JavaScript code.", + "fullName": "Define helper classes", + "functionType": "Action", + "name": "DefineHelperClasses", + "private": true, + "sentence": "Define helper classes JavaScript code", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (gdjs.__tween3DExtension) {", + " return;", + "}", + "", + "class Tint {", + " /**", + " * Materials by material `id`.", + " * @type {Map}", + " */", + " materials;", + " usageCount = 0;", + "", + " /**", + " * @param materials {Map}", + " */", + " constructor(materials) {", + " this.materials = materials;", + " }", + "", + " /**", + " * @param object {gdjs.RuntimeObject3D}", + " */", + " applyTo(object) {", + " object.get3DRendererObject().traverse((mesh) => {", + " if (mesh.material) {", + " const material = mesh.material;", + " const originalId = material.originalId || material.id;", + " const tintedMaterial = this.materials.get(originalId);", + " if (tintedMaterial) {", + " mesh.material = tintedMaterial;", + " }", + " }", + " });", + " }", + "", + " /**", + " * @param tintColor {number}", + " * @param originalTint {Tint}", + " */", + " setColor(tintColor, originalTint) {", + " const originalMaterials = originalTint.materials;", + " for (const [materialId, material] of this.materials) {", + " const originalColor = originalMaterials.get(materialId).color;", + " const color = material.color;", + " color.setHex(tintColor);", + " color.r *= originalColor.r;", + " color.g *= originalColor.g;", + " color.b *= originalColor.b;", + " }", + " }", + "", + " dispose() {", + " for (const material of this.materials.values()) {", + " material.dispose();", + " }", + " }", + "}", + "", + "class TintManager {", + " /**", + " * Tints by color hex.", + " * @type {Map}", + " */", + " tints = new Map();", + " /**", + " * Materials by material `id`.", + " * @type {Map}", + " */", + " originalTint;", + " /**", + " * @type {Array}", + " */", + " recycledTints = [];", + "", + " /**", + " * @param {gdjs.RuntimeObject3D} object", + " */", + " constructor(object) {", + " const materials = new Map();", + " object.get3DRendererObject().traverse((mesh) => {", + " if (mesh.material && mesh.material.color) {", + " const material = mesh.material;", + " materials.set(material.id, material);", + " }", + " });", + " this.originalTint = new Tint(materials);", + " }", + "", + " /**", + " * @param {gdjs.RuntimeObject3D} object", + " * @param {number} color", + " */", + " applyTint(object, color) {", + " const previousColor = this.getTint(object);", + " if (color === previousColor) {", + " return;", + " }", + " if (previousColor !== 0xffffff) {", + " const previousTint = this.tints.get(previousColor);", + " previousTint.usageCount--;", + " if (previousTint.usageCount === 0) {", + " this.tints.delete(previousColor);", + " this.recycledTints.push(previousTint);", + " }", + " }", + " let tint = color === 0xffffff ? this.originalTint : this.tints.get(color);", + " if (!tint) {", + " tint = this.createTint(object, color);", + " this.tints.set(color, tint);", + " }", + " tint.applyTo(object);", + " tint.usageCount++;", + " object.__tint3DExtension_tint = color;", + " }", + "", + " /**", + " * @param {gdjs.RuntimeObject3D} object", + " * @return {number}", + " */", + " getTint(object) {", + " return object.__tint3DExtension_tint === undefined ? 0xffffff : object.__tint3DExtension_tint;", + " }", + "", + " /**", + " * @param {gdjs.RuntimeObject3D} object", + " * @param {number} color", + " */", + " createTint(object, color) {", + " let tint;", + " if (this.recycledTints.length > 0) {", + " tint = this.recycledTints.pop();", + " tint.usageCount = 0;", + " }", + " else {", + " const materials = new Map();", + " object.get3DRendererObject().traverse((mesh) => {", + " if (mesh.material && mesh.material.color) {", + " const material = mesh.material;", + " const originalId = material.id;", + " if (materials.has(originalId)) {", + " // Meshes can share the same material.", + " return;", + " }", + " const tintedMaterial = mesh.material.clone();", + " tintedMaterial.originalId = originalId;", + " materials.set(originalId, tintedMaterial);", + " }", + " });", + " tint = new Tint(materials);", + " }", + " tint.setColor(color, this.originalTint);", + " return tint;", + " }", + "", + " dispose() {", + " for (const tint of this.tints.values()) {", + " tint.dispose();", + " }", + " this.tints.clear();", + " for (const tint of this.recycledTints) {", + " tint.dispose();", + " }", + " this.recycledTints.length = 0;", + " }", + "}", + "", + "gdjs.registerObjectDeletedFromSceneCallback(function (runtimeScene, deletedObject) {", + " const extension = runtimeScene.__tween3DExtension;", + " if (!extension) {", + " return;", + " }", + " const managers = extension.tintManagers;", + " const manager = managers.get(deletedObject.getName());", + " if (manager) {", + " manager.applyTint(deletedObject, 0xffffff);", + " }", + "});", + "", + "", + "/**", + " * @param {number} r", + " * @param {number} g", + " * @param {number} b", + " * @return {number[]}", + " */", + "const rgbToHsl = (r, g, b) => {", + " r /= 255;", + " g /= 255;", + " b /= 255;", + " let v = Math.max(r, g, b),", + " c = v - Math.min(r, g, b),", + " f = 1 - Math.abs(v + v - c - 1);", + " let h =", + " c &&", + " (v === r ? (g - b) / c : v === g ? 2 + (b - r) / c : 4 + (r - g) / c);", + " return [", + " Math.round(60 * (h < 0 ? h + 6 : h)),", + " Math.round((f ? c / f : 0) * 100),", + " Math.round(((v + v - c) / 2) * 100),", + " ];", + "};", + "", + "/**", + " * @param {number} h", + " * @param {number} s", + " * @param {number} l", + " * @return {number[]}", + " */", + "const hslToRgb = (h, s, l) => {", + " h = h %= 360;", + " if (h < 0) {", + " h += 360;", + " }", + " s = s / 100;", + " l = l / 100;", + " const a = s * Math.min(l, 1 - l);", + " const f = (n = 0, k = (n + h / 30) % 12) =>", + " l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);", + " return [", + " Math.round(f(0) * 255),", + " Math.round(f(8) * 255),", + " Math.round(f(4) * 255),", + " ];", + "};", + "", + "gdjs.__tween3DExtension = {", + " TintManager,", + " rgbToHsl,", + " hslToRgb,", + "};", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Change the tint of an object. The default color is white.", + "fullName": "Tint color", + "functionType": "Action", + "group": "Color", + "name": "SetTint", + "sentence": "Change tint of _PARAM1_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const color = gdjs.rgbOrHexStringToNumber(eventsFunctionContext.getArgument(\"Color\") || \"255; 255;255\");", + "", + "if (!runtimeScene.__tween3DExtension) {", + " runtimeScene.__tween3DExtension = {", + " tintManagers: new Map()", + " };", + "}", + "const { tintManagers } = runtimeScene.__tween3DExtension;", + "for (const object of objects) {", + " let manager = tintManagers.get(object.getName());", + " if (!manager) {", + " const { TintManager } = gdjs.__tween3DExtension;", + " manager = new TintManager(object);", + " tintManagers.set(object.getName(), manager);", + " }", + " manager.applyTint(object, color);", + "}", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Object capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Color", + "name": "Color", + "type": "color" + } + ], + "objectGroups": [] + }, + { + "description": "Change the tint of an object.", + "fullName": "Tint color (by number)", + "functionType": "Action", + "group": "Color", + "name": "SetTintNumber", + "private": true, + "sentence": "Change tint of _PARAM1_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const color = eventsFunctionContext.getArgument(\"Color\");", + "", + "if (!runtimeScene.__tween3DExtension) {", + " runtimeScene.__tween3DExtension = {", + " tintManagers: new Map()", + " };", + "}", + "const { tintManagers } = runtimeScene.__tween3DExtension;", + "for (const object of objects) {", + " let manager = tintManagers.get(object.getName());", + " if (!manager) {", + " const { TintManager } = gdjs.__tween3DExtension;", + " manager = new TintManager(object);", + " tintManagers.set(object.getName(), manager);", + " }", + " manager.applyTint(object, color);", + "}", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Object capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Color", + "name": "Color", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Blend two RGB colors by applying a weighted mean.", + "fullName": "Blend RGB colors", + "functionType": "Expression", + "name": "RgbMean", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const { rgbToHsl, hslToRgb } = gdjs.__tween3DExtension;", + "", + "const [r1, g1, b1] = gdjs.hexNumberToRGBArray(eventsFunctionContext.getArgument(\"Color1\"));", + "const [r2, g2, b2] = gdjs.hexNumberToRGBArray(eventsFunctionContext.getArgument(\"Color2\"));", + "const ratio = eventsFunctionContext.getArgument(\"Ratio\");", + "", + "const [h1, s1, l1] = rgbToHsl(r1, g1, b1);", + "const [h2, s2, l2] = rgbToHsl(r2, g2, b2);", + "", + "const h = h1 + ratio * (h2 - h1);", + "const s = s1 + ratio * (s2 - s1);", + "const l = l1 + ratio * (l2 - l1);", + "", + "const [r, g, b] = hslToRgb(h, s, l);", + "", + "eventsFunctionContext.returnValue = gdjs.rgbToHexNumber(r, g, b);", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "First RGB color", + "name": "Color1", + "type": "expression" + }, + { + "description": "Second RGB color", + "name": "Color2", + "type": "expression" + }, + { + "description": "Ratio", + "longDescription": "Range: 0 to 1, where 0 gives the first color and 1 gives the second color", + "name": "Ratio", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "RGB to number", + "functionType": "Expression", + "name": "RgbToNumber", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs.rgbOrHexStringToNumber(eventsFunctionContext.getArgument(\"Color\"));", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Color", + "name": "Color", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onSceneUnloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (!runtimeScene.__tween3DExtension) {", + " return;", + "}", + "const { tintManagers } = runtimeScene.__tween3DExtension;", + "", + "for (const manager of tintManagers.values()) {", + " manager.dispose();", + "}", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "the stretch on Z axis. The object volume is conserved. A stretch of 2 makes the object appear 2 times longer on Z in proportion to the dimensions on X and Y.", + "fullName": "Stretch on Z axis", + "functionType": "ExpressionAndCondition", + "name": "StretchZ", + "private": true, + "sentence": "the stretch on Z axis of _PARAM1_ (it no longer does anything, use the one from 3D tween behavior instead)", + "events": [], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "StretchZ", + "name": "SetStretchZ", + "private": true, + "sentence": "", + "events": [], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Stretch ratio", + "name": "StretchRatio", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the stretch on Y axis. The object volume is conserved. A stretch of 2 makes the object appear 2 times longer on Y in proportion to the dimensions on X and Z.", + "fullName": "Stretch on Y axis", + "functionType": "ExpressionAndCondition", + "name": "StretchY", + "private": true, + "sentence": "the stretch on Y axis of _PARAM1_ (it no longer does anything, use the one from 3D tween behavior instead)", + "events": [], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "StretchY", + "name": "SetStretchY", + "private": true, + "sentence": "", + "events": [], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Stretch ratio", + "name": "StretchRatio", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the scale volume.", + "fullName": "Scale volume", + "functionType": "ExpressionAndCondition", + "name": "ScaleVolume", + "private": true, + "sentence": "the scale volume of _PARAM1_ (it no longer does anything, use the one from 3D tween behavior instead)", + "events": [], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "ScaleVolume", + "name": "SetScaleVolume", + "private": true, + "sentence": "", + "events": [], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Stretch ratio", + "name": "StretchRatio", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Exponentially tween bewteen 2 values according to an easing function.", + "fullName": "Ease exponentially", + "functionType": "Expression", + "name": "EaseExp", + "private": true, + "sentence": "the exponent-tweened value of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "exp(Tween::Ease(GetArgumentAsString(\"Easing\"), log(GetArgumentAsNumber(\"InitialValue\")), log(GetArgumentAsNumber(\"TargetedValue\")), GetArgumentAsNumber(\"Weighting\")))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Easing", + "name": "Easing", + "type": "string" + }, + { + "description": "Initial value", + "name": "InitialValue", + "type": "expression" + }, + { + "description": "Targeted value", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Weighting", + "name": "Weighting", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Smoothly squash, strentch and tint 3D models.", + "fullName": "Advanced 3D tween", + "name": "Tween3D", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the stretch on Z axis. The object volume is conserved. A stretch of 2 makes the object appear 2 times longer on Z in proportion to the dimensions on X and Y.", + "fullName": "Stretch on Z axis", + "functionType": "ExpressionAndCondition", + "group": "Size", + "name": "StretchZ", + "sentence": "the stretch on Z axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Object3D::ScaleZ() / sqrt(Object.Scale::X() * Object.Scale::Y())" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "StretchZ", + "name": "SetStretchZ", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"Value\"", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Tween3D.Volume", + "=", + "Object.Behavior::ScaleVolume()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetScaleZ" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "pow(Variable(_Tween3D.Volume) * GetArgumentAsNumber(\"Value\") * GetArgumentAsNumber(\"Value\"), 1/3)" + ] + }, + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Tween3D.SurfaceRatio", + "=", + "sqrt((Variable(_Tween3D.Volume) / Object.Object3D::ScaleZ()) / (Object.Scale::X() * Object.Scale::Y()))" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetX" + }, + "parameters": [ + "Object", + "Scale", + "*", + "Variable(_Tween3D.SurfaceRatio)" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetY" + }, + "parameters": [ + "Object", + "Scale", + "*", + "Variable(_Tween3D.SurfaceRatio)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Stretch ratio", + "name": "StretchRatio", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the stretch on Y axis. The object volume is conserved. A stretch of 2 makes the object appear 2 times longer on Y in proportion to the dimensions on X and Z.", + "fullName": "Stretch on Y axis", + "functionType": "ExpressionAndCondition", + "group": "Size", + "name": "StretchY", + "sentence": "the stretch on Y axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Scale::Y() / sqrt(Object.Scale::X() * Object.Object3D::ScaleZ())" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "StretchY", + "name": "SetStretchY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"Value\"", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Tween3D.Volume", + "=", + "Object.Behavior::ScaleVolume()" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetY" + }, + "parameters": [ + "Object", + "Scale", + "=", + "pow(Variable(_Tween3D.Volume) * GetArgumentAsNumber(\"Value\") * GetArgumentAsNumber(\"Value\"), 1/3)" + ] + }, + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Tween3D.SurfaceRatio", + "=", + "sqrt((Variable(_Tween3D.Volume) / Object.Object3D::ScaleZ()) / (Object.Scale::X() * Object.Scale::Y()))" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetX" + }, + "parameters": [ + "Object", + "Scale", + "*", + "Variable(_Tween3D.SurfaceRatio)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetScaleZ" + }, + "parameters": [ + "Object", + "Object3D", + "*", + "Variable(_Tween3D.SurfaceRatio)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Stretch ratio", + "name": "StretchRatio", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the scale volume.", + "fullName": "Scale volume", + "functionType": "ExpressionAndCondition", + "group": "Size", + "name": "ScaleVolume", + "sentence": "the scale volume", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Scale::X() * Object.Scale::Y() * Object.Object3D::ScaleZ()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "ScaleVolume", + "name": "SetScaleVolume", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"Value\"", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Tween3D.Ratio", + "=", + "pow(GetArgumentAsNumber(\"Value\") / Object.Behavior::ScaleVolume(), 1 / 3)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetScaleZ" + }, + "parameters": [ + "Object", + "Object3D", + "*", + "Variable(_Tween3D.Ratio)" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetY" + }, + "parameters": [ + "Object", + "Scale", + "*", + "Variable(_Tween3D.Ratio)" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetX" + }, + "parameters": [ + "Object", + "Scale", + "*", + "Variable(_Tween3D.Ratio)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Stretch ratio", + "name": "StretchRatio", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the color of a 3d object.", + "fullName": "Color of a 3d object", + "functionType": "Expression", + "group": "Color", + "name": "Tint", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (!runtimeScene.__tween3DExtension) {", + " runtimeScene.__tween3DExtension = {", + " tintManagers: new Map()", + " };", + "}", + "const { tintManagers } = runtimeScene.__tween3DExtension;", + "if (objects.length === 0) {", + " eventsFunctionContext.returnValue = 0xffffff;", + "}", + "else {", + " const object = objects[0];", + " let manager = tintManagers.get(object.getName());", + " if (!manager) {", + " const { TintManager } = gdjs.__tween3DExtension;", + " manager = new TintManager(object);", + " tintManagers.set(object.getName(), manager);", + " }", + " eventsFunctionContext.returnValue = manager.getTint(object);", + "}", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object stretch Z from its current value to a new one. The stretch can never be 0 or less.", + "fullName": "Tween stretch Z", + "functionType": "Action", + "group": "Size", + "name": "TweenStretchZ", + "sentence": "Tween the stretch Z of _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::StartTween" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsNumber(\"Duration\")", + "GetArgumentAsString(\"Easing\")", + "\"StretchZ\"", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Stretch on Z axis", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object stretch Y from its current value to a new one. The stretch can never be 0 or less.", + "fullName": "Tween stretch Y", + "functionType": "Action", + "group": "Size", + "name": "TweenStretchY", + "sentence": "Tween the stretch Y of _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::StartTween" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsNumber(\"Duration\")", + "GetArgumentAsString(\"Easing\")", + "\"StretchY\"", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Stretch on Y axis", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object scale volume from its current value to a new one. The scale volume can never be 0 or less.", + "fullName": "Tween scale volume", + "functionType": "Action", + "group": "Size", + "name": "TweenScaleVolume", + "sentence": "Tween the scale volume of _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::StartTween" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsNumber(\"Duration\")", + "GetArgumentAsString(\"Easing\")", + "\"ScaleVolume\"", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Scale volume", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens the object color from its current value to a new one.", + "fullName": "Tween object color", + "functionType": "Action", + "group": "Color", + "name": "TweenTint", + "sentence": "Tween the color of _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::StartTween" + }, + "parameters": [ + "Object", + "Behavior", + "TweenIdentifier", + "Tween3D::RgbToNumber(TargetedValue)", + "Duration", + "Easing", + "\"Tint\"", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Color", + "name": "TargetedValue", + "type": "color" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object Z position from its current value to a new one.", + "fullName": "Tween Z position (deprecated)", + "functionType": "Action", + "group": "Position", + "name": "TweenPositionZ", + "private": true, + "sentence": "Tween the Z position of object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectPositionZTween2" + }, + "parameters": [ + "Object", + "Tween", + "Object3D", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsString(\"Easing\")", + "GetArgumentAsNumber(\"Duration\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Rotation X in degree", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object depth from its current value to a new one.", + "fullName": "Tween depth (Z size) (deprecated)", + "functionType": "Action", + "group": "Position", + "name": "TweenDepth", + "private": true, + "sentence": "Tween the depth of object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectDepthTween2" + }, + "parameters": [ + "Object", + "Tween", + "Object3D", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsString(\"Easing\")", + "GetArgumentAsNumber(\"Duration\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Rotation X in degree", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object X rotation from its current value to a new one.", + "fullName": "Tween X rotation (deprecated)", + "functionType": "Action", + "group": "Angle", + "name": "TweenRotationX", + "private": true, + "sentence": "Tween the X rotation of object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::TweenBehavior::AddObjectRotationXTween" + }, + "parameters": [ + "Object", + "Tween", + "Object3D", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsString(\"Easing\")", + "GetArgumentAsNumber(\"Duration\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Rotation X in degree", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object Y rotation from its current value to a new one.", + "fullName": "Tween rotation Y (deprecated)", + "functionType": "Action", + "group": "Angle", + "name": "TweenRotationY", + "private": true, + "sentence": "Tween the Y rotation of object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::TweenBehavior::AddObjectRotationYTween" + }, + "parameters": [ + "Object", + "Tween", + "Object3D", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsString(\"Easing\")", + "GetArgumentAsNumber(\"Duration\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Rotation Y in degree", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Tween3D.Index", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "Object.VariableChildCount(_Tween3D.Tweens)", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarSceneTxt" + }, + "parameters": [ + "_Tween3D.Identifier", + "=", + "Object.Behavior::TweenIdentifier(Variable(_Tween3D.Index))" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::IsPlaying" + }, + "parameters": [ + "Object", + "Behavior", + "VariableString(_Tween3D.Identifier)", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(Object.Behavior::Time(VariableString(_Tween3D.Identifier)) + TimeDelta() * LayerTimeScale(Object.Layer()), Object.Behavior::Duration(VariableString(_Tween3D.Identifier)))", + "VariableString(_Tween3D.Identifier)", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Type" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"StretchZ\"", + "VariableString(_Tween3D.Identifier)", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetStretchZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::ExponentTweenedValue(VariableString(_Tween3D.Identifier))", + "Object3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Type" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"StretchY\"", + "VariableString(_Tween3D.Identifier)", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetStretchY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::ExponentTweenedValue(VariableString(_Tween3D.Identifier))", + "Object3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Type" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"ScaleVolume\"", + "VariableString(_Tween3D.Identifier)", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetScaleVolume" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::ExponentTweenedValue(VariableString(_Tween3D.Identifier))", + "Object3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Type" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Tint\"", + "VariableString(_Tween3D.Identifier)", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::SetTintNumber" + }, + "parameters": [ + "Object", + "Object", + "Object3D", + "Object.Behavior::TweenedColor(VariableString(_Tween3D.Identifier))", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Tween3D.Index", + "+", + "1" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the tweened value", + "fullName": "Tweened value", + "functionType": "ExpressionAndCondition", + "name": "TweenedValue", + "private": true, + "sentence": "the value of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Tween::Ease(Object.Behavior::Easing(VariableString(_Tween3D.Identifier)), Object.Behavior::InitialValue(VariableString(_Tween3D.Identifier)), Object.Behavior::TargetedValue(VariableString(_Tween3D.Identifier)), Object.Behavior::Progress(VariableString(_Tween3D.Identifier)))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the tweened color", + "fullName": "Tweened color", + "functionType": "ExpressionAndCondition", + "name": "TweenedColor", + "private": true, + "sentence": "the color value of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Tween3D::RgbMean(Object.Behavior::InitialValue(VariableString(_Tween3D.Identifier)), Object.Behavior::TargetedValue(VariableString(_Tween3D.Identifier)), \nTween::Ease(Object.Behavior::Easing(VariableString(_Tween3D.Identifier)), 0, 1, Object.Behavior::Progress(VariableString(_Tween3D.Identifier))))\n\n" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the exponent-tweened value", + "fullName": "Tweened value (exponent)", + "functionType": "ExpressionAndCondition", + "name": "ExponentTweenedValue", + "private": true, + "sentence": "the exponent-tweened value of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Tween3D::EaseExp(Object.Behavior::Easing(VariableString(_Tween3D.Identifier)), Object.Behavior::InitialValue(VariableString(_Tween3D.Identifier)), Object.Behavior::TargetedValue(VariableString(_Tween3D.Identifier)), Object.Behavior::Progress(VariableString(_Tween3D.Identifier)))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "fullName": "Start tween", + "functionType": "Action", + "name": "StartTween", + "private": true, + "sentence": "Tween the _PARAM6_ of object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with _PARAM5_ easing as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Tween3D::Tween3D::Exists" + }, + "parameters": [ + "Object", + "Behavior", + "TweenIdentifier", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::InvalidateTweenIdentifiers" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0", + "TweenIdentifier", + "" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::SetType" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Type", + "TweenIdentifier", + "" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::SetDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Duration", + "TweenIdentifier", + "" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::SetEasing" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Easing", + "TweenIdentifier", + "" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::SetTargetedValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "TargetedValue", + "TweenIdentifier", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Type\"", + "=", + "\"StretchZ\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::StretchZ()", + "TweenIdentifier", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Type\"", + "=", + "\"StretchY\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::StretchY()", + "TweenIdentifier", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Type\"", + "=", + "\"ScaleVolume\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::ScaleVolume()", + "TweenIdentifier", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Type\"", + "=", + "\"Tint\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::Tint()", + "TweenIdentifier", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Stretch", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + }, + { + "description": "Type", + "name": "Type", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "the tween type", + "fullName": "Type", + "functionType": "ExpressionAndCondition", + "name": "Type", + "private": true, + "sentence": "the type of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.VariableString(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Type)" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Type", + "name": "SetType", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjetTxt" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Type", + "=", + "GetArgumentAsString(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the elapsed time", + "fullName": "Time", + "functionType": "ExpressionAndCondition", + "name": "Time", + "private": true, + "sentence": "the elapsed time of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Variable(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Time)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Time", + "name": "SetTime", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Time", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the tween duration", + "fullName": "Duration", + "functionType": "ExpressionAndCondition", + "name": "Duration", + "private": true, + "sentence": "the duration of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Variable(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Duration)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Duration", + "name": "SetDuration", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Duration", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the tween easing", + "fullName": "Easing", + "functionType": "ExpressionAndCondition", + "name": "Easing", + "private": true, + "sentence": "the easing of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.VariableString(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Easing)" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Easing", + "name": "SetEasing", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjetTxt" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Easing", + "=", + "GetArgumentAsString(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the tween initial value", + "fullName": "Initial value", + "functionType": "ExpressionAndCondition", + "name": "InitialValue", + "private": true, + "sentence": "the initial value of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Variable(_Tween3D.Tweens[TweenIdentifier].InitialValue)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "InitialValue", + "name": "SetInitialValue", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[TweenIdentifier].InitialValue", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the tween targeted value", + "fullName": "Targeted value", + "functionType": "ExpressionAndCondition", + "name": "TargetedValue", + "private": true, + "sentence": "the targeted value of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Variable(_Tween3D.Tweens[TweenIdentifier].TargetedValue)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "TargetedValue", + "name": "SetTargetedValue", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[TweenIdentifier].TargetedValue", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the tween is paused", + "fullName": "Paused", + "functionType": "Condition", + "name": "IsPaused", + "private": true, + "sentence": "The tween _PARAM2_ of _PARAM0_ is paused", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].IsPaused", + "True" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Change if the tween is paused", + "fullName": "Paused", + "functionType": "Action", + "name": "SetPaused", + "private": true, + "sentence": "The tween _PARAM2_ of _PARAM0_ is paused: _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"IsPaused\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].IsPaused", + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"IsPaused\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].IsPaused", + "False" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Paused", + "name": "IsPaused", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Stop the running tween animation.", + "fullName": "Stop a tween", + "functionType": "Action", + "name": "StopTween", + "sentence": "Stop the tween _PARAM2_ on _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Exists" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::Duration(GetArgumentAsString(\"TweenIdentifier\"))", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"JumpToEnd\"" + ] + } + ], + "actions": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Jump to end", + "name": "JumpToEnd", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Pause the running tween animation.", + "fullName": "Pause a tween", + "functionType": "Action", + "name": "PauseTween", + "sentence": "Pause the tween _PARAM2_ on _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Exists" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetPaused" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "yes", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Resume the tween animation.", + "fullName": "Resume a tween", + "functionType": "Action", + "name": "ResumeTween", + "sentence": "Resume the tween _PARAM2_ on _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Exists" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetPaused" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "no", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Remove the tween animation from the object.", + "fullName": "Remove a tween", + "functionType": "Action", + "name": "RemoveTween", + "sentence": "Remove the tween _PARAM2_ from _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Exists" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ObjectVariableRemoveChild" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens", + "GetArgumentAsString(\"TweenIdentifier\")" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::InvalidateTweenIdentifiers" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the tween animation exists.", + "fullName": "Tween exists", + "functionType": "Condition", + "name": "Exists", + "sentence": "Tween _PARAM2_ on _PARAM0_ exists", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableChildExists" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens", + "GetArgumentAsString(\"TweenIdentifier\")" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the tween animation is currently playing.", + "fullName": "Tween is playing", + "functionType": "Condition", + "name": "IsPlaying", + "sentence": "Tween _PARAM2_ on _PARAM0_ is playing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Exists" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "Tween3D::Tween3D::HasFinished" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "Tween3D::Tween3D::IsPaused" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the tween animation has finished playing.", + "fullName": "Tween finished playing", + "functionType": "Condition", + "name": "HasFinished", + "sentence": "Tween _PARAM2_ on _PARAM0_ has finished playing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Progress" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "1", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the progress of a tween (between 0.0 and 1.0).", + "fullName": "Progress of a tween", + "functionType": "ExpressionAndCondition", + "name": "Progress", + "sentence": "the progress of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Exists" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::Time(GetArgumentAsString(\"TweenIdentifier\")) / Object.Behavior::Duration(GetArgumentAsString(\"TweenIdentifier\"))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Return the tween identifier for a given index.", + "fullName": "Tween identifier", + "functionType": "StringExpression", + "name": "TweenIdentifier", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "", + "const childIndex = eventsFunctionContext.getArgument(\"ChildIndex\");", + "", + "object.__Tween3D = object.__Tween3D || {};", + "object.__Tween3D.variableIdentifiers =", + " object.__Tween3D.variableIdentifiers", + " || Object.keys(object.getVariables().get(\"_Tween3D\").getChild(\"Tweens\").getAllChildren());", + "", + "eventsFunctionContext.returnValue = object.__Tween3D.variableIdentifiers[childIndex];", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Child index", + "name": "ChildIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Invalidate tween identifiers.", + "fullName": "Invalidate tween identifiers", + "functionType": "Action", + "name": "InvalidateTweenIdentifiers", + "private": true, + "sentence": "Invalidate tween identifiers of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "", + "object.__Tween3D = object.__Tween3D || {};", + "object.__Tween3D.variableIdentifiers = null;", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "description": "", + "group": "", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "name": "Object3D" + }, + { + "value": "", + "type": "Behavior", + "label": "Scalable capacity", + "description": "", + "group": "", + "extraInformation": [ + "ScalableCapability::ScalableBehavior" + ], + "name": "Scale" + }, + { + "value": "", + "type": "Behavior", + "label": "Tween", + "description": "", + "group": "", + "extraInformation": [ + "Tween::TweenBehavior" + ], + "name": "Tween" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Squash and stretch a 3D model in loop.", + "fullName": "3D wobble", + "name": "Wobble", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::UpdateScaleVolume" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::UpdateStretch" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Tween", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Wobble::PropertyScaleMinTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "Object.Behavior::PropertyScaleMinTweenDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMinTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Object.Behavior::TimeDelta()" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Tween3D::EaseExp(Object.Behavior::PropertyScaleMinTweenEasing(), Object.Behavior::PropertyScaleMinTweenInitialValue(), Object.Behavior::PropertyScaleMinTweenTarget(), Object.Behavior::PropertyScaleMinTweenTime() / Object.Behavior::PropertyScaleMinTweenDuration())" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Wobble::PropertyScaleMinTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "Object.Behavior::PropertyScaleMinTweenDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyScaleMinTweenTarget()" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Wobble::PropertyScaleMaxTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "Object.Behavior::PropertyScaleMaxTweenDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMaxTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Object.Behavior::TimeDelta()" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Tween3D::EaseExp(Object.Behavior::PropertyScaleMaxTweenEasing(), Object.Behavior::PropertyScaleMaxTweenInitialValue(), Object.Behavior::PropertyScaleMaxTweenTarget(), Object.Behavior::PropertyScaleMaxTweenTime() / Object.Behavior::PropertyScaleMaxTweenDuration())" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Wobble::PropertyScaleMaxTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "Object.Behavior::PropertyScaleMaxTweenDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyScaleMinTweenTarget()" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Wobble", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::UpdateScaleVolume" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::UpdateStretch" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyAngle" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "mod(Object.Behavior::TimeDelta() * 2 * Pi()\n / Object.Behavior::PropertyPeriodDuration(), 2 * Pi())" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the minimum scale volume of the object.", + "fullName": "Minimum scale volume", + "functionType": "ExpressionAndCondition", + "group": "3D wobble scale configuration", + "name": "ScaleMin", + "sentence": "the minimum scale volume", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyScaleMin()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ScaleMin", + "name": "SetScaleMin", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum scale volume of the object.", + "fullName": "Maximum scale volume", + "functionType": "ExpressionAndCondition", + "group": "3D wobble scale configuration", + "name": "ScaleMax", + "sentence": "the maximum scale volume", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyScaleMax()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ScaleMax", + "name": "SetScaleMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens the minimum scale volume from its current value to a new one. The scale volume can never be 0 or less.", + "fullName": "Tween minimum scale volume", + "functionType": "Action", + "group": "3D wobble scale configuration", + "name": "TweenScaleMin", + "sentence": "Tween the minimum scale volume of object _PARAM0_ to _PARAM2_ over _PARAM3_ seconds with _PARAM4_ easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMinTweenInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::ScaleMin()" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMinTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMinTweenTarget" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"TargetedValue\")" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMinTweenDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Duration\")" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMinTweenEasing" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"Easing\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + }, + { + "description": "Minimum scale volume", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens the maximum scale volume from its current value to a new one. The scale volume can never be 0 or less.", + "fullName": "Tween maximum scale volume", + "functionType": "Action", + "group": "3D wobble scale configuration", + "name": "TweenScaleMax", + "sentence": "Tween the maximum scale volume of object _PARAM0_ to _PARAM2_ over _PARAM3_ seconds with _PARAM4_ easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMaxTweenInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::ScaleMax()" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMaxTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMaxTweenTarget" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"TargetedValue\")" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMaxTweenDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Duration\")" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMaxTweenEasing" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"Easing\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + }, + { + "description": "Maximum scale volume", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "fullName": "Time delta", + "functionType": "Expression", + "name": "TimeDelta", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TimeDelta() * LayerTimeScale(Object.Layer())" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Update scale volume", + "functionType": "Action", + "name": "UpdateScaleVolume", + "private": true, + "sentence": "Update scale volume of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetScaleVolume" + }, + "parameters": [ + "Object", + "Tween3D", + "=", + "exp(log(Object.Behavior::PropertyScaleMin()) + (log(Object.Behavior::PropertyScaleMax()) - log(Object.Behavior::PropertyScaleMin())) * sin(Object.Behavior::PropertyAngle() + Object.Behavior::PropertyScalePeriodOffset() / Object.Behavior::PropertyPeriodDuration() * 2 * Pi()))", + "Object3D" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Update stretch", + "functionType": "Action", + "name": "UpdateStretch", + "private": true, + "sentence": "Update stretch of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Wobble::PropertyTop" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Z+\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetStretchZ" + }, + "parameters": [ + "Object", + "Tween3D", + "=", + "exp(log(Object.Behavior::PropertyStretchMin()) + (log(Object.Behavior::PropertyStretchMax()) - log(Object.Behavior::PropertyStretchMin())) * sin(Object.Behavior::PropertyAngle() + Object.Behavior::PropertyStretchPeriodOffset() / Object.Behavior::PropertyPeriodDuration() * 2 * Pi()))", + "Object3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Wobble::PropertyTop" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Y-\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetStretchY" + }, + "parameters": [ + "Object", + "Tween3D", + "=", + "exp(log(Object.Behavior::PropertyStretchMin()) + (log(Object.Behavior::PropertyStretchMax()) - log(Object.Behavior::PropertyStretchMin())) * sin(Object.Behavior::PropertyAngle() + Object.Behavior::PropertyStretchPeriodOffset() / Object.Behavior::PropertyPeriodDuration() * 2 * Pi()))", + "Object3D" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the cycle duration of the object.", + "fullName": "Cycle duration", + "functionType": "ExpressionAndCondition", + "group": "3D wobble configuration", + "name": "PeriodDuration", + "sentence": "the cycle duration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyPeriodDuration()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "PeriodDuration", + "name": "SetPeriodDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyPeriodDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the scale cycle offset of the object.", + "fullName": "Scale cycle offset", + "functionType": "ExpressionAndCondition", + "group": "3D wobble scale configuration", + "name": "ScalePeriodOffset", + "sentence": "the scale cycle offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyScalePeriodOffset()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ScalePeriodOffset", + "name": "SetScalePeriodOffset", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScalePeriodOffset" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the minimum stretch of the object.", + "fullName": "Minimum stretch", + "functionType": "ExpressionAndCondition", + "group": "3D wobble stretch configuration", + "name": "StretchMin", + "sentence": "the minimum stretch", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyStretchMin()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StretchMin", + "name": "SetStretchMin", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyStretchMin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum stretch of the object.", + "fullName": "Maximum stretch", + "functionType": "ExpressionAndCondition", + "group": "3D wobble stretch configuration", + "name": "StretchMax", + "sentence": "the maximum stretch", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyStretchMax()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StretchMax", + "name": "SetStretchMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyStretchMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the stretch cycle offset of the object.", + "fullName": "Stretch cycle offset", + "functionType": "ExpressionAndCondition", + "group": "3D wobble stretch configuration", + "name": "StretchPeriodOffset", + "sentence": "the stretch cycle offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyStretchPeriodOffset()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StretchPeriodOffset", + "name": "SetStretchPeriodOffset", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyStretchPeriodOffset" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0.75", + "type": "Number", + "unit": "Dimensionless", + "label": "Minimum scale volume", + "description": "", + "group": "Scale", + "extraInformation": [], + "name": "ScaleMin" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Maximum scale volume", + "description": "", + "group": "Scale", + "extraInformation": [], + "name": "ScaleMax" + }, + { + "value": "1", + "type": "Number", + "unit": "Second", + "label": "Cycle duration", + "description": "", + "group": "", + "extraInformation": [], + "name": "PeriodDuration" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Scale cycle offset", + "description": "", + "group": "Scale", + "extraInformation": [], + "name": "ScalePeriodOffset" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Minimum stretch", + "description": "", + "group": "Stretch", + "extraInformation": [], + "name": "StretchMin" + }, + { + "value": "1.25", + "type": "Number", + "unit": "Dimensionless", + "label": "Maximum stretch", + "description": "", + "group": "Stretch", + "extraInformation": [], + "name": "StretchMax" + }, + { + "value": "-0.25", + "type": "Number", + "unit": "Second", + "label": "Stretch cycle offset", + "description": "", + "group": "Stretch", + "extraInformation": [], + "name": "StretchPeriodOffset" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Angle" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMinTweenTarget" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMinTweenDuration" + }, + { + "value": "", + "type": "String", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMinTweenEasing" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMaxTweenTarget" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMaxTweenDuration" + }, + { + "value": "", + "type": "String", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMaxTweenEasing" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMinTweenTime" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMaxTweenTime" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMinTweenInitialValue" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMaxTweenInitialValue" + }, + { + "value": "Z+", + "type": "Choice", + "label": "Top orientation", + "description": "", + "group": "", + "extraInformation": [ + "Z+", + "Y-" + ], + "name": "Top" + }, + { + "value": "", + "type": "Behavior", + "label": "3D tween", + "description": "", + "group": "", + "extraInformation": [ + "Tween3D::Tween3D" + ], + "name": "Tween3D" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "D8H", + "category": "Movement", + "extensionNamespace": "", + "fullName": "Stick objects to others", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXN0aWNrZXItb3V0bGluZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik01LjUgMkMzLjYgMiAyIDMuNiAyIDUuNVYxOC41QzIgMjAuNCAzLjYgMjIgNS41IDIySDE2TDIyIDE2VjUuNUMyMiAzLjYgMjAuNCAyIDE4LjUgMkg1LjVNNS44IDRIMTguM0MxOS4zIDQgMjAuMSA0LjggMjAuMSA1LjhWMTVIMTguNkMxNi43IDE1IDE1LjEgMTYuNiAxNS4xIDE4LjVWMjBINS44QzQuOCAyMCA0IDE5LjIgNCAxOC4yVjUuOEM0IDQuOCA0LjggNCA1LjggNCIgLz48L3N2Zz4=", + "name": "Sticker", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/sticker-outline.svg", + "shortDescription": "Make objects follow the position and rotation of the object they are stuck to.", + "version": "0.5.1", + "description": [ + "This extension can be useful to:", + "* Stick accessories to moving objects", + "* Animate a skeleton", + "* Delete an object with another one", + "", + "An example allows to check it out ([open the project online](https://editor.gdevelop.io/?project=example://stick-objects))." + ], + "origin": { + "identifier": "Sticker", + "name": "gdevelop-extension-store" + }, + "tags": [ + "sticker", + "stick", + "follow", + "skeleton", + "joint", + "pin", + "bind", + "glue", + "tie", + "attach", + "hold", + "paste", + "wear" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Define helper classes JavaScript code.", + "fullName": "Define helper classes", + "functionType": "Action", + "name": "DefineHelperClasses", + "private": true, + "sentence": "Define helper classes JavaScript code", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (gdjs._stickerExtension) {", + " return;", + "}", + "", + "// Unstick from deleted objects.", + "gdjs.registerObjectDeletedFromSceneCallback(function (runtimeScene, deletedObject) {", + " const extension = runtimeScene._stickerExtension;", + " if (!extension) {", + " return;", + " }", + " const allStickers = runtimeScene._stickerExtension.allStickers;", + " for (const behavior of allStickers) {", + " const sticker = behavior._sticker;", + " if (sticker.isStuckTo(deletedObject)) {", + " if (behavior._getIsDestroyedWithParent()) {", + " behavior.owner.deleteFromScene(runtimeScene);", + " }", + " sticker.unstick();", + " }", + " }", + "});", + "", + "class Sticker {", + " /** @type {gdjs.RuntimeBehavior} */", + " behavior;", + " /** @type {gdjs.RuntimeObject | null} */", + " basisObject;", + " followingDoneThisFrame = false;", + " relativeX = 0;", + " relativeY = 0;", + " relativeAngle = 0;", + " relativeRotatedX = 0;", + " relativeRotatedY = 0;", + " basisOldX = 0;", + " basisOldY = 0;", + " basisOldAngle = 0;", + " basisOldWidth = 0;", + " basisOldHeight = 0;", + " basisOldCenterXInScene = 0;", + " basisOldCenterYInScene = 0;", + "", + " /**", + " * @param {gdjs.RuntimeBehavior} behavior", + " */", + " constructor(behavior) {", + " this.behavior = behavior;", + " }", + "", + " /**", + " * @param {gdjs.RuntimeObject} basisObject", + " */", + " isStuckTo(basisObject) {", + " return this.basisObject === basisObject;", + " }", + "", + " /**", + " * @param {gdjs.RuntimeObject} basisObject", + " */", + " stickTo(basisObject) {", + " this.basisObject = basisObject;", + " this.updateOldCoordinates();", + " this.updateRelativeCoordinates();", + " }", + "", + " unstick() {", + " this.basisObject = null;", + " }", + "", + " onStepPreEvents() {", + " this.followingDoneThisFrame = false;", + " }", + "", + " /**", + " * Update the coordinates in the basisObject basis.", + " * ", + " * It uses the basisObject coordinates from the previous frame.", + " * This way, the sticker can move relatively to it and still", + " * follow basisObject.", + " * ", + " * @param {gdjs.RuntimeObject} basisObject", + " */", + " updateRelativeCoordinates() {", + " const object = this.behavior.owner;", + "", + " // Update relative coordinates", + " this.relativeX = object.getX() - this.basisOldX;", + " this.relativeY = object.getY() - this.basisOldY;", + " if (!this.behavior._getOnlyFollowPosition()) {", + " this.relativeAngle = object.getAngle() - this.basisOldAngle;", + " this.relativeWidth = object.getWidth() / this.basisOldWidth;", + " this.relativeHeight = object.getHeight() / this.basisOldHeight;", + " const deltaX = object.getCenterXInScene() - this.basisOldCenterXInScene;", + " const deltaY = object.getCenterYInScene() - this.basisOldCenterYInScene;", + " const angle = this.basisOldAngle * Math.PI / 180;", + " this.relativeRotatedX = (deltaX * Math.cos(angle) + deltaY * Math.sin(angle)) / this.basisOldWidth;", + " this.relativeRotatedY = (-deltaX * Math.sin(angle) + deltaY * Math.cos(angle)) / this.basisOldHeight;", + "", + " // Save initial values to avoid calculus and rounding errors", + " this.basisOriginalWidth = this.basisObject.getWidth();", + " this.basisOriginalHeight = this.basisObject.getHeight();", + " this.basisOriginalAngle = this.basisObject.getAngle();", + " }", + " }", + "", + " /**", + " * Copy the coordinates to use it the next frame.", + " */", + " updateOldCoordinates() {", + " const object = this.behavior.owner;", + "", + " this.ownerOldX = object.getX();", + " this.ownerOldY = object.getY();", + "", + " this.basisOldX = this.basisObject.getX();", + " this.basisOldY = this.basisObject.getY();", + "", + " if (!this.behavior._getOnlyFollowPosition()) {", + " this.ownerOldAngle = object.getAngle();", + " this.ownerOldWidth = object.getWidth();", + " this.ownerOldHeight = object.getHeight();", + "", + " this.basisOldAngle = this.basisObject.getAngle();", + " this.basisOldWidth = this.basisObject.getWidth();", + " this.basisOldHeight = this.basisObject.getHeight();", + " this.basisOldCenterXInScene = this.basisObject.getCenterXInScene();", + " this.basisOldCenterYInScene = this.basisObject.getCenterYInScene();", + " }", + " }", + "", + " /**", + " * Follow the basisObject (called in doStepPostEvents).", + " * ", + " * This method is also called by children to ensure", + " * parents are updated first.", + " */", + " followBasisObject() {", + " if (this.followingDoneThisFrame) {", + " return;", + " }", + " this.followingDoneThisFrame = true;", + " const basisObject = this.basisObject;", + " if (basisObject) {", + " // If the behavior on the basis object has a different name,", + " // the objects will still follow their basis objects", + " // but frame delays could happen.", + " const behaviorName = this.behavior.getName();", + " if (basisObject.hasBehavior(behaviorName)) {", + " const basisBehavior = basisObject.getBehavior(behaviorName);", + " if (basisBehavior.type === this.behavior.type) {", + " // Follow parents 1st to avoid frame delays", + " basisBehavior._sticker.followBasisObject();", + " }", + " }", + "", + " const object = this.behavior.owner;", + "", + " if (this.behavior._getOnlyFollowPosition()) {", + " if (object.getX() !== this.ownerOldX", + " || object.getY() !== this.ownerOldY) {", + " this.updateRelativeCoordinates();", + " }", + "", + " if (this.basisOldX !== basisObject.getX() ||", + " this.basisOldY !== basisObject.getY()) {", + " object.setPosition(", + " basisObject.getX() + this.relativeX,", + " basisObject.getY() + this.relativeY);", + " }", + " } else {", + " if (object.getX() !== this.ownerOldX", + " || object.getY() !== this.ownerOldY", + " || object.getAngle() !== this.ownerOldAngle", + " || object.getWidth() !== this.ownerOldWidth", + " || object.getHeight() !== this.ownerOldHeight) {", + " this.updateRelativeCoordinates();", + " }", + "", + " // Follow basisObject", + " if (basisObject.getAngle() === this.basisOriginalAngle && this.basisOriginalAngle === 0) {", + " if (basisObject.getWidth() === this.basisOriginalWidth ||", + " basisObject.getHeight() === this.basisOriginalHeight) {", + " if (this.basisOldX !== basisObject.getX() ||", + " this.basisOldY !== basisObject.getY()) {", + " object.setPosition(", + " basisObject.getX() + this.relativeX,", + " basisObject.getY() + this.relativeY);", + " }", + " } else {", + " object.setCenterPositionInScene(", + " basisObject.getCenterXInScene() + this.relativeRotatedX * basisObject.getWidth(),", + " basisObject.getCenterYInScene() + this.relativeRotatedY * basisObject.getHeight());", + " }", + " } else {", + " object.setAngle(basisObject.getAngle() + this.relativeAngle);", + "", + " const deltaX = this.relativeRotatedX * basisObject.getWidth();", + " const deltaY = this.relativeRotatedY * basisObject.getHeight();", + " const angle = -basisObject.getAngle() * Math.PI / 180;", + " object.setX(basisObject.getCenterXInScene() + object.getX() - object.getCenterXInScene() + deltaX * Math.cos(angle) + deltaY * Math.sin(angle));", + " object.setY(basisObject.getCenterYInScene() + object.getY() - object.getCenterYInScene() - deltaX * Math.sin(angle) + deltaY * Math.cos(angle));", + " }", + " // Unproportional dimensions changes won't work as expected", + " // if the object angle is not null but nothing more can be done", + " // because there is no full affine transformation on objects.", + " if (basisObject.getWidth() !== this.basisOriginalWidth) {", + " object.setWidth(this.relativeWidth * basisObject.getWidth());", + " }", + " if (basisObject.getHeight() !== this.basisOriginalHeight) {", + " object.setHeight(this.relativeHeight * basisObject.getHeight());", + " }", + " }", + "", + " this.updateOldCoordinates();", + " }", + " }", + "}", + "", + "gdjs._stickerExtension = {", + " Sticker", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Check if the object is stuck to another object.", + "fullName": "Is stuck to another object", + "functionType": "Condition", + "name": "IsStuck", + "sentence": "_PARAM1_ is stuck to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const stickerBehaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "/** @type {Hashtable} */", + "const stickerObjectsLists = eventsFunctionContext.getObjectsLists(\"Object\");", + "/** @type {Hashtable} */", + "const basisObjectsLists = eventsFunctionContext.getObjectsLists(\"BasisObject\");", + "", + "eventsFunctionContext.returnValue = gdjs.evtTools.object.twoListsTest(", + " (stickerObject, basisObject) => {", + " const sticker = stickerObject.getBehavior(stickerBehaviorName)._sticker;", + " return sticker.isStuckTo(basisObject);", + " },", + " stickerObjectsLists,", + " basisObjectsLists,", + " false", + ");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Sticker", + "name": "Object", + "type": "objectList" + }, + { + "description": "Sticker behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + }, + { + "description": "Basis", + "name": "BasisObject", + "type": "objectList" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Stick the object to another. Use the action to stick the object, or unstick it later.", + "fullName": "Sticker", + "name": "Sticker", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Sticker::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const Sticker = gdjs._stickerExtension.Sticker;", + "", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const object = objects[0];", + "const behavior = object.getBehavior(behaviorName);", + "", + "behavior._sticker = new Sticker(behavior);", + "", + "// Set up the scene sticker objects list - if not done already.", + "runtimeScene._stickerExtension = runtimeScene._stickerExtension || {", + " allStickers: new Set(),", + "};", + "// Register this object as a sticker.", + "runtimeScene._stickerExtension.allStickers.add(behavior);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const object = objects[0];", + "const behavior = object.getBehavior(behaviorName);", + "", + "behavior._sticker.onStepPreEvents();" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const object = objects[0];", + "const behavior = object.getBehavior(behaviorName);", + "", + "behavior._sticker.followBasisObject();" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Stick on another object.", + "fullName": "Stick", + "functionType": "Action", + "name": "Stick", + "sentence": "Stick _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const basisObjects = eventsFunctionContext.getObjects(\"BasisObject\");", + "", + "if (basisObjects.length === 0) return;", + "// An object can stick to only one object.", + "const basisObject = basisObjects[0];", + "object.getBehavior(behaviorName)._sticker.stickTo(basisObject);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + }, + { + "description": "Object to stick to", + "name": "BasisObject", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Unstick from the object it was stuck to.", + "fullName": "Unstick", + "functionType": "Action", + "name": "Unstick", + "sentence": "Unstick _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "", + "object.getBehavior(behaviorName)._sticker.unstick();", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDestroy", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const object = objects[0];", + "const behavior = object.getBehavior(behaviorName);", + "", + "runtimeScene._stickerExtension.allStickers.delete(behavior._sticker);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Boolean", + "label": "Only follow the position", + "description": "", + "group": "", + "extraInformation": [], + "name": "OnlyFollowPosition" + }, + { + "value": "", + "type": "Boolean", + "label": "Destroy when the object it's stuck on is destroyed", + "description": "", + "group": "", + "extraInformation": [], + "name": "IsDestroyedWithParent" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Visual effect", + "extensionNamespace": "", + "fullName": "3D object shake", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZlY3Rvci1kaWZmZXJlbmNlLWFiIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTMsMUMxLjg5LDEgMSwxLjg5IDEsM1Y1SDNWM0g1VjFIM003LDFWM0gxMFYxSDdNMTIsMVYzSDE0VjVIMTZWM0MxNiwxLjg5IDE1LjExLDEgMTQsMUgxMk0xLDdWMTBIM1Y3SDFNMTQsN0MxNCw3IDE0LDExLjY3IDE0LDE0QzExLjY3LDE0IDcsMTQgNywxNEM3LDE0IDcsMTggNywyMEM3LDIxLjExIDcuODksMjIgOSwyMkgyMEMyMS4xMSwyMiAyMiwyMS4xMSAyMiwyMFY5QzIyLDcuODkgMjEuMTEsNyAyMCw3QzE4LDcgMTQsNyAxNCw3TTE2LDlIMjBWMjBIOVYxNkgxNEMxNS4xMSwxNiAxNiwxNS4xMSAxNiwxNFY5TTEsMTJWMTRDMSwxNS4xMSAxLjg5LDE2IDMsMTZINVYxNEgzVjEySDFaIiAvPjwvc3ZnPg==", + "name": "ShakeObject3D", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/vector-difference-ab.svg", + "shortDescription": "Shake 3D objects.", + "version": "2.0.4", + "description": [ + "Shake 3D objects with translation and rotation.", + "", + "The 3D racing game example uses this extension ([open the project online](https://editor.gdevelop.io/?project=example://3d-racing-game)).", + "", + "Breaking changes from 2.0.0", + "- The behavior for 3D box has been removed. The other behavior can be used for both models and boxes." + ], + "origin": { + "identifier": "ShakeObject3D", + "name": "gdevelop-extension-store" + }, + "tags": [ + "3d", + "shaking", + "effect", + "shake", + "translate", + "rotate" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ShakeObject3D::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Define helper classes JavaScript code.", + "fullName": "Define helper classes", + "functionType": "Action", + "name": "DefineHelperClasses", + "private": true, + "sentence": "Define helper classes JavaScript code", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (gdjs._shakeObjectExtension) {", + " return;", + "}", + "", + "/** Noise generator manager. */", + "class NoiseManager {", + " /**", + " * Create the manager of noise generators.", + " */", + " constructor() {", + " this.seed = gdjs.randomInRange(1, Number.MAX_SAFE_INTEGER);", + " /** @type {Map} */", + " this.generators = new Map();", + " }", + "", + " /**", + " * @param name {string}", + " * @return {NoiseGenerator}", + " */", + " getGenerator(name) {", + " let generator = this.generators.get(name);", + " if (!generator) {", + " generator = new NoiseGenerator(name + this.seed);", + " this.generators.set(name, generator);", + " }", + " return generator;", + " }", + "", + " /**", + " * @param seed {number}", + " */", + " setSeed(seed) {", + " this.seed = seed;", + " this.generators.forEach(generator => generator.setSeed(name + this.seed));", + " }", + "", + " /**", + " * @param name {string}", + " */", + " deleteGenerator(name) {", + " this.generators.delete(name);", + " }", + "", + " /**", + " */", + " deleteAllGenerators() {", + " this.generators.clear();", + " }", + "}", + "", + "/** Noise generator with octaves. */", + "class NoiseGenerator {", + " /**", + " * Create a noise generator with a seed.", + " * @param seed {string}", + " */", + " constructor(seed) {", + " this.simplexNoise = new SimplexNoise(seed);", + " this.frequency = 1;", + " this.octaves = 1;", + " this.persistence = 0.5;", + " this.lacunarity = 2;", + " this.xLoopPeriod = 0;", + " this.yLoopPeriod = 0;", + " }", + "", + " /**", + " * @param seed {string}", + " */", + " setSeed(seed) {", + " this.simplexNoise = new SimplexNoise(seed);", + " }", + "", + " /**", + " * @param x {float}", + " * @param y {float}", + " * @param z {float} optionnal", + " * @param w {float} optionnal", + " * @return {float}", + " */", + " noise(x, y, z, w) {", + " if (this.xLoopPeriod && this.yLoopPeriod) {", + " const circleRatioX = 2 * Math.PI / this.xLoopPeriod;", + " const circleRatioY = 2 * Math.PI / this.yLoopPeriod;", + " const angleX = circleRatioX * x;", + " const angleY = circleRatioY * y;", + " x = Math.cos(angleX) / circleRatioX;", + " y = Math.sin(angleX) / circleRatioX;", + " z = Math.cos(angleY) / circleRatioY;", + " w = Math.sin(angleY) / circleRatioY;", + " }", + " else if (this.xLoopPeriod) {", + " const circleRatio = 2 * Math.PI / this.xLoopPeriod;", + " const angleX = circleRatio * x;", + " w = z;", + " z = y;", + " x = Math.cos(angleX) / circleRatio;", + " y = Math.sin(angleX) / circleRatio;", + " }", + " else if (this.yLoopPeriod) {", + " const circleRatio = 2 * Math.PI / this.xLoopPeriod;", + " const angleX = circleRatio * x;", + " w = z;", + " // Make the circle perimeter equals to the looping period", + " // to keep the same perceived frequency with or without looping.", + " y = Math.cos(angleX) / circleRatio;", + " z = Math.sin(angleX) / circleRatio;", + " }", + " let noiseFunction = this.simplexNoise.noise4D.bind(this.simplexNoise);", + " if (z === undefined) {", + " noiseFunction = this.simplexNoise.noise2D.bind(this.simplexNoise);", + " }", + " else if (w === undefined) {", + " noiseFunction = this.simplexNoise.noise3D.bind(this.simplexNoise);", + " }", + " let frequency = this.frequency;", + " let noiseSum = 0;", + " let amplitudeSum = 0;", + " let amplitude = 1;", + " for (let i = 0; i < this.octaves; i++) {", + " noiseSum += noiseFunction(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;", + " amplitudeSum += Math.abs(amplitude);", + " amplitude *= this.persistence;", + " frequency *= this.lacunarity;", + " }", + " return noiseSum / amplitudeSum;", + " }", + "}", + "", + "/*", + "A fast javascript implementation of simplex noise by Jonas Wagner", + "https://github.com/jwagner/simplex-noise.js", + "", + "Based on a speed-improved simplex noise algorithm for 2D, 3D and 4D in Java.", + "Which is based on example code by Stefan Gustavson (stegu@itn.liu.se).", + "With Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).", + "Better rank ordering method by Stefan Gustavson in 2012.", + "", + " Copyright (c) 2021 Jonas Wagner", + "", + " Permission is hereby granted, free of charge, to any person obtaining a copy", + " of this software and associated documentation files (the \"Software\"), to deal", + " in the Software without restriction, including without limitation the rights", + " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", + " copies of the Software, and to permit persons to whom the Software is", + " furnished to do so, subject to the following conditions:", + "", + " The above copyright notice and this permission notice shall be included in all", + " copies or substantial portions of the Software.", + "", + " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", + " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", + " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", + " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE", + " SOFTWARE.", + " */", + "", + "const F2 = 0.5 * (Math.sqrt(3.0) - 1.0);", + "const G2 = (3.0 - Math.sqrt(3.0)) / 6.0;", + "const F3 = 1.0 / 3.0;", + "const G3 = 1.0 / 6.0;", + "const F4 = (Math.sqrt(5.0) - 1.0) / 4.0;", + "const G4 = (5.0 - Math.sqrt(5.0)) / 20.0;", + "const grad3 = new Float32Array([1, 1, 0,", + " -1, 1, 0,", + " 1, -1, 0,", + " -1, -1, 0,", + " 1, 0, 1,", + " -1, 0, 1,", + " 1, 0, -1,", + " -1, 0, -1,", + " 0, 1, 1,", + " 0, -1, 1,", + " 0, 1, -1,", + " 0, -1, -1]);", + "const grad4 = new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,", + " 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,", + " 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,", + " -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,", + " 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,", + " -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,", + " 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,", + " -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]);", + "", + "", + "/**", + " * Builds a random permutation table.", + " * This is exported only for (internal) testing purposes.", + " * Do not rely on this export.", + " * @param {() => number} random", + " * @private", + " */", + "function buildPermutationTable(random) {", + " const p = new Uint8Array(256);", + " for (let i = 0; i < 256; i++) {", + " p[i] = i;", + " }", + " for (let i = 0; i < 255; i++) {", + " const r = i + ~~(random() * (256 - i));", + " const aux = p[i];", + " p[i] = p[r];", + " p[r] = aux;", + " }", + " return p;", + "}", + "", + "/*", + "The ALEA PRNG and masher code used by simplex-noise.js", + "is based on code by Johannes Baagøe, modified by Jonas Wagner.", + "See alea.md for the full license.", + "@param {string|number} seed", + "*/", + "function alea(seed) {", + " let s0 = 0;", + " let s1 = 0;", + " let s2 = 0;", + " let c = 1;", + " const mash = masher();", + " s0 = mash(' ');", + " s1 = mash(' ');", + " s2 = mash(' ');", + " s0 -= mash(seed);", + " if (s0 < 0) {", + " s0 += 1;", + " }", + " s1 -= mash(seed);", + " if (s1 < 0) {", + " s1 += 1;", + " }", + " s2 -= mash(seed);", + " if (s2 < 0) {", + " s2 += 1;", + " }", + " return function () {", + " const t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32", + " s0 = s1;", + " s1 = s2;", + " return s2 = t - (c = t | 0);", + " };", + "}", + "", + "function masher() {", + " let n = 0xefc8249d;", + " return function (data) {", + " data = data.toString();", + " for (let i = 0; i < data.length; i++) {", + " n += data.charCodeAt(i);", + " let h = 0.02519603282416938 * n;", + " n = h >>> 0;", + " h -= n;", + " h *= n;", + " n = h >>> 0;", + " h -= n;", + " n += h * 0x100000000; // 2^32", + " }", + " return (n >>> 0) * 2.3283064365386963e-10; // 2^-32", + " };", + "}", + "", + "/** Deterministic simplex noise generator suitable for 2D, 3D and 4D spaces. */", + "class SimplexNoise {", + " /**", + " * Creates a new `SimplexNoise` instance.", + " * This involves some setup. You can save a few cpu cycles by reusing the same instance.", + " * @param {(() => number)|string|number} randomOrSeed A random number generator or a seed (string|number).", + " * Defaults to Math.random (random irreproducible initialization).", + " */", + " constructor(randomOrSeed) {", + " if (randomOrSeed === void 0) { randomOrSeed = Math.random; }", + " const random = typeof randomOrSeed == 'function' ? randomOrSeed : alea(randomOrSeed);", + " this.p = buildPermutationTable(random);", + " this.perm = new Uint8Array(512);", + " this.permMod12 = new Uint8Array(512);", + " for (let i = 0; i < 512; i++) {", + " this.perm[i] = this.p[i & 255];", + " this.permMod12[i] = this.perm[i] % 12;", + " }", + " }", + "", + " /**", + " * Samples the noise field in 2 dimensions", + " * @param {number} x", + " * @param {number} y", + " * @returns a number in the interval [-1, 1]", + " */", + " noise2D(x, y) {", + " const permMod12 = this.permMod12;", + " const perm = this.perm;", + " let n0 = 0; // Noise contributions from the three corners", + " let n1 = 0;", + " let n2 = 0;", + " // Skew the input space to determine which simplex cell we're in", + " const s = (x + y) * F2; // Hairy factor for 2D", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const t = (i + j) * G2;", + " const X0 = i - t; // Unskew the cell origin back to (x,y) space", + " const Y0 = j - t;", + " const x0 = x - X0; // The x,y distances from the cell origin", + " const y0 = y - Y0;", + " // For the 2D case, the simplex shape is an equilateral triangle.", + " // Determine which simplex we are in.", + " let i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords", + " if (x0 > y0) {", + " i1 = 1;", + " j1 = 0;", + " } // lower triangle, XY order: (0,0)->(1,0)->(1,1)", + " else {", + " i1 = 0;", + " j1 = 1;", + " } // upper triangle, YX order: (0,0)->(0,1)->(1,1)", + " // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and", + " // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where", + " // c = (3-sqrt(3))/6", + " const x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords", + " const y1 = y0 - j1 + G2;", + " const x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords", + " const y2 = y0 - 1.0 + 2.0 * G2;", + " // Work out the hashed gradient indices of the three simplex corners", + " const ii = i & 255;", + " const jj = j & 255;", + " // Calculate the contribution from the three corners", + " let t0 = 0.5 - x0 * x0 - y0 * y0;", + " if (t0 >= 0) {", + " const gi0 = permMod12[ii + perm[jj]] * 3;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0); // (x,y) of grad3 used for 2D gradient", + " }", + " let t1 = 0.5 - x1 * x1 - y1 * y1;", + " if (t1 >= 0) {", + " const gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);", + " }", + " let t2 = 0.5 - x2 * x2 - y2 * y2;", + " if (t2 >= 0) {", + " const gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);", + " }", + " // Add contributions from each corner to get the final noise value.", + " // The result is scaled to return values in the interval [-1,1].", + " return 70.0 * (n0 + n1 + n2);", + " }", + "", + " /**", + " * Samples the noise field in 3 dimensions", + " * @param {number} x", + " * @param {number} y", + " * @param {number} z", + " * @returns a number in the interval [-1, 1]", + " */", + " noise3D(x, y, z) {", + " const permMod12 = this.permMod12;", + " const perm = this.perm;", + " let n0, n1, n2, n3; // Noise contributions from the four corners", + " // Skew the input space to determine which simplex cell we're in", + " const s = (x + y + z) * F3; // Very nice and simple skew factor for 3D", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const k = Math.floor(z + s);", + " const t = (i + j + k) * G3;", + " const X0 = i - t; // Unskew the cell origin back to (x,y,z) space", + " const Y0 = j - t;", + " const Z0 = k - t;", + " const x0 = x - X0; // The x,y,z distances from the cell origin", + " const y0 = y - Y0;", + " const z0 = z - Z0;", + " // For the 3D case, the simplex shape is a slightly irregular tetrahedron.", + " // Determine which simplex we are in.", + " let i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords", + " let i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords", + " if (x0 >= y0) {", + " if (y0 >= z0) {", + " i1 = 1;", + " j1 = 0;", + " k1 = 0;", + " i2 = 1;", + " j2 = 1;", + " k2 = 0;", + " } // X Y Z order", + " else if (x0 >= z0) {", + " i1 = 1;", + " j1 = 0;", + " k1 = 0;", + " i2 = 1;", + " j2 = 0;", + " k2 = 1;", + " } // X Z Y order", + " else {", + " i1 = 0;", + " j1 = 0;", + " k1 = 1;", + " i2 = 1;", + " j2 = 0;", + " k2 = 1;", + " } // Z X Y order", + " }", + " else { // x0 y0)", + " rankx++;", + " else", + " ranky++;", + " if (x0 > z0)", + " rankx++;", + " else", + " rankz++;", + " if (x0 > w0)", + " rankx++;", + " else", + " rankw++;", + " if (y0 > z0)", + " ranky++;", + " else", + " rankz++;", + " if (y0 > w0)", + " ranky++;", + " else", + " rankw++;", + " if (z0 > w0)", + " rankz++;", + " else", + " rankw++;", + " // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.", + " // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0;", + " const j1 = ranky >= 3 ? 1 : 0;", + " const k1 = rankz >= 3 ? 1 : 0;", + " const l1 = rankw >= 3 ? 1 : 0;", + " // The integer offsets for the third simplex corner", + " const i2 = rankx >= 2 ? 1 : 0;", + " const j2 = ranky >= 2 ? 1 : 0;", + " const k2 = rankz >= 2 ? 1 : 0;", + " const l2 = rankw >= 2 ? 1 : 0;", + " // The integer offsets for the fourth simplex corner", + " const i3 = rankx >= 1 ? 1 : 0;", + " const j3 = ranky >= 1 ? 1 : 0;", + " const k3 = rankz >= 1 ? 1 : 0;", + " const l3 = rankw >= 1 ? 1 : 0;", + " // The fifth corner has all coordinate offsets = 1, so no need to compute that.", + " const x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords", + " const y1 = y0 - j1 + G4;", + " const z1 = z0 - k1 + G4;", + " const w1 = w0 - l1 + G4;", + " const x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords", + " const y2 = y0 - j2 + 2.0 * G4;", + " const z2 = z0 - k2 + 2.0 * G4;", + " const w2 = w0 - l2 + 2.0 * G4;", + " const x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords", + " const y3 = y0 - j3 + 3.0 * G4;", + " const z3 = z0 - k3 + 3.0 * G4;", + " const w3 = w0 - l3 + 3.0 * G4;", + " const x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords", + " const y4 = y0 - 1.0 + 4.0 * G4;", + " const z4 = z0 - 1.0 + 4.0 * G4;", + " const w4 = w0 - 1.0 + 4.0 * G4;", + " // Work out the hashed gradient indices of the five simplex corners", + " const ii = i & 255;", + " const jj = j & 255;", + " const kk = k & 255;", + " const ll = l & 255;", + " // Calculate the contribution from the five corners", + " let t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;", + " if (t0 < 0)", + " n0 = 0.0;", + " else {", + " const gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);", + " }", + " let t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;", + " if (t1 < 0)", + " n1 = 0.0;", + " else {", + " const gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);", + " }", + " let t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;", + " if (t2 < 0)", + " n2 = 0.0;", + " else {", + " const gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);", + " }", + " let t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;", + " if (t3 < 0)", + " n3 = 0.0;", + " else {", + " const gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;", + " t3 *= t3;", + " n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);", + " }", + " let t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;", + " if (t4 < 0)", + " n4 = 0.0;", + " else {", + " const gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;", + " t4 *= t4;", + " n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);", + " }", + " // Sum up and scale the result to cover the range [-1,1]", + " return 27.0 * (n0 + n1 + n2 + n3 + n4);", + " };", + "}", + "", + "gdjs._shakeObjectExtension = {", + " noiseManager: new NoiseManager(),", + "};", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Generate a number from 2 dimensional simplex noise.", + "fullName": "2D noise", + "functionType": "Expression", + "name": "Noise2d", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "const x = eventsFunctionContext.getArgument(\"X\");\r", + "const y = eventsFunctionContext.getArgument(\"Y\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.getGenerator(name).noise(x, y);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + }, + { + "description": "X coordinate", + "name": "X", + "type": "expression" + }, + { + "description": "Y coordinate", + "name": "Y", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Generate a number from 3 dimensional simplex noise.", + "fullName": "3D noise", + "functionType": "Expression", + "name": "Noise3d", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "const x = eventsFunctionContext.getArgument(\"X\");\r", + "const y = eventsFunctionContext.getArgument(\"Y\");\r", + "const z = eventsFunctionContext.getArgument(\"Z\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.getGenerator(name).noise(x, y, z);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + }, + { + "description": "X coordinate", + "name": "X", + "type": "expression" + }, + { + "description": "Y coordinate", + "name": "Y", + "type": "expression" + }, + { + "description": "Z coordinate", + "name": "Z", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Generate a number from 4 dimensional simplex noise.", + "fullName": "4D noise", + "functionType": "Expression", + "name": "Noise4d", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "const x = eventsFunctionContext.getArgument(\"X\");\r", + "const y = eventsFunctionContext.getArgument(\"Y\");\r", + "const z = eventsFunctionContext.getArgument(\"Z\");\r", + "const w = eventsFunctionContext.getArgument(\"W\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.getGenerator(name).noise(x, y, z, w);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + }, + { + "description": "X coordinate", + "name": "X", + "type": "expression" + }, + { + "description": "Y coordinate", + "name": "Y", + "type": "expression" + }, + { + "description": "Z coordinate", + "name": "Z", + "type": "expression" + }, + { + "description": "W coordinate", + "name": "W", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Create a noise generator with default settings (frequency = 1, octaves = 1, persistence = 0.5, lacunarity = 2).", + "fullName": "Create a noise generator", + "functionType": "Action", + "name": "Create", + "private": true, + "sentence": "Create a noise generator named _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._shakeObjectExtension.noiseManager.getGenerator(name);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Delete a noise generator and loose its settings.", + "fullName": "Delete a noise generator", + "functionType": "Action", + "name": "Delete", + "private": true, + "sentence": "Delete _PARAM1_ noise generator", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._shakeObjectExtension.noiseManager.deleteGenerator(name);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Delete all noise generators and loose their settings.", + "fullName": "Delete all noise generators", + "functionType": "Action", + "name": "DeleteAll", + "private": true, + "sentence": "Delete all noise generators", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "gdjs._shakeObjectExtension.noiseManager.deleteAllGenerators();", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "The seed is a number used to generate the random noise. Setting the same seed will result in the same random noise generation. It's for example useful to generate the same world, by saving this seed value and reusing it later to generate again a world.", + "fullName": "Noise seed", + "functionType": "Action", + "name": "SetSeed", + "private": true, + "sentence": "Change the noise seed to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "gdjs._shakeObjectExtension.noiseManager.setSeed(eventsFunctionContext.getArgument(\"Seed\"));", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Seed", + "longDescription": "15 digits numbers maximum", + "name": "Seed", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the looping period on X used for noise generation. The noise will wrap-around on X.", + "fullName": "Noise looping period on X", + "functionType": "Action", + "name": "SetLoopPeriodX", + "private": true, + "sentence": "Change the looping period on X of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._shakeObjectExtension.noiseManager.getGenerator(name).xLoopPeriod = eventsFunctionContext.getArgument(\"LoopPeriod\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Looping period on X", + "name": "LoopPeriod", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the looping period on Y used for noise generation. The noise will wrap-around on Y.", + "fullName": "Noise looping period on Y", + "functionType": "Action", + "name": "SetLoopPeriodY", + "private": true, + "sentence": "Change the looping period on Y of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._shakeObjectExtension.noiseManager.getGenerator(name).yLoopPeriod = eventsFunctionContext.getArgument(\"LoopPeriod\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Looping period on Y", + "name": "LoopPeriod", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the base frequency used for noise generation. A lower frequency will zoom in the noise.", + "fullName": "Noise base frequency", + "functionType": "Action", + "name": "SetFrequency", + "private": true, + "sentence": "Change the noise frequency of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._shakeObjectExtension.noiseManager.getGenerator(name).frequency = eventsFunctionContext.getArgument(\"Frequency\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Frequency", + "name": "Frequency", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the number of octaves used for noise generation. It can be seen as layers of noise with different zoom.", + "fullName": "Noise octaves", + "functionType": "Action", + "name": "SetOctaves", + "private": true, + "sentence": "Change the number of noise octaves of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._shakeObjectExtension.noiseManager.getGenerator(name).octaves = eventsFunctionContext.getArgument(\"Octaves\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Octaves", + "name": "Octaves", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the persistence used for noise generation. At its default value \"0.5\", it halves the noise amplitude at each octave.", + "fullName": "Noise persistence", + "functionType": "Action", + "name": "SetPersistence", + "private": true, + "sentence": "Change the noise persistence of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._shakeObjectExtension.noiseManager.getGenerator(name).persistence = eventsFunctionContext.getArgument(\"Persistence\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Persistence", + "name": "Persistence", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the lacunarity used for noise generation. At its default value \"2\", it doubles the frequency at each octave.", + "fullName": "Noise lacunarity", + "functionType": "Action", + "name": "SetLacunarity", + "private": true, + "sentence": "Change the noise lacunarity of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._shakeObjectExtension.noiseManager.getGenerator(name).lacunarity = eventsFunctionContext.getArgument(\"Lacunarity\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Lacunarity", + "name": "Lacunarity", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "The seed used for noise generation.", + "fullName": "Noise seed", + "functionType": "Expression", + "name": "Seed", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.seed;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "The base frequency used for noise generation.", + "fullName": "Noise base frequency", + "functionType": "Expression", + "name": "Frequency", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.getGenerator(name).frequency;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "The number of octaves used for noise generation.", + "fullName": "Noise octaves number", + "functionType": "Expression", + "name": "Octaves", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.getGenerator(name).octaves;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "The persistence used for noise generation.", + "fullName": "Noise persistence", + "functionType": "Expression", + "name": "Persistence", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.getGenerator(name).persistence;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "The lacunarity used for noise generation.", + "fullName": "Noise lacunarity", + "functionType": "Expression", + "name": "Lacunarity", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.getGenerator(name).lacunarity;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Shake 3D objects with translation and rotation.", + "fullName": "3D shake", + "name": "ShakeModel3D", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyIsStartingAtCreation" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::StartShaking" + }, + "parameters": [ + "Object", + "Behavior", + "0", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Step time counters." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyTime" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::IsShaking" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyNoiseTime" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "TimeDelta() * Frequency" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetSharedPropertyEasingFactor" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(Object.Behavior::StartEasingFactor(), Object.Behavior::StopEasingFactor())" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Shake the object.\nSave the object displacement to revert it in onScenePostEvents." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTranslationAmplitudeX" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDeltaX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ShakeObject3D::Noise2d(\"\", NoiseTime, 1000) * TranslationAmplitudeX * EasingFactor" + ] + }, + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "+", + "DeltaX" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTranslationAmplitudeY" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDeltaY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ShakeObject3D::Noise2d(\"\", NoiseTime, 2000) * TranslationAmplitudeY * EasingFactor" + ] + }, + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "+", + "DeltaY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTranslationAmplitudeZ" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDeltaZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ShakeObject3D::Noise2d(\"\", NoiseTime, 3000) * TranslationAmplitudeZ * EasingFactor" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "DeltaZ" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyRotationAmplitudeX" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDeltaAngleX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ShakeObject3D::Noise2d(\"\", NoiseTime, 4000) * RotationAmplitudeX * EasingFactor" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "DeltaAngleX" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyRotationAmplitudeY" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDeltaAngleY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ShakeObject3D::Noise2d(\"\", NoiseTime, 5000) * RotationAmplitudeY * EasingFactor" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "DeltaAngleY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyRotationAmplitudeZ" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDeltaAngleZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ShakeObject3D::Noise2d(\"\", NoiseTime, 6000) * RotationAmplitudeZ * EasingFactor" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "DeltaAngleZ" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Revert the shaking." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::IsShaking" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTranslationAmplitudeX" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "-", + "DeltaX" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTranslationAmplitudeY" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "-", + "DeltaY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTranslationAmplitudeZ" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Object", + "Object3D", + "-", + "DeltaZ" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyRotationAmplitudeX" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Object", + "Object3D", + "-", + "DeltaAngleX" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyRotationAmplitudeY" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "-", + "DeltaAngleY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyRotationAmplitudeZ" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "-", + "DeltaAngleZ" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Shake the object with a linear easing at the start and the end.", + "fullName": "Shake", + "functionType": "Action", + "name": "Shake", + "sentence": "Shake _PARAM0_ for _PARAM2_ seconds with _PARAM3_ seconds of easing to start and _PARAM4_ seconds to stop", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyNoiseTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "TimeFromStart() * Frequency" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "NewDuration" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyStartEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StartEaseDuration" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyStopEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StopEaseDuration" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"NewDuration\"", + "<", + "StartEaseDuration + StopEaseDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyStartEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StartEaseDuration * NewDuration / (StartEaseDuration + StopEaseDuration)" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyStopEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StopEaseDuration * NewDuration / (StartEaseDuration + StopEaseDuration)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + }, + { + "description": "Duration (in seconds)", + "name": "NewDuration", + "type": "expression" + }, + { + "description": "Ease duration to start (in seconds)", + "name": "StartEaseDuration", + "type": "expression" + }, + { + "description": "Ease duration to stop (in seconds)", + "name": "StopEaseDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Shake the object with a linear easing at the start and keep shaking until the stop action is used.", + "fullName": "Start shaking", + "functionType": "Action", + "name": "StartShaking", + "sentence": "Start shaking _PARAM0_ with _PARAM2_ seconds of easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyNoiseTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "TimeFromStart() * Frequency" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "1234567890" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyStartEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "EaseDuration" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + }, + { + "description": "Ease duration (in seconds)", + "name": "EaseDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Stop shaking the object with a linear easing.", + "fullName": "Stop shaking", + "functionType": "Action", + "name": "StopShaking", + "sentence": "Stop shaking _PARAM0_ with _PARAM2_ seconds of easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::IsShaking" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "EaseDuration" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyStopEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "EaseDuration" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + }, + { + "description": "Ease duration (in seconds)", + "name": "EaseDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is shaking.", + "fullName": "Is shaking", + "functionType": "Condition", + "name": "IsShaking", + "sentence": "_PARAM0_ is shaking", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTime" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "Duration" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTime" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is stopping to shake.", + "fullName": "Is stopping to shake", + "functionType": "Condition", + "name": "IsStopping", + "sentence": "_PARAM0_ is stopping to shake", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::IsShaking" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::StopEasingFactor" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "1", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the shaking frequency of the object.", + "fullName": "Shaking frequency", + "functionType": "ExpressionAndCondition", + "group": "ShakeObject3D configuration", + "name": "Frequency", + "sentence": "the shaking frequency", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Frequency" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Frequency", + "name": "SetFrequency", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyFrequency" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the easing factor according to start properties.", + "fullName": "Start easing factor", + "functionType": "Expression", + "name": "StartEasingFactor", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyStartEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyStartEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "clamp(Time / StartEasingDuration, 0, 1)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the easing factor according to stop properties.", + "fullName": "Stop easing factor", + "functionType": "ExpressionAndCondition", + "name": "StopEasingFactor", + "private": true, + "sentence": "stop easing factor", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyStopEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + "<=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTime" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "Duration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTime" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "Duration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "0" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyStopEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "clamp((Duration - Time) / StopEasingDuration, 0, 1)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Translation amplitude on X axis", + "description": "", + "group": "", + "extraInformation": [], + "name": "TranslationAmplitudeX" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Translation amplitude on Y axis", + "description": "", + "group": "", + "extraInformation": [], + "name": "TranslationAmplitudeY" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Translation amplitude on Z axis", + "description": "", + "group": "", + "extraInformation": [], + "name": "TranslationAmplitudeZ" + }, + { + "value": "5", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation amplitude around X axis", + "description": "", + "group": "", + "extraInformation": [], + "name": "RotationAmplitudeX" + }, + { + "value": "5", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation amplitude around Y axis", + "description": "", + "group": "", + "extraInformation": [], + "name": "RotationAmplitudeY" + }, + { + "value": "5", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation amplitude around Z axis", + "description": "", + "group": "", + "extraInformation": [], + "name": "RotationAmplitudeZ" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Time" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Duration" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "StartEasingDuration" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "StopEasingDuration" + }, + { + "value": "", + "type": "Number", + "label": "Frequency", + "description": "", + "group": "", + "extraInformation": [], + "name": "Frequency" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "DeltaX" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "DeltaY" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "DeltaZ" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "DeltaAngleX" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "DeltaAngleY" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "DeltaAngleZ" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "NoiseTime" + }, + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "description": "", + "group": "", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "name": "Object3D" + }, + { + "value": "", + "type": "Boolean", + "label": "Start to shake at the object creation", + "description": "", + "group": "", + "extraInformation": [], + "name": "IsStartingAtCreation" + } + ], + "sharedPropertyDescriptors": [ + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "EasingFactor" + } + ] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "westboy31, Tristan Rhodes (https://victrisgames.itch.io/)", + "category": "Camera", + "extensionNamespace": "", + "fullName": "Camera shake", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZlY3Rvci1kaWZmZXJlbmNlLWFiIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTMsMUMxLjg5LDEgMSwxLjg5IDEsM1Y1SDNWM0g1VjFIM003LDFWM0gxMFYxSDdNMTIsMVYzSDE0VjVIMTZWM0MxNiwxLjg5IDE1LjExLDEgMTQsMUgxMk0xLDdWMTBIM1Y3SDFNMTQsN0MxNCw3IDE0LDExLjY3IDE0LDE0QzExLjY3LDE0IDcsMTQgNywxNEM3LDE0IDcsMTggNywyMEM3LDIxLjExIDcuODksMjIgOSwyMkgyMEMyMS4xMSwyMiAyMiwyMS4xMSAyMiwyMFY5QzIyLDcuODkgMjEuMTEsNyAyMCw3QzE4LDcgMTQsNyAxNCw3TTE2LDlIMjBWMjBIOVYxNkgxNEMxNS4xMSwxNiAxNiwxNS4xMSAxNiwxNFY5TTEsMTJWMTRDMSwxNS4xMSAxLjg5LDE2IDMsMTZINVYxNEgzVjEySDFaIiAvPjwvc3ZnPg==", + "name": "CameraShake", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/vector-difference-ab.svg", + "shortDescription": "Shake layer cameras.", + "version": "3.1.1", + "description": [ + "Shake layer cameras with translation, rotation and zoom.", + "", + "- Short shaking can be used to give impact (explosion, hit)", + "- Shaking can go indefinitely to set an ambiance (engine vibration, earthquake, pulsing)", + "- Low frequency shaking allows to simulate slow moving objects (ship rocking back and forth)", + "", + "Release notes:", + "- Version 3.0.0", + " - No adaptation of the game events is needed.", + " - It fixes an issue when used with scrolling, the amplitude will feel bigger in this case.", + " - The shaking relies on noise which could feel a bit different.", + " - This extension can no longer do impulses. For this, another extension \"Camera impulse\" can be used." + ], + "origin": { + "identifier": "CameraShake", + "name": "gdevelop-extension-store" + }, + "tags": [ + "shaking", + "camera", + "effect", + "screen", + "shake" + ], + "authorIds": [ + "gqDaZjCfevOOxBYkK6zlhtZnXCg1", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "m4hBMBTUilft4s1V4FQQPakVDGx1" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [ + { + "folded": true, + "name": "DefaultFrequency", + "type": "number", + "value": 12 + }, + { + "folded": true, + "name": "DefaultAmplitudeX", + "type": "number", + "value": 4 + }, + { + "folded": true, + "name": "DefaultAmplitudeY", + "type": "number", + "value": 4 + }, + { + "folded": true, + "name": "DefaultAmplitudeAngle", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "DefaultAmplitudeZoom", + "type": "number", + "value": 1 + }, + { + "folded": true, + "name": "Duration", + "type": "number", + "value": 0 + }, + { + "name": "Layers", + "type": "structure", + "children": [] + }, + { + "name": "Layer", + "type": "structure", + "children": [ + { + "name": "AmplitudeAngle", + "type": "number", + "value": 0 + }, + { + "name": "AmplitudeX", + "type": "number", + "value": 0 + }, + { + "name": "AmplitudeY", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "AmplitudeZoom", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaAngle", + "type": "number", + "value": 0 + }, + { + "name": "CameraDeltaX", + "type": "number", + "value": 0 + }, + { + "name": "CameraDeltaY", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaZoom", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "Frequency", + "type": "number", + "value": 0 + } + ] + }, + { + "folded": true, + "name": "LayerName", + "type": "string", + "value": "" + }, + { + "folded": true, + "name": "Time", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "StartEaseDuration", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "StopEaseDuration", + "type": "number", + "value": 0 + } + ], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "CameraShake::SetLayerShakable" + }, + "parameters": [ + "", + "", + "\"\"", + "" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onScenePostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Step time counters." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "+", + "TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraShake::IsShaking" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Time", + "<", + "StartEaseDuration" + ] + }, + { + "type": { + "inverted": true, + "value": "NumberVariable" + }, + "parameters": [ + "Time", + ">", + "Duration - StopEaseDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "EaseFactor", + "=", + "clamp(Time / StartEaseDuration, 0, 1)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Time", + ">", + "Duration - StopEaseDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "EaseFactor", + "=", + "clamp((Duration - Time) / StopEaseDuration, 0, 1)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "Layers", + "valueIteratorVariableName": "Layer", + "keyIteratorVariableName": "LayerName", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Layer.Shakable", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ActualLayerName", + "=", + "LayerName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ActualLayerName", + "=", + "\"\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Use user defined default values when there is no layer specific value set." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "CameraShake::SetFrequency" + }, + "parameters": [ + "", + "DefaultFrequency", + "\"\"", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeX", + "=", + "DefaultAmplitudeX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeY", + "=", + "DefaultAmplitudeY" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeAngle", + "=", + "DefaultAmplitudeAngle" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeZoom", + "=", + "DefaultAmplitudeZoom" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaX", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaY", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaAngle", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaZoom", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"Frequency\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "CameraShake::SetFrequency" + }, + "parameters": [ + "", + "Layer.Frequency", + "\"\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"AmplitudeX\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeX", + "=", + "Layer.AmplitudeX" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"AmplitudeY\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeY", + "=", + "Layer.AmplitudeY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"AmplitudeAngle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeAngle", + "=", + "Layer.AmplitudeAngle" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"AmplitudeZoom\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeZoom", + "=", + "Layer.AmplitudeZoom" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Shake the layer camera.\nSave the camera displacement to revert it in onScenePostEvents." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaX", + "=", + "CameraShake::Noise2d(\"\", TimeFromStart(), 1000) * AmplitudeX * EaseFactor" + ] + }, + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "+", + "Layers[LayerName].CameraDeltaX", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeY", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaY", + "=", + "CameraShake::Noise2d(\"\", TimeFromStart(), 2000) * AmplitudeY * EaseFactor" + ] + }, + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "+", + "Layers[LayerName].CameraDeltaY", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeAngle", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaAngle", + "=", + "CameraShake::Noise2d(\"\", TimeFromStart(), 3000) * AmplitudeAngle * EaseFactor" + ] + }, + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "+", + "Layers[LayerName].CameraDeltaAngle", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeZoom", + "!=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaZoom", + "=", + "pow(AmplitudeZoom, CameraShake::Noise2d(\"\", TimeFromStart(), 4000) * EaseFactor)" + ] + }, + { + "type": { + "value": "ZoomCamera" + }, + "parameters": [ + "", + "CameraZoom(ActualLayerName, 0) * Layers[LayerName].CameraDeltaZoom", + "ActualLayerName", + "0" + ] + } + ] + } + ] + } + ] + } + ], + "variables": [ + { + "folded": true, + "name": "AmplitudeX", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "AmplitudeY", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "AmplitudeAngle", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "AmplitudeZoom", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "EaseFactor", + "type": "number", + "value": 1 + }, + { + "folded": true, + "name": "ActualLayerName", + "type": "string", + "value": "" + } + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onScenePreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Revert the shaking." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraShake::IsShaking" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "Layers", + "valueIteratorVariableName": "Layer", + "keyIteratorVariableName": "LayerName", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Layer.Shakable", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraDeltaX", + "=", + "Layer.CameraDeltaX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraDeltaY", + "=", + "Layer.CameraDeltaY" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraDeltaAngle", + "=", + "Layer.CameraDeltaAngle" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraDeltaZoom", + "=", + "Layer.CameraDeltaZoom" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ActualLayerName", + "=", + "LayerName" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ActualLayerName", + "=", + "\"\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraDeltaX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "-", + "CameraDeltaX", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraDeltaY", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "-", + "CameraDeltaY", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraDeltaAngle", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "-", + "CameraDeltaAngle", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraDeltaZoom", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ZoomCamera" + }, + "parameters": [ + "", + "CameraZoom(ActualLayerName) / CameraDeltaZoom", + "ActualLayerName", + "0" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "folded": true, + "name": "ActualLayerName", + "type": "string", + "value": "" + }, + { + "folded": true, + "name": "CameraDeltaX", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaY", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaAngle", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaZoom", + "type": "number", + "value": 0 + } + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Shake the camera on layers chosen with configuration actions.", + "fullName": "Shake camera", + "functionType": "Action", + "name": "ShakeCamera", + "sentence": "Shake camera for _PARAM1_ seconds with _PARAM2_ seconds of easing to start and _PARAM3_ seconds to stop", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "NewDuration" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StartEaseDuration", + "=", + "NewStartEaseDuration" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StopEaseDuration", + "=", + "NewStopEaseDuration" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Duration", + "<", + "StartEaseDuration + StopEaseDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StartEaseDuration", + "=", + "StartEaseDuration * Duration / (StartEaseDuration + StopEaseDuration)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StopEaseDuration", + "=", + "StopEaseDuration * Duration / (StartEaseDuration + StopEaseDuration)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Duration (in seconds)", + "name": "NewDuration", + "type": "expression" + }, + { + "description": "Ease duration to start (in seconds)", + "name": "NewStartEaseDuration", + "type": "expression" + }, + { + "description": "Ease duration to stop (in seconds)", + "name": "NewStopEaseDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Shake the camera on the specified layer, using one or more ways to shake (position, angle, zoom). This action is deprecated. Please use the other one with the same name.", + "fullName": "Shake camera (deprecated)", + "functionType": "Action", + "name": "CameraShake", + "private": true, + "sentence": "Shake camera on _PARAM3_ layer for _PARAM5_ seconds. Use an amplitude of _PARAM1_px on X axis and _PARAM2_px on Y axis, angle rotation amplitude _PARAM6_ degrees, and zoom amplitude _PARAM7_ percent. Wait _PARAM8_ seconds between shakes. Keep shaking until stopped: _PARAM9_", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Camera Shake", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "Layers" + ] + }, + { + "type": { + "value": "CameraShake::SetLayerShakable" + }, + "parameters": [ + "", + "", + "GetArgumentAsString(\"Layer\")", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "=", + "0" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Layer", + "=", + "GetArgumentAsString(\"Layer\")" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "GetArgumentAsNumber(\"Duration\")" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StartEaseDuration", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StopEaseDuration", + "=", + "GetArgumentAsNumber(\"Duration\")" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultAmplitudeX", + "=", + "abs(GetArgumentAsNumber(\"AmplitudeX\"))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultAmplitudeY", + "=", + "abs(GetArgumentAsNumber(\"AmplitudeY\"))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultAmplitudeAngle", + "=", + "GetArgumentAsNumber(\"AmplitudeAngle\")" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultAmplitudeZoom", + "=", + "1 + GetArgumentAsNumber(\"AmplitudeZoom\") / 100" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "GetArgumentAsNumber(\"ShakePeriod\")", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultFrequency", + "=", + "1 / GetArgumentAsNumber(\"ShakePeriod\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "GetArgumentAsNumber(\"ShakePeriod\")", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultFrequency", + "=", + "1 / 0.08" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Determine if the shake should keep going until stopped" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShakeForever\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "1234567890" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Add default values if none were provided" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Duration", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "0.5" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Amplitude of shaking on the X axis (in pixels)", + "name": "AmplitudeX", + "type": "expression" + }, + { + "description": "Amplitude of shaking on the Y axis (in pixels)", + "name": "AmplitudeY", + "type": "expression" + }, + { + "description": "Layer (base layer if empty)", + "name": "Layer", + "type": "layer" + }, + { + "description": "Camera index (Default: 0)", + "name": "Camera", + "type": "expression" + }, + { + "description": "Duration (in seconds) (Default: 0.5)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Angle rotation amplitude (in degrees) (For example: 2)", + "name": "AmplitudeAngle", + "type": "expression" + }, + { + "description": "Zoom factor amplitude", + "name": "AmplitudeZoom", + "type": "expression" + }, + { + "description": "Period between shakes (in seconds) (Default: 0.08)", + "name": "ShakePeriod", + "type": "expression" + }, + { + "description": "Keep shaking until stopped", + "longDescription": "Duration value will be ignored", + "name": "ShakeForever", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Start shaking the camera indefinitely.", + "fullName": "Start camera shaking", + "functionType": "Action", + "name": "StartShaking", + "sentence": "Start shaking the camera with _PARAM1_ seconds of easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "1234567890" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StartEaseDuration", + "=", + "EaseDuration" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Ease duration (in seconds)", + "name": "EaseDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Stop shaking the camera.", + "fullName": "Stop camera shaking", + "functionType": "Action", + "name": "StopShaking", + "sentence": "Stop shaking the camera with _PARAM1_ seconds of easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "EaseDuration" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StopEaseDuration", + "=", + "EaseDuration" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Ease duration (in seconds)", + "name": "EaseDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Mark a layer as shakable.", + "fullName": "Shakable layer", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetLayerShakable", + "sentence": "Mark the layer: _PARAM2_ as shakable: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "NewLayerName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "NewLayerName", + "=", + "\"\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Shakable\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "Layers[LayerName].Shakable", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Shakable\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "Layers[LayerName].Shakable", + "True", + "" + ] + } + ] + } + ], + "parameters": [ + { + "defaultValue": "yes", + "description": "Shakable", + "name": "Shakable", + "optional": true, + "type": "yesorno" + }, + { + "description": "Layer", + "name": "NewLayerName", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the camera is shaking.", + "fullName": "Camera is shaking", + "functionType": "Condition", + "name": "IsShaking", + "sentence": "Camera is shaking", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Time", + "<", + "Duration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Change the translation amplitude of the shaking (in pixels).", + "fullName": "Layer translation amplitude", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetLayerTranslationAmplitude", + "sentence": "Change the translation amplitude of the shaking to _PARAM1_; _PARAM2_ (layer: _PARAM3_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "NewLayerName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "NewLayerName", + "=", + "\"\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].AmplitudeX", + "=", + "AmplitudeX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].AmplitudeY", + "=", + "AmplitudeY" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Amplitude of shaking on the X axis (in pixels)", + "name": "AmplitudeX", + "type": "expression" + }, + { + "description": "Amplitude of shaking on the Y axis (in pixels)", + "name": "AmplitudeY", + "type": "expression" + }, + { + "description": "Layer", + "name": "NewLayerName", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Change the rotation amplitude of the shaking (in degrees).", + "fullName": "Layer rotation amplitude", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetLayerRotationAmplitude", + "sentence": "Change the rotation amplitude of the shaking to _PARAM1_ degrees (layer: _PARAM2_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "NewLayerName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "NewLayerName", + "=", + "\"\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].AmplitudeAngle", + "=", + "AmplitudeAngle" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Angle (in degree)", + "name": "AmplitudeAngle", + "type": "expression" + }, + { + "description": "NewLayerName", + "name": "NewLayerName", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Change the zoom factor amplitude of the shaking. The shaking will zoom and unzoom by this factor (for instance 1.0625 is a valid value).", + "fullName": "Layer zoom amplitude", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetLayerZoomAmplitude", + "sentence": "Change the zoom factor amplitude of the shaking to _PARAM1_ (layer: _PARAM2_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "NewLayerName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "NewLayerName", + "=", + "\"\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].AmplitudeZoom", + "=", + "AmplitudeZoom" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Zoom factor", + "name": "AmplitudeZoom", + "type": "expression" + }, + { + "description": "NewLayerName", + "name": "NewLayerName", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Change the number of back and forth per seconds.", + "fullName": "Layer shaking frequency", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetLayerShakingFrequency", + "sentence": "Change the shaking frequency to _PARAM1_ (layer: _PARAM2_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "NewLayerName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "NewLayerName", + "=", + "\"\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].Frequency", + "=", + "Frequency" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Frequency", + "name": "Frequency", + "type": "expression" + }, + { + "description": "NewLayerName", + "name": "NewLayerName", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Change the default translation amplitude of the shaking (in pixels).", + "fullName": "Default translation amplitude", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetDefaultTranslationAmplitude", + "sentence": "Change the default translation amplitude of the shaking to _PARAM1_; _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultAmplitudeX", + "=", + "AmplitudeX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultAmplitudeY", + "=", + "AmplitudeY" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Amplitude of shaking on the X axis (in pixels)", + "name": "AmplitudeX", + "type": "expression" + }, + { + "description": "Amplitude of shaking on the Y axis (in pixels)", + "name": "AmplitudeY", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the default rotation amplitude of the shaking (in degrees).", + "fullName": "Default rotation amplitude", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetDefaultRotationAmplitude", + "sentence": "Change the default rotation amplitude of the shaking to _PARAM1_ degrees", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultAmplitudeAngle", + "=", + "AmplitudeAngle" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Angle (in degree)", + "name": "AmplitudeAngle", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the default zoom factor amplitude of the shaking. The shaking will zoom and unzoom by this factor (for instance 1.0625 is a valid value).", + "fullName": "Default zoom amplitude", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetDefaultZoomAmplitude", + "sentence": "Change the default zoom factor amplitude of the shaking to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultAmplitudeZoom", + "=", + "AmplitudeZoom" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Zoom factor", + "name": "AmplitudeZoom", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the default number of back and forth per seconds.", + "fullName": "Default shaking frequency", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetDefaultShakingFrequency", + "sentence": "Change the default shaking frequency to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultFrequency", + "=", + "Frequency" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Frequency", + "name": "Frequency", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (gdjs._cameraShakeExtension) {", + " return;", + "}", + "", + "/** Noise generator manager. */", + "class NoiseManager {", + " /**", + " * Create the manager of noise generators.", + " */", + " constructor() {", + " this.seed = gdjs.randomInRange(1, Number.MAX_SAFE_INTEGER);", + " /** @type {Map} */", + " this.generators = new Map();", + " }", + "", + " /**", + " * @param name {string}", + " * @return {NoiseGenerator}", + " */", + " getGenerator(name) {", + " let generator = this.generators.get(name);", + " if (!generator) {", + " generator = new NoiseGenerator(name + this.seed);", + " this.generators.set(name, generator);", + " }", + " return generator;", + " }", + "", + " /**", + " * @param seed {number}", + " */", + " setSeed(seed) {", + " this.seed = seed;", + " this.generators.forEach(generator => generator.setSeed(name + this.seed));", + " }", + "", + " /**", + " * @param name {string}", + " */", + " deleteGenerator(name) {", + " this.generators.delete(name);", + " }", + "", + " /**", + " */", + " deleteAllGenerators() {", + " this.generators.clear();", + " }", + "}", + "", + "/** Noise generator with octaves. */", + "class NoiseGenerator {", + " /**", + " * Create a noise generator with a seed.", + " * @param seed {string}", + " */", + " constructor(seed) {", + " this.simplexNoise = new SimplexNoise(seed);", + " this.frequency = 1;", + " this.octaves = 1;", + " this.persistence = 0.5;", + " this.lacunarity = 2;", + " this.xLoopPeriod = 0;", + " this.yLoopPeriod = 0;", + " }", + "", + " /**", + " * @param seed {string}", + " */", + " setSeed(seed) {", + " this.simplexNoise = new SimplexNoise(seed);", + " }", + "", + " /**", + " * @param x {float}", + " * @param y {float}", + " * @param z {float} optionnal", + " * @param w {float} optionnal", + " * @return {float}", + " */", + " noise(x, y, z, w) {", + " if (this.xLoopPeriod && this.yLoopPeriod) {", + " const circleRatioX = 2 * Math.PI / this.xLoopPeriod;", + " const circleRatioY = 2 * Math.PI / this.yLoopPeriod;", + " const angleX = circleRatioX * x;", + " const angleY = circleRatioY * y;", + " x = Math.cos(angleX) / circleRatioX;", + " y = Math.sin(angleX) / circleRatioX;", + " z = Math.cos(angleY) / circleRatioY;", + " w = Math.sin(angleY) / circleRatioY;", + " }", + " else if (this.xLoopPeriod) {", + " const circleRatio = 2 * Math.PI / this.xLoopPeriod;", + " const angleX = circleRatio * x;", + " w = z;", + " z = y;", + " x = Math.cos(angleX) / circleRatio;", + " y = Math.sin(angleX) / circleRatio;", + " }", + " else if (this.yLoopPeriod) {", + " const circleRatio = 2 * Math.PI / this.xLoopPeriod;", + " const angleX = circleRatio * x;", + " w = z;", + " // Make the circle perimeter equals to the looping period", + " // to keep the same perceived frequency with or without looping.", + " y = Math.cos(angleX) / circleRatio;", + " z = Math.sin(angleX) / circleRatio;", + " }", + " let noiseFunction = this.simplexNoise.noise4D.bind(this.simplexNoise);", + " if (z === undefined) {", + " noiseFunction = this.simplexNoise.noise2D.bind(this.simplexNoise);", + " }", + " else if (w === undefined) {", + " noiseFunction = this.simplexNoise.noise3D.bind(this.simplexNoise);", + " }", + " let frequency = this.frequency;", + " let noiseSum = 0;", + " let amplitudeSum = 0;", + " let amplitude = 1;", + " for (let i = 0; i < this.octaves; i++) {", + " noiseSum += noiseFunction(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;", + " amplitudeSum += Math.abs(amplitude);", + " amplitude *= this.persistence;", + " frequency *= this.lacunarity;", + " }", + " return noiseSum / amplitudeSum;", + " }", + "}", + "", + "/*", + "A fast javascript implementation of simplex noise by Jonas Wagner", + "https://github.com/jwagner/simplex-noise.js", + "", + "Based on a speed-improved simplex noise algorithm for 2D, 3D and 4D in Java.", + "Which is based on example code by Stefan Gustavson (stegu@itn.liu.se).", + "With Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).", + "Better rank ordering method by Stefan Gustavson in 2012.", + "", + " Copyright (c) 2021 Jonas Wagner", + "", + " Permission is hereby granted, free of charge, to any person obtaining a copy", + " of this software and associated documentation files (the \"Software\"), to deal", + " in the Software without restriction, including without limitation the rights", + " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", + " copies of the Software, and to permit persons to whom the Software is", + " furnished to do so, subject to the following conditions:", + "", + " The above copyright notice and this permission notice shall be included in all", + " copies or substantial portions of the Software.", + "", + " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", + " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", + " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", + " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE", + " SOFTWARE.", + " */", + "", + "const F2 = 0.5 * (Math.sqrt(3.0) - 1.0);", + "const G2 = (3.0 - Math.sqrt(3.0)) / 6.0;", + "const F3 = 1.0 / 3.0;", + "const G3 = 1.0 / 6.0;", + "const F4 = (Math.sqrt(5.0) - 1.0) / 4.0;", + "const G4 = (5.0 - Math.sqrt(5.0)) / 20.0;", + "const grad3 = new Float32Array([1, 1, 0,", + " -1, 1, 0,", + " 1, -1, 0,", + " -1, -1, 0,", + " 1, 0, 1,", + " -1, 0, 1,", + " 1, 0, -1,", + " -1, 0, -1,", + " 0, 1, 1,", + " 0, -1, 1,", + " 0, 1, -1,", + " 0, -1, -1]);", + "const grad4 = new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,", + " 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,", + " 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,", + " -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,", + " 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,", + " -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,", + " 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,", + " -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]);", + "", + "", + "/**", + " * Builds a random permutation table.", + " * This is exported only for (internal) testing purposes.", + " * Do not rely on this export.", + " * @param {() => number} random", + " * @private", + " */", + "function buildPermutationTable(random) {", + " const p = new Uint8Array(256);", + " for (let i = 0; i < 256; i++) {", + " p[i] = i;", + " }", + " for (let i = 0; i < 255; i++) {", + " const r = i + ~~(random() * (256 - i));", + " const aux = p[i];", + " p[i] = p[r];", + " p[r] = aux;", + " }", + " return p;", + "}", + "", + "/*", + "The ALEA PRNG and masher code used by simplex-noise.js", + "is based on code by Johannes Baagøe, modified by Jonas Wagner.", + "See alea.md for the full license.", + "@param {string|number} seed", + "*/", + "function alea(seed) {", + " let s0 = 0;", + " let s1 = 0;", + " let s2 = 0;", + " let c = 1;", + " const mash = masher();", + " s0 = mash(' ');", + " s1 = mash(' ');", + " s2 = mash(' ');", + " s0 -= mash(seed);", + " if (s0 < 0) {", + " s0 += 1;", + " }", + " s1 -= mash(seed);", + " if (s1 < 0) {", + " s1 += 1;", + " }", + " s2 -= mash(seed);", + " if (s2 < 0) {", + " s2 += 1;", + " }", + " return function () {", + " const t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32", + " s0 = s1;", + " s1 = s2;", + " return s2 = t - (c = t | 0);", + " };", + "}", + "", + "function masher() {", + " let n = 0xefc8249d;", + " return function (data) {", + " data = data.toString();", + " for (let i = 0; i < data.length; i++) {", + " n += data.charCodeAt(i);", + " let h = 0.02519603282416938 * n;", + " n = h >>> 0;", + " h -= n;", + " h *= n;", + " n = h >>> 0;", + " h -= n;", + " n += h * 0x100000000; // 2^32", + " }", + " return (n >>> 0) * 2.3283064365386963e-10; // 2^-32", + " };", + "}", + "", + "/** Deterministic simplex noise generator suitable for 2D, 3D and 4D spaces. */", + "class SimplexNoise {", + " /**", + " * Creates a new `SimplexNoise` instance.", + " * This involves some setup. You can save a few cpu cycles by reusing the same instance.", + " * @param {(() => number)|string|number} randomOrSeed A random number generator or a seed (string|number).", + " * Defaults to Math.random (random irreproducible initialization).", + " */", + " constructor(randomOrSeed) {", + " if (randomOrSeed === void 0) { randomOrSeed = Math.random; }", + " const random = typeof randomOrSeed == 'function' ? randomOrSeed : alea(randomOrSeed);", + " this.p = buildPermutationTable(random);", + " this.perm = new Uint8Array(512);", + " this.permMod12 = new Uint8Array(512);", + " for (let i = 0; i < 512; i++) {", + " this.perm[i] = this.p[i & 255];", + " this.permMod12[i] = this.perm[i] % 12;", + " }", + " }", + "", + " /**", + " * Samples the noise field in 2 dimensions", + " * @param {number} x", + " * @param {number} y", + " * @returns a number in the interval [-1, 1]", + " */", + " noise2D(x, y) {", + " const permMod12 = this.permMod12;", + " const perm = this.perm;", + " let n0 = 0; // Noise contributions from the three corners", + " let n1 = 0;", + " let n2 = 0;", + " // Skew the input space to determine which simplex cell we're in", + " const s = (x + y) * F2; // Hairy factor for 2D", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const t = (i + j) * G2;", + " const X0 = i - t; // Unskew the cell origin back to (x,y) space", + " const Y0 = j - t;", + " const x0 = x - X0; // The x,y distances from the cell origin", + " const y0 = y - Y0;", + " // For the 2D case, the simplex shape is an equilateral triangle.", + " // Determine which simplex we are in.", + " let i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords", + " if (x0 > y0) {", + " i1 = 1;", + " j1 = 0;", + " } // lower triangle, XY order: (0,0)->(1,0)->(1,1)", + " else {", + " i1 = 0;", + " j1 = 1;", + " } // upper triangle, YX order: (0,0)->(0,1)->(1,1)", + " // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and", + " // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where", + " // c = (3-sqrt(3))/6", + " const x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords", + " const y1 = y0 - j1 + G2;", + " const x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords", + " const y2 = y0 - 1.0 + 2.0 * G2;", + " // Work out the hashed gradient indices of the three simplex corners", + " const ii = i & 255;", + " const jj = j & 255;", + " // Calculate the contribution from the three corners", + " let t0 = 0.5 - x0 * x0 - y0 * y0;", + " if (t0 >= 0) {", + " const gi0 = permMod12[ii + perm[jj]] * 3;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0); // (x,y) of grad3 used for 2D gradient", + " }", + " let t1 = 0.5 - x1 * x1 - y1 * y1;", + " if (t1 >= 0) {", + " const gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);", + " }", + " let t2 = 0.5 - x2 * x2 - y2 * y2;", + " if (t2 >= 0) {", + " const gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);", + " }", + " // Add contributions from each corner to get the final noise value.", + " // The result is scaled to return values in the interval [-1,1].", + " return 70.0 * (n0 + n1 + n2);", + " }", + "", + " /**", + " * Samples the noise field in 3 dimensions", + " * @param {number} x", + " * @param {number} y", + " * @param {number} z", + " * @returns a number in the interval [-1, 1]", + " */", + " noise3D(x, y, z) {", + " const permMod12 = this.permMod12;", + " const perm = this.perm;", + " let n0, n1, n2, n3; // Noise contributions from the four corners", + " // Skew the input space to determine which simplex cell we're in", + " const s = (x + y + z) * F3; // Very nice and simple skew factor for 3D", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const k = Math.floor(z + s);", + " const t = (i + j + k) * G3;", + " const X0 = i - t; // Unskew the cell origin back to (x,y,z) space", + " const Y0 = j - t;", + " const Z0 = k - t;", + " const x0 = x - X0; // The x,y,z distances from the cell origin", + " const y0 = y - Y0;", + " const z0 = z - Z0;", + " // For the 3D case, the simplex shape is a slightly irregular tetrahedron.", + " // Determine which simplex we are in.", + " let i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords", + " let i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords", + " if (x0 >= y0) {", + " if (y0 >= z0) {", + " i1 = 1;", + " j1 = 0;", + " k1 = 0;", + " i2 = 1;", + " j2 = 1;", + " k2 = 0;", + " } // X Y Z order", + " else if (x0 >= z0) {", + " i1 = 1;", + " j1 = 0;", + " k1 = 0;", + " i2 = 1;", + " j2 = 0;", + " k2 = 1;", + " } // X Z Y order", + " else {", + " i1 = 0;", + " j1 = 0;", + " k1 = 1;", + " i2 = 1;", + " j2 = 0;", + " k2 = 1;", + " } // Z X Y order", + " }", + " else { // x0 y0)", + " rankx++;", + " else", + " ranky++;", + " if (x0 > z0)", + " rankx++;", + " else", + " rankz++;", + " if (x0 > w0)", + " rankx++;", + " else", + " rankw++;", + " if (y0 > z0)", + " ranky++;", + " else", + " rankz++;", + " if (y0 > w0)", + " ranky++;", + " else", + " rankw++;", + " if (z0 > w0)", + " rankz++;", + " else", + " rankw++;", + " // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.", + " // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0;", + " const j1 = ranky >= 3 ? 1 : 0;", + " const k1 = rankz >= 3 ? 1 : 0;", + " const l1 = rankw >= 3 ? 1 : 0;", + " // The integer offsets for the third simplex corner", + " const i2 = rankx >= 2 ? 1 : 0;", + " const j2 = ranky >= 2 ? 1 : 0;", + " const k2 = rankz >= 2 ? 1 : 0;", + " const l2 = rankw >= 2 ? 1 : 0;", + " // The integer offsets for the fourth simplex corner", + " const i3 = rankx >= 1 ? 1 : 0;", + " const j3 = ranky >= 1 ? 1 : 0;", + " const k3 = rankz >= 1 ? 1 : 0;", + " const l3 = rankw >= 1 ? 1 : 0;", + " // The fifth corner has all coordinate offsets = 1, so no need to compute that.", + " const x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords", + " const y1 = y0 - j1 + G4;", + " const z1 = z0 - k1 + G4;", + " const w1 = w0 - l1 + G4;", + " const x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords", + " const y2 = y0 - j2 + 2.0 * G4;", + " const z2 = z0 - k2 + 2.0 * G4;", + " const w2 = w0 - l2 + 2.0 * G4;", + " const x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords", + " const y3 = y0 - j3 + 3.0 * G4;", + " const z3 = z0 - k3 + 3.0 * G4;", + " const w3 = w0 - l3 + 3.0 * G4;", + " const x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords", + " const y4 = y0 - 1.0 + 4.0 * G4;", + " const z4 = z0 - 1.0 + 4.0 * G4;", + " const w4 = w0 - 1.0 + 4.0 * G4;", + " // Work out the hashed gradient indices of the five simplex corners", + " const ii = i & 255;", + " const jj = j & 255;", + " const kk = k & 255;", + " const ll = l & 255;", + " // Calculate the contribution from the five corners", + " let t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;", + " if (t0 < 0)", + " n0 = 0.0;", + " else {", + " const gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);", + " }", + " let t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;", + " if (t1 < 0)", + " n1 = 0.0;", + " else {", + " const gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);", + " }", + " let t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;", + " if (t2 < 0)", + " n2 = 0.0;", + " else {", + " const gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);", + " }", + " let t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;", + " if (t3 < 0)", + " n3 = 0.0;", + " else {", + " const gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;", + " t3 *= t3;", + " n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);", + " }", + " let t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;", + " if (t4 < 0)", + " n4 = 0.0;", + " else {", + " const gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;", + " t4 *= t4;", + " n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);", + " }", + " // Sum up and scale the result to cover the range [-1,1]", + " return 27.0 * (n0 + n1 + n2 + n3 + n4);", + " };", + "}", + "", + "gdjs._cameraShakeExtension = {", + " noiseManager: new NoiseManager(),", + "};", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Generate a number from 2 dimensional simplex noise.", + "fullName": "2D noise", + "functionType": "Expression", + "name": "Noise2d", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "const x = eventsFunctionContext.getArgument(\"X\");\r", + "const y = eventsFunctionContext.getArgument(\"Y\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).noise(x, y);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + }, + { + "description": "X coordinate", + "name": "X", + "type": "expression" + }, + { + "description": "Y coordinate", + "name": "Y", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Generate a number from 3 dimensional simplex noise.", + "fullName": "3D noise", + "functionType": "Expression", + "name": "Noise3d", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "const x = eventsFunctionContext.getArgument(\"X\");\r", + "const y = eventsFunctionContext.getArgument(\"Y\");\r", + "const z = eventsFunctionContext.getArgument(\"Z\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).noise(x, y, z);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + }, + { + "description": "X coordinate", + "name": "X", + "type": "expression" + }, + { + "description": "Y coordinate", + "name": "Y", + "type": "expression" + }, + { + "description": "Z coordinate", + "name": "Z", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Generate a number from 4 dimensional simplex noise.", + "fullName": "4D noise", + "functionType": "Expression", + "name": "Noise4d", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "const x = eventsFunctionContext.getArgument(\"X\");\r", + "const y = eventsFunctionContext.getArgument(\"Y\");\r", + "const z = eventsFunctionContext.getArgument(\"Z\");\r", + "const w = eventsFunctionContext.getArgument(\"W\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).noise(x, y, z, w);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + }, + { + "description": "X coordinate", + "name": "X", + "type": "expression" + }, + { + "description": "Y coordinate", + "name": "Y", + "type": "expression" + }, + { + "description": "Z coordinate", + "name": "Z", + "type": "expression" + }, + { + "description": "W coordinate", + "name": "W", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Create a noise generator with default settings (frequency = 1, octaves = 1, persistence = 0.5, lacunarity = 2).", + "fullName": "Create a noise generator", + "functionType": "Action", + "name": "Create", + "private": true, + "sentence": "Create a noise generator named _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Delete a noise generator and loose its settings.", + "fullName": "Delete a noise generator", + "functionType": "Action", + "name": "Delete", + "private": true, + "sentence": "Delete _PARAM1_ noise generator", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.deleteGenerator(name);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Delete all noise generators and loose their settings.", + "fullName": "Delete all noise generators", + "functionType": "Action", + "name": "DeleteAll", + "private": true, + "sentence": "Delete all noise generators", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "gdjs._cameraShakeExtension.noiseManager.deleteAllGenerators();", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "The seed is a number used to generate the random noise. Setting the same seed will result in the same random noise generation. It's for example useful to generate the same world, by saving this seed value and reusing it later to generate again a world.", + "fullName": "Noise seed", + "functionType": "Action", + "name": "SetSeed", + "private": true, + "sentence": "Change the noise seed to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "gdjs._cameraShakeExtension.noiseManager.setSeed(eventsFunctionContext.getArgument(\"Seed\"));", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Seed", + "longDescription": "15 digits numbers maximum", + "name": "Seed", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the looping period on X used for noise generation. The noise will wrap-around on X.", + "fullName": "Noise looping period on X", + "functionType": "Action", + "name": "SetLoopPeriodX", + "private": true, + "sentence": "Change the looping period on X of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).xLoopPeriod = eventsFunctionContext.getArgument(\"LoopPeriod\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Looping period on X", + "name": "LoopPeriod", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the looping period on Y used for noise generation. The noise will wrap-around on Y.", + "fullName": "Noise looping period on Y", + "functionType": "Action", + "name": "SetLoopPeriodY", + "private": true, + "sentence": "Change the looping period on Y of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).yLoopPeriod = eventsFunctionContext.getArgument(\"LoopPeriod\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Looping period on Y", + "name": "LoopPeriod", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the base frequency used for noise generation. A lower frequency will zoom in the noise.", + "fullName": "Noise base frequency", + "functionType": "Action", + "name": "SetFrequency", + "private": true, + "sentence": "Change the noise frequency of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).frequency = eventsFunctionContext.getArgument(\"Frequency\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Frequency", + "name": "Frequency", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the number of octaves used for noise generation. It can be seen as layers of noise with different zoom.", + "fullName": "Noise octaves", + "functionType": "Action", + "name": "SetOctaves", + "private": true, + "sentence": "Change the number of noise octaves of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).octaves = eventsFunctionContext.getArgument(\"Octaves\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Octaves", + "name": "Octaves", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the persistence used for noise generation. At its default value \"0.5\", it halves the noise amplitude at each octave.", + "fullName": "Noise persistence", + "functionType": "Action", + "name": "SetPersistence", + "private": true, + "sentence": "Change the noise persistence of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).persistence = eventsFunctionContext.getArgument(\"Persistence\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Persistence", + "name": "Persistence", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the lacunarity used for noise generation. At its default value \"2\", it doubles the frequency at each octave.", + "fullName": "Noise lacunarity", + "functionType": "Action", + "name": "SetLacunarity", + "private": true, + "sentence": "Change the noise lacunarity of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).lacunarity = eventsFunctionContext.getArgument(\"Lacunarity\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Lacunarity", + "name": "Lacunarity", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "The seed used for noise generation.", + "fullName": "Noise seed", + "functionType": "Expression", + "name": "Seed", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.seed;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "The base frequency used for noise generation.", + "fullName": "Noise base frequency", + "functionType": "Expression", + "name": "Frequency", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).frequency;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "The number of octaves used for noise generation.", + "fullName": "Noise octaves number", + "functionType": "Expression", + "name": "Octaves", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).octaves;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "The persistence used for noise generation.", + "fullName": "Noise persistence", + "functionType": "Expression", + "name": "Persistence", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).persistence;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "The lacunarity used for noise generation.", + "fullName": "Noise lacunarity", + "functionType": "Expression", + "name": "Lacunarity", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).lacunarity;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "Silver-Streak, @Bouh, Tristan Rhodes", + "category": "Game mechanic", + "extensionNamespace": "", + "fullName": "Object \"Is On Screen\" Detection", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLW1vbml0b3Itc2NyZWVuc2hvdCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik05LDZINVYxMEg3VjhIOU0xOSwxMEgxN1YxMkgxNVYxNEgxOU0yMSwxNkgzVjRIMjFNMjEsMkgzQzEuODksMiAxLDIuODkgMSw0VjE2QTIsMiAwIDAsMCAzLDE4SDEwVjIwSDhWMjJIMTZWMjBIMTRWMThIMjFBMiwyIDAgMCwwIDIzLDE2VjRDMjMsMi44OSAyMi4xLDIgMjEsMiIgLz48L3N2Zz4=", + "name": "IsOnScreen", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/monitor-screenshot.svg", + "shortDescription": "This adds a condition to detect if an object is on screen based off its current layer.", + "version": "1.2.1", + "description": [ + "This extension adds conditions to check if an object is located within the visible portion of its layer's camera. The condition also allows for specifying padding to the virtual screen border.", + "", + "Note that this does not take into account any object visibility, such as being hidden or 0 opacity, but can be combined with those existing conditions." + ], + "origin": { + "identifier": "IsOnScreen", + "name": "gdevelop-extension-store" + }, + "tags": [ + "is on screen", + "condition", + "visible", + "hide", + "screen" + ], + "authorIds": [ + "2OwwM8ToR9dx9RJ2sAKTcrLmCB92", + "8Ih1aa8f5gWUp4UB2BdhQ2iXWxJ3", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "This behavior provides a condition to check if the object is located within the visible portion of its layer's camera. The condition also allows for specifying padding to the virtual screen border.\nNote that object visibility, such as being hidden or 0 opacity, is not considered (but you can use those existing conditions in addition to this behavior).", + "fullName": "Is on screen", + "name": "InOnScreen", + "objectType": "", + "eventsFunctions": [ + { + "description": "Checks if an object position is within the viewport of its layer.", + "fullName": "Is on screen", + "functionType": "Condition", + "name": "IsOnScreen", + "sentence": "_PARAM0_ is on screen (padded by _PARAM2_ pixels)", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/*", + "Get the object layer, convert the position from this layer to the screen coordinates.", + "Get the point on each side on the object on screen, and compare with the screen area.", + "", + "This way even if the camera has a rotation or custom scale the object is always compared to the screen area.", + "*/", + "", + "", + "// Get the layer of the object.", + "const object = objects[0];", + "const layer = runtimeScene.getLayer(object.getLayer());", + "", + "// Get the aabb of the object on his layer.", + "const aabb = object.getVisibilityAABB();", + "", + "// Get the layer to convert the coordinates of the AABB to the screen coordinates", + "const topLeft = layer.convertInverseCoords(aabb.min[0], aabb.min[1]);", + "const topRight = layer.convertInverseCoords(aabb.max[0], aabb.min[1]);", + "const bottomRight = layer.convertInverseCoords(aabb.max[0], aabb.max[1]);", + "const bottomLeft = layer.convertInverseCoords(aabb.min[0], aabb.max[1]);", + "", + "// Get the points on each side of the object on screen.", + "const posLeftObjectOnScreen = Math.min(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]);", + "const posRightObjectOnScreen = Math.max(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]);", + "const posUpObjectOnScreen = Math.min(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]);", + "const posDownObjectOnScreen = Math.max(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]);", + "", + "const padding = eventsFunctionContext.getArgument(\"Padding\");", + "", + "if (", + " !(posLeftObjectOnScreen - padding > runtimeScene.getGame().getGameResolutionWidth() ||", + " posUpObjectOnScreen - padding > runtimeScene.getGame().getGameResolutionHeight() ||", + " posRightObjectOnScreen + padding < 0 ||", + " posDownObjectOnScreen + padding < 0", + " )", + ") {", + " eventsFunctionContext.returnValue = true;", + "}", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "IsOnScreen::InOnScreen", + "type": "behavior" + }, + { + "description": "Padding (in pixels)", + "longDescription": "Number of pixels to pad the screen border. Zero by default. A negative value goes inside the screen, a positive value go outside.", + "name": "Padding", + "type": "expression" + } + ], + "objectGroups": [ + { + "name": "Group", + "objects": [] + } + ] + } + ], + "propertyDescriptors": [], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "User interface", + "extensionNamespace": "", + "fullName": "Slider", + "helpPath": "/objects/slider", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMjMiIGN5PSI3IiByPSIzIi8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMyIgeTE9IjciIHgyPSIyMCIgeTI9IjciLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyOSIgeTE9IjciIHgyPSIyNiIgeTI9IjciLz4NCjxjaXJjbGUgY2xhc3M9InN0MCIgY3g9IjEyIiBjeT0iMTYiIHI9IjMiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIzIiB5MT0iMTYiIHgyPSI5IiB5Mj0iMTYiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyOSIgeTE9IjE2IiB4Mj0iMTUiIHkyPSIxNiIvPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMjMiIGN5PSIyNSIgcj0iMyIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjMiIHkxPSIyNSIgeDI9IjIwIiB5Mj0iMjUiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyOSIgeTE9IjI1IiB4Mj0iMjYiIHkyPSIyNSIvPg0KPC9zdmc+DQo=", + "name": "PanelSpriteSlider", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/UI Essentials/1678c39a3b2bd3df4f82a8a293770db4986a6bcfd3f78e738ddfc86e39176423_UI Essentials_sliders_options.svg", + "shortDescription": "A draggable slider that users can move to select a numerical value.", + "version": "1.4.2", + "description": [ + "A draggable slider that users can move to select a numerical value. The slider can be customized with sprites.", + "", + "There are ready-to-use sliders in the asset-store [settings UI pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=settings-ui-settings-ui)." + ], + "origin": { + "identifier": "PanelSpriteSlider", + "name": "gdevelop-extension-store" + }, + "tags": [ + "draggable", + "slider", + "ui", + "widget" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Represent a value on a slider.", + "fullName": "Slider", + "name": "Slider", + "objectType": "", + "private": true, + "eventsFunctions": [ + { + "description": "the value of the object.", + "fullName": "Value", + "functionType": "ExpressionAndCondition", + "name": "Value", + "sentence": "the value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyValue()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::Slider", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Value", + "name": "SetValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::Slider::PropertyStepSize" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::Slider::SetPropertyValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(GetArgumentAsNumber(\"Value\"), Object.Behavior::PropertyMinValue(), Object.Behavior::PropertyMaxValue())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::Slider::PropertyStepSize" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::Slider::SetPropertyValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(round(GetArgumentAsNumber(\"Value\") / Object.Behavior::PropertyStepSize()) * Object.Behavior::PropertyStepSize(), Object.Behavior::PropertyMinValue(), Object.Behavior::PropertyMaxValue())" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::Slider", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the minimum value of the object.", + "fullName": "Minimum value", + "functionType": "ExpressionAndCondition", + "group": "Resource bar configuration", + "name": "MinValue", + "sentence": "the minimum value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyMinValue()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::Slider", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MinValue", + "name": "SetMinValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::Slider::SetPropertyMinValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::Slider::SetValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::Value()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::Slider", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum value of the object.", + "fullName": "Maximum value", + "functionType": "ExpressionAndCondition", + "group": "Resource bar configuration", + "name": "MaxValue", + "sentence": "the maximum value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyMaxValue()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::Slider", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MaxValue", + "name": "SetMaxValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::Slider::SetPropertyMaxValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::Slider::SetValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::Value()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::Slider", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the bar value bounds size.", + "fullName": "Size", + "functionType": "ExpressionAndCondition", + "name": "Size", + "sentence": "the bar value bounds size", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::MaxValue() - Object.Behavior::MinValue()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::Slider", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the step size of the object.", + "fullName": "Step size", + "functionType": "ExpressionAndCondition", + "group": "Resource bar configuration", + "name": "StepSize", + "sentence": "the step size", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyStepSize()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::Slider", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StepSize", + "name": "SetStepSize", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::Slider::SetPropertyStepSize" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::Slider::SetValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::Value()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::Slider", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0", + "type": "Number", + "label": "Value", + "description": "", + "group": "", + "extraInformation": [], + "name": "Value" + }, + { + "value": "0", + "type": "Number", + "label": "Minimum value", + "description": "", + "group": "", + "extraInformation": [], + "name": "MinValue" + }, + { + "value": "1", + "type": "Number", + "label": "Maximum value", + "description": "", + "group": "", + "extraInformation": [], + "name": "MaxValue" + }, + { + "value": "0", + "type": "Number", + "label": "Step size", + "description": "", + "group": "", + "extraInformation": [], + "name": "StepSize" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "The finite state machine used internally by the button object.", + "fullName": "Button finite state machine", + "name": "ButtonFSM", + "objectType": "", + "private": true, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Finite state machine", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The \"Validated\" state only last one frame." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Check position", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make sure the cursor position is only checked once per frame." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyShouldCheckHovering" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "MouseOnlyCursorX(Object.Layer(), 0)", + "MouseOnlyCursorY(Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Touches are always pressed, so ShouldCheckHovering doesn't matter." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)", + "TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Handle touch start", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StartedTouchOrMouseCount()", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Apply position changes", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PanelSpriteSlider::ButtonFSM::PropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PanelSpriteSlider::ButtonFSM::PropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Handle touch end", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasTouchEnded" + }, + "parameters": [ + "", + "Object.Behavior::PropertyTouchId()" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + }, + { + "type": { + "inverted": true, + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is not used.", + "fullName": "Is idle", + "functionType": "Condition", + "name": "IsIdle", + "sentence": "_PARAM0_ is idle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button was just clicked.", + "fullName": "Is clicked", + "functionType": "Condition", + "name": "IsClicked", + "sentence": "_PARAM0_ is clicked", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the cursor is hovered over the button.", + "fullName": "Is hovered", + "functionType": "Condition", + "name": "IsHovered", + "sentence": "_PARAM0_ is hovered", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is either hovered or pressed but not hovered.", + "fullName": "Is focused", + "functionType": "Condition", + "name": "IsFocused", + "sentence": "_PARAM0_ is focused", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is currently being pressed with mouse or touch.", + "fullName": "Is pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "_PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is currently being pressed outside with mouse or touch.", + "fullName": "Is held outside", + "functionType": "Condition", + "name": "IsPressedOutside", + "sentence": "_PARAM0_ is held outside", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the touch id that is using the button or 0 if none.", + "fullName": "Touch id", + "functionType": "ExpressionAndCondition", + "name": "TouchId", + "sentence": "the touch id", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyTouchId()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "true", + "type": "Boolean", + "label": "", + "description": "Should check hovering", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShouldCheckHovering" + }, + { + "value": "Idle", + "type": "Choice", + "label": "State", + "description": "", + "group": "", + "extraInformation": [ + "Idle", + "Hovered", + "PressedInside", + "PressedOutside", + "Validated" + ], + "hidden": true, + "name": "State" + }, + { + "value": "0", + "type": "Number", + "label": "Touch id", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchId" + }, + { + "value": "", + "type": "Boolean", + "label": "Touch is inside", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchIsInside" + }, + { + "value": "", + "type": "Boolean", + "label": "Mouse is inside", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "MouseIsInside" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Index" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [ + { + "areaMaxX": 64, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "defaultName": "Slider", + "description": "Let users select a numerical value by dragging a slider.", + "fullName": "Slider", + "name": "PanelSpriteSlider", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "This allows to detect a change of \"intial value\" on hot reload." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::SetPropertyPreviousInitialValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyInitialValue()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Create the child-object instances." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Background", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "FillBar", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Thumb", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Background", + "=", + "1" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "FillBar", + "=", + "2" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Thumb", + "=", + "3" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Create the label that is displayed over the thumb." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Label", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Label", + "=", + "4" + ] + }, + { + "type": { + "value": "TextObject::SetWrapping" + }, + "parameters": [ + "Label", + "no" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Label" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Pass the configuration to the behavior." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateSliderConfiguration" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::SetValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyInitialValue()", + "Object.PropertyInitialValue()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetIncludedInParentCollisionMask" + }, + "parameters": [ + "Label", + "" + ] + }, + { + "type": { + "value": "SetIncludedInParentCollisionMask" + }, + "parameters": [ + "Thumb", + "" + ] + }, + { + "type": { + "value": "SetIncludedInParentCollisionMask" + }, + "parameters": [ + "FillBar", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateSliderConfiguration" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::PropertyInitialValue" + }, + "parameters": [ + "Object", + "!=", + "Object.PropertyPreviousInitialValue()" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::SetPropertyPreviousInitialValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyInitialValue()" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::SetValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyInitialValue()", + "Object.PropertyInitialValue()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Handle touches", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BehaviorActivated" + }, + "parameters": [ + "Background", + "ButtonFSM" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "DraggableBehavior::Dragged" + }, + "parameters": [ + "Thumb", + "Draggable" + ] + }, + { + "type": { + "inverted": true, + "value": "DraggableBehavior::Dropped" + }, + "parameters": [ + "Thumb", + "Draggable" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::IsPressed" + }, + "parameters": [ + "Background", + "ButtonFSM", + "" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::IsPressedOutside" + }, + "parameters": [ + "Background", + "ButtonFSM", + "" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::SetValue" + }, + "parameters": [ + "Object", + "=", + "FillBar.Slider::MinValue() + FillBar.Slider::Size() * (TouchX(Background.ButtonFSM::TouchId(), Object.Layer()) - Object.FullBarLeft()) / Object.FullBarWidth()", + "FillBar.Slider::MinValue() + FillBar.Slider::Size() * (MouseX() - Object.FullBarLeft()) / Object.FullBarWidth()" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::PropertyShowLabelAtChanges" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Label", + "" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Label", + "\"HideBack\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DraggableBehavior::Dragged" + }, + "parameters": [ + "Thumb", + "Draggable" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::SetValue" + }, + "parameters": [ + "Object", + "=", + "FillBar.Slider::MinValue() + FillBar.Slider::Size() * (Thumb.CenterX() - Object.FullBarLeft()) / Object.FullBarWidth()", + "FillBar.Slider::MinValue() + FillBar.Slider::Size() * (Thumb.CenterX() - Object.FullBarLeft()) / Object.FullBarWidth()" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::PropertyShowLabelAtChanges" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Label", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DraggableBehavior::Dropped" + }, + "parameters": [ + "Thumb", + "Draggable" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Label", + "\"HideBack\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::PropertyShowLabelAtChanges" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Thumb", + "MouseOnlyCursorX(Object.Layer(), 0)", + "MouseOnlyCursorY(Thumb.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Label", + "" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Label", + "\"HideBack\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Label", + "\"HideBack\"", + ">", + "0.5" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Label" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Label", + "\"HideBack\"" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Resize", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Children instances must be resized when the parent size change:\n- background is resized to take the full dimensions of the parent\n- the label is put back at the center of the bar\n\nThe scale is set back to 1 because it means that the parent instance has the same dimensions as the union of its children instances." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Object.Width()", + "!=", + "max(Background.BoundingBoxRight(), max(Label.BoundingBoxRight(), Thumb.BoundingBoxRight())) - min(Background.BoundingBoxLeft(), min(Label.BoundingBoxLeft(), Thumb.BoundingBoxLeft()))" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Object.Height()", + "!=", + "max(Background.BoundingBoxBottom(), max(Label.BoundingBoxBottom(), Thumb.BoundingBoxBottom())) - min(Background.BoundingBoxTop(), min(Label.BoundingBoxTop(), Thumb.BoundingBoxTop()))" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Background", + "Width", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Background", + "Height", + "=", + "Object.Height()" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::Scale" + }, + "parameters": [ + "Object", + "=", + "1" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Background", + "=", + "Background.Variable(Width)" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Background", + "=", + "Background.Variable(Height)" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The parent size is not defined in onCreate so it needs to be done here." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateThumbPosition" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the slider is being dragged.", + "fullName": "Being dragged", + "functionType": "Condition", + "group": "Slider", + "name": "IsBeingDragged", + "sentence": "_PARAM0_ is being dragged", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "DraggableBehavior::Dragged" + }, + "parameters": [ + "Thumb", + "Draggable" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::IsPressed" + }, + "parameters": [ + "Background", + "ButtonFSM", + "" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::ButtonFSM::IsPressedOutside" + }, + "parameters": [ + "Background", + "ButtonFSM", + "" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the value of the slider.", + "fullName": "Value", + "functionType": "ExpressionAndCondition", + "name": "Value", + "sentence": "the value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FillBar.Slider::Value()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Value", + "name": "SetValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::Slider::SetValue" + }, + "parameters": [ + "FillBar", + "Slider", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateThumbPosition" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::Slider", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the minimum value of the slider.", + "fullName": "Minimum value", + "functionType": "ExpressionAndCondition", + "group": "Slider configuration", + "name": "MinValue", + "sentence": "the minimum value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FillBar.Slider::MinValue()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MinValue", + "name": "SetMinValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::Slider::SetMinValue" + }, + "parameters": [ + "FillBar", + "Slider", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateThumbPosition" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::Slider", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum value of the slider.", + "fullName": "Maximum value", + "functionType": "ExpressionAndCondition", + "group": "Slider configuration", + "name": "MaxValue", + "sentence": "the maximum value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FillBar.Slider::MaxValue()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MaxValue", + "name": "SetMaxValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::Slider::SetMaxValue" + }, + "parameters": [ + "FillBar", + "Slider", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateThumbPosition" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::Slider", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the step size of the slider.", + "fullName": "Step size", + "functionType": "ExpressionAndCondition", + "group": "Slider configuration", + "name": "StepSize", + "sentence": "the step size", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FillBar.Slider::StepSize()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StepSize", + "name": "SetStepSize", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::Slider::SetStepSize" + }, + "parameters": [ + "FillBar", + "Slider", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteSlider::Slider", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the label is shown.", + "fullName": "Label is shown", + "functionType": "Condition", + "group": "Slider configuration", + "name": "IsLabelShown", + "sentence": "_PARAM0_ label is shown", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::PropertyShowLabelAtChanges" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Show (or hide) the label on the bar.", + "fullName": "Show label", + "functionType": "Action", + "group": "Slider configuration", + "name": "SetLabelShown", + "sentence": "Show the label of _PARAM0_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::SetPropertyShowLabelAtChanges" + }, + "parameters": [ + "Object", + "no" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Label" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::SetPropertyShowLabelAtChanges" + }, + "parameters": [ + "Object", + "yes" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Label", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + }, + { + "description": "Show the label", + "name": "Value", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Center the bar according to the button configuration. This is used in doStepPostEvents when the button is resized.", + "fullName": "Update layout", + "functionType": "Action", + "name": "UpdateLayout", + "private": true, + "sentence": "Update layout of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "FillBar", + "=", + "Object.PropertyBarLeftPadding()", + "=", + "Object.PropertyBarTopPadding()" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "FillBar", + "=", + "round(Background.Height() - Object.PropertyBarTopPadding() - Object.PropertyBarBottomPadding())" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Update the thumb position according to the slider value.", + "fullName": "Update thumb position", + "functionType": "Action", + "name": "UpdateThumbPosition", + "private": true, + "sentence": "Update the thumb position of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteSlider::Slider::Size" + }, + "parameters": [ + "FillBar", + "Slider", + ">", + "0", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "FillBar", + "=", + "Object.FullBarWidth() * (FillBar.Slider::Value() - FillBar.Slider::MinValue()) / FillBar.Slider::Size()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCenterX" + }, + "parameters": [ + "Thumb", + "=", + "Object.FullBarLeft() + FillBar.Width()" + ] + }, + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Thumb", + "=", + "FillBar.CenterY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextObject::String" + }, + "parameters": [ + "Label", + "=", + "ToString(Object.Value())" + ] + }, + { + "type": { + "value": "SetCenterX" + }, + "parameters": [ + "Label", + "=", + "Thumb.CenterX()" + ] + }, + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Label", + "=", + "Thumb.Y() - Label.Height() - Object.PropertyLabelMargin()" + ] + }, + { + "type": { + "value": "TextObject::Angle" + }, + "parameters": [ + "Label", + "=", + "-Object.Angle()" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Expression", + "name": "FullBarLeft", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyBarLeftPadding()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Expression", + "name": "FullBarRight", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Background.Width() - Object.PropertyBarRightPadding()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Expression", + "name": "FullBarWidth", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Background.Width() - Object.PropertyBarLeftPadding() - Object.PropertyBarRightPadding()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Update the slider configuration.", + "fullName": "Update slider configuration", + "functionType": "Action", + "name": "UpdateSliderConfiguration", + "private": true, + "sentence": "Update the slider configuration of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Pass configuration to the behavior and update children." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::SetMinValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyMinValue()", + "Object.PropertyMaxValue()", + "" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::SetMaxValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyMaxValue()", + "Object.PropertyMaxValue()" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::SetStepSize" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyStepSize()", + "Object.PropertyMaxValue()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "De/activate interactions with the button.", + "fullName": "De/activate interactions", + "functionType": "Action", + "name": "Activate", + "sentence": "Activate interactions with _PARAM0_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Thumb", + "Draggable", + "yes" + ] + }, + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Background", + "ButtonFSM", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Thumb", + "Draggable", + "no" + ] + }, + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Background", + "ButtonFSM", + "no" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Label" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + }, + { + "description": "Activate", + "name": "ShouldActivate", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the slider allows interactions.", + "fullName": "Interactions activated", + "functionType": "Condition", + "name": "IsActivated", + "sentence": "Interactions on _PARAM0_ are activated", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BehaviorActivated" + }, + "parameters": [ + "Background", + "ButtonFSM" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0", + "type": "Number", + "label": "Bar left margin", + "description": "", + "group": "Bar", + "extraInformation": [ + "Label", + "FillBar" + ], + "name": "BarLeftPadding" + }, + { + "value": "0", + "type": "Number", + "label": "Bar top margin", + "description": "", + "group": "Bar", + "extraInformation": [ + "Label", + "FillBar" + ], + "name": "BarTopPadding" + }, + { + "value": "0", + "type": "Number", + "label": "Bar right margin", + "description": "", + "group": "Bar", + "extraInformation": [ + "Label", + "FillBar" + ], + "name": "BarRightPadding" + }, + { + "value": "0", + "type": "Number", + "label": "Bar bottom margin", + "description": "", + "group": "Bar", + "extraInformation": [ + "Label", + "FillBar" + ], + "name": "BarBottomPadding" + }, + { + "value": "true", + "type": "Boolean", + "label": "Show the label when the value is changed", + "description": "", + "group": "Label", + "extraInformation": [], + "name": "ShowLabelAtChanges" + }, + { + "value": "8", + "type": "Number", + "label": "Label margin", + "description": "", + "group": "Label", + "extraInformation": [], + "name": "LabelMargin" + }, + { + "value": "0", + "type": "Number", + "label": "Minimum value", + "description": "", + "group": "Value", + "extraInformation": [], + "name": "MinValue" + }, + { + "value": "100", + "type": "Number", + "label": "Maximum value", + "description": "", + "group": "Value", + "extraInformation": [], + "name": "MaxValue" + }, + { + "value": "1", + "type": "Number", + "label": "Step size", + "description": "", + "group": "Value", + "extraInformation": [], + "name": "StepSize" + }, + { + "value": "50", + "type": "Number", + "label": "Initial value", + "description": "", + "group": "Value", + "extraInformation": [], + "name": "InitialValue" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "It's used to detect a change at hot reload.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "PreviousInitialValue" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Thumb" + ], + "hidden": true, + "name": "ThumbAnchorOrigin" + }, + { + "value": "Center-right", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "FillBar" + ], + "hidden": true, + "name": "ThumbAnchorTarget" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Label" + ], + "hidden": true, + "name": "ShowLabel" + } + ], + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Label", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "It displays the value when it changes.", + "font": "", + "textAlignment": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "It displays the value when it changes.", + "font": "", + "textAlignment": "", + "characterSize": 20, + "color": "0;0;0" + } + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Thumb", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Draggable", + "type": "DraggableBehavior::Draggable", + "checkCollisionMask": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "FillBar", + "rightMargin": 0, + "texture": "", + "tiled": true, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Slider", + "type": "PanelSpriteSlider::Slider", + "Value": 0, + "MinValue": 0, + "MaxValue": 1, + "StepSize": 1 + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Background", + "rightMargin": 0, + "texture": "", + "tiled": true, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "ButtonFSM", + "type": "PanelSpriteSlider::ButtonFSM", + "ShouldCheckHovering": true, + "State": "Idle", + "TouchId": 0, + "TouchIsInside": false, + "MouseIsInside": false, + "Index": 0 + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Label" + }, + { + "objectName": "Thumb" + }, + { + "objectName": "FillBar" + }, + { + "objectName": "Background" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [] + } + ] + }, + { + "author": "", + "category": "User interface", + "extensionNamespace": "", + "fullName": "Panel sprite button", + "helpPath": "/objects/button", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI5LDIzSDNjLTEuMSwwLTItMC45LTItMlYxMWMwLTEuMSwwLjktMiwyLTJoMjZjMS4xLDAsMiwwLjksMiwydjEwQzMxLDIyLjEsMzAuMSwyMywyOSwyM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMywxOUwxMywxOWMtMS4xLDAtMi0wLjktMi0ydi0yYzAtMS4xLDAuOS0yLDItMmgwYzEuMSwwLDIsMC45LDIsMnYyQzE1LDE4LjEsMTQuMSwxOSwxMywxOXoiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIxOCIgeTE9IjEzIiB4Mj0iMTgiIHkyPSIxOSIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIxIiB5MT0iMTMiIHgyPSIxOCIgeTI9IjE3Ii8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMjEiIHkxPSIxOSIgeDI9IjE5IiB5Mj0iMTYiLz4NCjwvc3ZnPg0K", + "name": "PanelSpriteButton", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg", + "shortDescription": "A button that can be customized.", + "version": "1.4.4", + "description": [ + "The button can be customized with a background for each state and a label. It handles user interactions and a simple condition can be used to check if it is clicked.", + "", + "There are ready-to-use buttons in the asset-store [menu buttons pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=menu-buttons-menu-buttons)." + ], + "origin": { + "identifier": "PanelSpriteButton", + "name": "gdevelop-extension-store" + }, + "tags": [ + "button", + "ui" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "The finite state machine used internally by the button object.", + "fullName": "Button finite state machine", + "name": "ButtonFSM", + "objectType": "", + "private": true, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Finite state machine", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The \"Validated\" state only last one frame." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Check position", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make sure the cursor position is only checked once per frame." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyShouldCheckHovering" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "MouseOnlyCursorX(Object.Layer(), 0)", + "MouseOnlyCursorY(Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Touches are always pressed, so ShouldCheckHovering doesn't matter." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)", + "TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Handle touch start", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StartedTouchOrMouseCount()", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + ] + }, + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + }, + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Apply position changes", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PanelSpriteButton::ButtonFSM::PropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PanelSpriteButton::ButtonFSM::PropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Handle touch end", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasTouchEnded" + }, + "parameters": [ + "", + "Object.Behavior::PropertyTouchId()" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + }, + { + "type": { + "inverted": true, + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::ResetState" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Reset the state of the button.", + "fullName": "Reset state", + "functionType": "Action", + "name": "ResetState", + "private": true, + "sentence": "Reset the button state of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + }, + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is not used.", + "fullName": "Is idle", + "functionType": "Condition", + "name": "IsIdle", + "sentence": "_PARAM0_ is idle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button was just clicked.", + "fullName": "Is clicked", + "functionType": "Condition", + "name": "IsClicked", + "sentence": "_PARAM0_ is clicked", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the cursor is hovered over the button.", + "fullName": "Is hovered", + "functionType": "Condition", + "name": "IsHovered", + "sentence": "_PARAM0_ is hovered", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is either hovered or pressed but not hovered.", + "fullName": "Is focused", + "functionType": "Condition", + "name": "IsFocused", + "sentence": "_PARAM0_ is focused", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is currently being pressed with mouse or touch.", + "fullName": "Is pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "_PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is currently being pressed outside with mouse or touch.", + "fullName": "Is held outside", + "functionType": "Condition", + "name": "IsPressedOutside", + "sentence": "_PARAM0_ is held outside", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the touch id that is using the button or 0 if none.", + "fullName": "Touch id", + "functionType": "ExpressionAndCondition", + "name": "TouchId", + "sentence": "the touch id", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyTouchId()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "true", + "type": "Boolean", + "label": "", + "description": "Should check hovering", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShouldCheckHovering" + }, + { + "value": "Idle", + "type": "Choice", + "label": "State", + "description": "", + "group": "", + "extraInformation": [ + "Idle", + "Hovered", + "PressedInside", + "PressedOutside", + "Validated" + ], + "hidden": true, + "name": "State" + }, + { + "value": "0", + "type": "Number", + "label": "Touch id", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchId" + }, + { + "value": "", + "type": "Boolean", + "label": "Touch is inside", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchIsInside" + }, + { + "value": "", + "type": "Boolean", + "label": "Mouse is inside", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "MouseIsInside" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Index" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [ + { + "areaMaxX": 64, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "defaultName": "Button", + "description": "A button that can be customized.", + "fullName": "Button (panel sprite)", + "name": "PanelSpriteButton", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Create one background instance for of each state.\nOnly the instance for the current state is shown." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Idle", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Hovered", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Pressed", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Hovered" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Pressed" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Hovered", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Place the label over the backgrounds." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Label", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Label", + "=", + "2" + ] + }, + { + "type": { + "value": "TextObject::SetWrapping" + }, + "parameters": [ + "Label", + "yes" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [ + { + "name": "Background", + "objects": [ + { + "name": "Idle" + }, + { + "name": "Hovered" + }, + { + "name": "Pressed" + } + ] + } + ] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Apply states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Show the right background accordingly to the new state." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsIdle" + }, + "parameters": [ + "Object", + "ButtonFSM" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Label", + "=", + "Object.CenterWithPaddingY()" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Idle", + "" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Pressed" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Visible" + }, + "parameters": [ + "Hovered" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::PropertyHoveredFadeOutDuration" + }, + "parameters": [ + "Object", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectOpacityTween" + }, + "parameters": [ + "Hovered", + "Tween", + "\"Fadeout\"", + "0", + "\"linear\"", + "Object.PropertyHoveredFadeOutDuration() * 1000", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::PropertyHoveredFadeOutDuration" + }, + "parameters": [ + "Object", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Hovered" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteObject::Opacity" + }, + "parameters": [ + "Hovered", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Hovered" + ] + }, + { + "type": { + "value": "PanelSpriteObject::SetOpacity" + }, + "parameters": [ + "Hovered", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsHovered" + }, + "parameters": [ + "Object", + "ButtonFSM" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Label", + "=", + "Object.CenterWithPaddingY()" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Idle" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Hovered", + "" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Pressed" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Hovered", + "Tween", + "\"Fadeout\"" + ] + }, + { + "type": { + "value": "PanelSpriteObject::SetOpacity" + }, + "parameters": [ + "Hovered", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsPressed" + }, + "parameters": [ + "Object", + "ButtonFSM" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Label", + "=", + "Object.CenterWithPaddingY() + Object.PropertyPressedLabelOffsetY()" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Idle" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Hovered" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Pressed", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsFocused" + }, + "parameters": [ + "Object", + "ButtonFSM" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Label", + "=", + "Object.CenterWithPaddingY()" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Idle" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Hovered", + "" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Pressed" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Resize", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Children instances must be resized when the button size change:\n- backgrounds for each state are resized to take the full dimensions of the button\n- the label is put back at the center of the button\n\nThe scale is set back to 1 because it means that the parent instance has the same dimensions as the union of its children instances." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Object.Width()", + "!=", + "max(Idle.BoundingBoxRight(), Label.BoundingBoxRight()) - min(Idle.BoundingBoxLeft(), Label.BoundingBoxLeft())" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Object.Height()", + "!=", + "max(Idle.BoundingBoxBottom(), Label.BoundingBoxBottom()) - min(Idle.BoundingBoxTop(), Label.BoundingBoxTop())" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Idle", + "Width", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Idle", + "Height", + "=", + "Object.Height()" + ] + }, + { + "type": { + "value": "PanelSpriteButton::Scale" + }, + "parameters": [ + "Object", + "=", + "1" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Background", + "=", + "Idle.Variable(Width)" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Background", + "=", + "Idle.Variable(Height)" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [ + { + "name": "Background", + "objects": [ + { + "name": "Idle" + }, + { + "name": "Hovered" + }, + { + "name": "Pressed" + } + ] + } + ] + }, + { + "description": "Check if the button is not used.", + "fullName": "Is idle", + "functionType": "Condition", + "name": "IsIdle", + "sentence": "_PARAM0_ is idle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::IsIdle" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button was just clicked.", + "fullName": "Is clicked", + "functionType": "Condition", + "name": "IsClicked", + "sentence": "_PARAM0_ is clicked", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::IsClicked" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the cursor is hovered over the button.", + "fullName": "Is hovered", + "functionType": "Condition", + "name": "IsHovered", + "sentence": "_PARAM0_ is hovered", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::IsHovered" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is either hovered or pressed but not hovered.", + "fullName": "Is focused", + "functionType": "Condition", + "name": "IsFocused", + "sentence": "_PARAM0_ is focused", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::IsFocused" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is currently being pressed with mouse or touch.", + "fullName": "Is pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "_PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::IsPressed" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Change the text of the button label.", + "fullName": "Label text", + "functionType": "Action", + "name": "SetLabelText", + "sentence": "Change the text of _PARAM0_ to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextObject::String" + }, + "parameters": [ + "Label", + "=", + "GetArgumentAsString(\"LabelText\")" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + }, + { + "description": "Text", + "name": "LabelText", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Return the label text.", + "fullName": "Label text", + "functionType": "StringExpression", + "name": "LabelText", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Label.String()" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the label center Y according to the button configuration. This expression is used in doStepPostEvents when the button is pressed or released.", + "fullName": "", + "functionType": "Expression", + "name": "CenterWithPaddingY", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Idle.CenterY() + (Object.PropertyTopPadding() - Object.PropertyBottomPadding()) / 2" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Center the label according to the button configuration. This is used in doStepPostEvents when the button is resized.", + "fullName": "", + "functionType": "Action", + "name": "CenterLabel", + "private": true, + "sentence": "Center the label of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Label", + "=", + "Object.PropertyLeftPadding()", + "=", + "Object.PropertyTopPadding()" + ] + }, + { + "type": { + "value": "TextObject::WrappingWidth" + }, + "parameters": [ + "Label", + "=", + "Idle.Width() - Object.PropertyLeftPadding() - Object.PropertyRightPadding()" + ] + }, + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Label", + "=", + "Object.CenterWithPaddingY()" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCenterX" + }, + "parameters": [ + "Label", + "=", + "Background.CenterX() + (Object.PropertyLeftPadding() - Object.PropertyRightPadding()) / 2" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsPressed" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Label", + "+", + "Object.PropertyPressedLabelOffsetY()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [ + { + "name": "Background", + "objects": [ + { + "name": "Idle" + }, + { + "name": "Hovered" + }, + { + "name": "Pressed" + } + ] + } + ] + }, + { + "description": "De/activate interactions with the button.", + "fullName": "De/activate interactions", + "functionType": "Action", + "name": "Activate", + "sentence": "Activate interactions with _PARAM0_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "no" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + }, + { + "description": "Activate", + "name": "ShouldActivate", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Check if interactions are activated on the button.", + "fullName": "Interactions activated", + "functionType": "Condition", + "name": "IsActivated", + "sentence": "Interactions on _PARAM0_ are activated", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BehaviorActivated" + }, + "parameters": [ + "Idle", + "ButtonFSM" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0", + "type": "Number", + "label": "Label offset on Y axis when pressed", + "description": "", + "group": "", + "extraInformation": [], + "name": "PressedLabelOffsetY" + }, + { + "value": "0", + "type": "Number", + "label": "Left padding", + "description": "", + "group": "Padding", + "extraInformation": [ + "Label" + ], + "name": "LeftPadding" + }, + { + "value": "0", + "type": "Number", + "label": "Right padding", + "description": "", + "group": "Padding", + "extraInformation": [ + "Label" + ], + "name": "RightPadding" + }, + { + "value": "0", + "type": "Number", + "label": "Top padding", + "description": "", + "group": "Padding", + "extraInformation": [ + "Label" + ], + "name": "TopPadding" + }, + { + "value": "0", + "type": "Number", + "label": "Bottom padding", + "description": "", + "group": "Padding", + "extraInformation": [ + "Label" + ], + "name": "BottomPadding" + }, + { + "value": "0.25", + "type": "Number", + "label": "Hovered fade out duration (in seconds)", + "description": "", + "group": "", + "extraInformation": [], + "name": "HoveredFadeOutDuration" + } + ], + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Label", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Text", + "font": "", + "textAlignment": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Text", + "font": "", + "textAlignment": "", + "characterSize": 20, + "color": "0;0;0" + } + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Idle", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [ + { + "folded": true, + "name": "State", + "type": "string", + "value": "Idle" + } + ], + "effects": [], + "behaviors": [ + { + "name": "ButtonFSM", + "type": "PanelSpriteButton::ButtonFSM", + "ShouldCheckHovering": true + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Hovered", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Pressed", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Label" + }, + { + "objectName": "Idle" + }, + { + "objectName": "Hovered" + }, + { + "objectName": "Pressed" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [] + } + ] + }, + { + "author": "@4ian", + "category": "Game mechanic", + "extensionNamespace": "", + "fullName": "Health points and damage", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWhlYXJ0LWhhbGYtZnVsbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNi41LDVDMTUsNSAxMy41OCw1LjkxIDEzLDcuMlYxNy43NEMxNy4yNSwxMy44NyAyMCwxMS4yIDIwLDguNUMyMCw2LjUgMTguNSw1IDE2LjUsNU0xNi41LDNDMTkuNTgsMyAyMiw1LjQxIDIyLDguNUMyMiwxMi4yNyAxOC42LDE1LjM2IDEzLjQ1LDIwLjAzTDEyLDIxLjM1TDEwLjU1LDIwLjAzQzUuNCwxNS4zNiAyLDEyLjI3IDIsOC41QzIsNS40MSA0LjQyLDMgNy41LDNDOS4yNCwzIDEwLjkxLDMuODEgMTIsNS4wOEMxMy4wOSwzLjgxIDE0Ljc2LDMgMTYuNSwzWiIgLz48L3N2Zz4=", + "name": "Health", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/heart-half-full.svg", + "shortDescription": "Manage health (life) points, shield and armor.", + "version": "0.3.1", + "description": [ + "Manage health (life) points, shield and armor. ", + "", + "It handles:", + "- Damage cooldown", + "- Health and shield regeneration", + "- Over healing", + "", + "It can be used on:", + "- Players", + "- Enemies", + "- NPCs", + "- Inanimate objects (for insance breakable doors or mining rocks)", + "", + "The top-down RPG example uses this extension ([open the project online](https://editor.gdevelop.io/?project=example://top-down-rpg))." + ], + "origin": { + "identifier": "Health", + "name": "gdevelop-extension-store" + }, + "tags": [ + "health", + "life", + "damage", + "hit", + "heal", + "shield", + "regeneration", + "armor" + ], + "authorIds": [ + "wWP8BSlAW0UP4NeaHa2LcmmDzmH2", + "xpwUwByyImTDcHEqDUqfyg0oRBt1", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Manage health (life) points, shield and armor.", + "fullName": "Health", + "name": "Health", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"__Health.TimeSinceLastHit\"" + ] + }, + { + "type": { + "value": "Health::Health::SetCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyHealth()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 224, + "colorG": 16, + "colorR": 189, + "creationTime": 0, + "name": "Health", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Regeneration", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Health" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyHealthRegenRate" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + }, + { + "type": { + "value": "Health::Health::PropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "Object.Behavior::MaxHealth()" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"__Health.TimeSinceLastHit\"", + ">", + "Object.Behavior::PropertyHealthRegenDelay()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Object.Behavior::PropertyHealthRegenRate() * TimeDelta()" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Correct any values above maximum limits" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "Object.Behavior::MaxHealth()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyMaxHealth()" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Reset triggers", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyIsHealthJustDamaged" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "Health::Health::SetPropertyIsJustHealed" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "Health::Health::SetPropertyIsJustDodged" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [] + }, + { + "colorB": 224, + "colorG": 16, + "colorR": 189, + "creationTime": 0, + "name": "Shield", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Regeneration", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Shield" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyShieldRegenRate" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + }, + { + "type": { + "value": "Health::Health::PropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "Object.Behavior::PropertyMaxShieldPoints()" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"__Health.TimeSinceLastHit\"", + ">", + "Object.Behavior::PropertyShieldRegenDelay()" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::RenewShieldDuration" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Object.Behavior::PropertyShieldRegenRate() * TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Correct any values above maximum limits" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "Object.Behavior::PropertyMaxShieldPoints()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyMaxShieldPoints()" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Remove shield points if shield expired", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Health::Health::IsShieldActive" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Reset damage trigger", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyIsShieldJustDamaged" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Apply damage to the object. Shield and armor can reduce this damage if enabled.", + "fullName": "Apply damage to an object", + "functionType": "Action", + "group": "Health", + "name": "Hit", + "sentence": "Apply _PARAM2_ points of damage to _PARAM0_ (Damage can be reduced by Shield: _PARAM3_, Armor: _PARAM4_)", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Incoming damage", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Only consider incoming damage when damage cooldown is not active" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Health::Health::IsDamageCooldownActive" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyDamageToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"DamageValue\")" + ] + } + ], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Chance to dodge", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "No damage will be applied when dodged" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "RandomFloatInRange(0,1)", + "<", + "Object.Behavior::PropertyChanceToDodge()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyIsJustDodged" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + }, + { + "type": { + "value": "Health::Health::SetPropertyDamageToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Damage reduction from Armor", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"UseArmor\"" + ] + }, + { + "type": { + "value": "Health::Health::PropertyDamageToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Flat damage reduction", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyDamageToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0,Object.Behavior::PropertyDamageToBeApplied() - Object.Behavior::PropertyFlatDamageReduction())" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Percent damage reduction", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyPercentDamageReduction" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "Health::Health::PropertyDamageToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyDamageToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + "*", + "1 - min(1, Object.Behavior::PropertyPercentDamageReduction())" + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Apply damage to shield", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If shield is active, damage the shield first" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"UseShield\"" + ] + }, + { + "type": { + "value": "Health::Health::IsShieldActive" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "Health::Health::PropertyDamageToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyIsShieldJustDamaged" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + }, + { + "type": { + "value": "Health::Health::TriggerDamageCooldown" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If damage is less than shield, subtract damage from shield." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyDamageToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + "<=", + "Object.Behavior::PropertyCurrentShieldPoints()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "-", + "Object.Behavior::PropertyDamageToBeApplied()" + ] + }, + { + "type": { + "value": "Health::Health::SetPropertyShieldDamageTaken" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyDamageToBeApplied()" + ] + }, + { + "type": { + "value": "Health::Health::SetPropertyDamageToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If damage is greater than shield, conditionally apply excess damage based on property" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyDamageToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "Object.Behavior::PropertyCurrentShieldPoints()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyShieldDamageTaken" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyCurrentShieldPoints()" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyBlockExcessDamage" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyDamageToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "Health::Health::SetPropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Apply excess damage only if shield does not block excess damage" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Health::Health::PropertyBlockExcessDamage" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyDamageToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + "-", + "Object.Behavior::PropertyCurrentShieldPoints()" + ] + }, + { + "type": { + "value": "Health::Health::SetPropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Apply damage to health", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyDamageToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetJustDamaged" + }, + "parameters": [ + "Object", + "Behavior", + "yes", + "" + ] + }, + { + "type": { + "value": "Health::Health::TriggerDamageCooldown" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyCurrentHealth() - Object.Behavior::PropertyDamageToBeApplied()", + "" + ] + } + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Points of damage", + "name": "DamageValue", + "type": "expression" + }, + { + "defaultValue": "yes", + "description": "Shield can reduce damage taken", + "name": "UseShield", + "optional": true, + "type": "yesorno" + }, + { + "defaultValue": "yes", + "description": "Armor can reduce damage taken", + "name": "UseArmor", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "current health points of the object.", + "fullName": "Health points", + "functionType": "ExpressionAndCondition", + "group": "Health", + "name": "Health", + "sentence": "health points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyCurrentHealth()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the health points of the object. Will not trigger damage cooldown.", + "fullName": "Change health points", + "functionType": "Action", + "group": "Health", + "name": "SetHealth", + "sentence": "Change the health of _PARAM0_ to _PARAM2_ points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If MaxHealth is set, prevent health from going above it" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyMaxHealth" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(Object.Behavior::PropertyCurrentHealth(), Object.Behavior::PropertyMaxHealth())" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "New health value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the health points of the object. Will not trigger damage cooldown.", + "fullName": "Change health points (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetCurrentHealth", + "private": true, + "sentence": "Change the health of _PARAM0_ to _PARAM2_ points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetHealth" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "New health value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Heal the object by increasing its health points.", + "fullName": "Heal object", + "functionType": "Action", + "group": "Health", + "name": "Heal", + "sentence": "Heal _PARAM0_ with _PARAM2_ health points", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Heal", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If Max Health is not set, do not enforce Max Health" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyMaxHealth" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyHealToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"HealValue\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If Max Health is set and Overhealing is not allowed" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyMaxHealth" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "inverted": true, + "value": "Health::Health::PropertyAllowOverHealing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyHealToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(GetArgumentAsNumber(\"HealValue\"),Object.Behavior::PropertyMaxHealth() - Object.Behavior::PropertyCurrentHealth())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Perform heal" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Object.Behavior::PropertyHealToBeApplied()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Update healing trigger" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyIsJustHealed" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Points to heal (will be added to object health)", + "name": "HealValue", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum health points of the object.", + "fullName": "Maximum health points", + "functionType": "ExpressionAndCondition", + "group": "Health configuration", + "name": "MaxHealth", + "sentence": "the maximum health points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyMaxHealth()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MaxHealth", + "name": "SetMaxHealthOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyMaxHealth" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make sure Current Health does not exceed new Max Health" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "Object.Behavior::MaxHealth()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::MaxHealth()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Maximum health", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the object maximum health points.", + "fullName": "Maximum health points (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetMaxHealth", + "private": true, + "sentence": "Change the maximum health of _PARAM0_ to _PARAM2_ points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetMaxHealthOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Maximum health", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the rate of health regeneration (points per second).", + "fullName": "Rate of health regeneration", + "functionType": "ExpressionAndCondition", + "group": "Health configuration", + "name": "HealthRegenRate", + "sentence": "the rate of health regeneration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyHealthRegenRate()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HealthRegenRate", + "name": "SetHealthRegenRateOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyHealthRegenRate" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Rate of regen", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the rate of health regeneration.", + "fullName": "Rate of health regeneration (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetHealthRegenRate", + "private": true, + "sentence": "Change the rate of health regen of _PARAM0_ to _PARAM2_ points per second", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetHealthRegenRateOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Rate of regen", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the duration of damage cooldown (seconds).", + "fullName": "Damage cooldown", + "functionType": "ExpressionAndCondition", + "group": "Health configuration", + "name": "DamageCooldownDuration", + "sentence": "the duration of damage cooldown", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyDamageCooldown()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DamageCooldownDuration", + "name": "SetCooldownDurationOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyDamageCooldown" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Duration of damage cooldown (seconds)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the duration of damage cooldown (seconds).", + "fullName": "Damage cooldown (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetCooldownDuration", + "private": true, + "sentence": "Change the duration of damage cooldown on _PARAM0_ to _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetCooldownDurationOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Duration of damage cooldown (seconds)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the delay before health regeneration starts after last being hit (seconds).", + "fullName": "Health regeneration delay", + "functionType": "ExpressionAndCondition", + "group": "Health configuration", + "name": "HealthRegenDelay", + "sentence": "the health regeneration delay", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyHealthRegenDelay()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HealthRegenDelay", + "name": "SetHealthRegenDelayOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyHealthRegenDelay" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Delay (seconds)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the delay before health regeneration starts after being hit.", + "fullName": "Health regeneration delay (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetHealthRegenDelay", + "private": true, + "sentence": "Change the health regeneration delay on _PARAM0_ to _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetHealthRegenDelayOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Delay (seconds)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the chance to dodge incoming damage (range: 0 to 1).", + "fullName": "Dodge chance", + "functionType": "ExpressionAndCondition", + "group": "Health configuration", + "name": "ChanceToDodge", + "sentence": "the chance to dodge incoming damage", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyChanceToDodge()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ChanceToDodge", + "name": "SetChanceToDodgeOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyChanceToDodge" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Chance to dodge (Range: 0 to 1)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the chance to dodge incoming damage.", + "fullName": "Chance to dodge incoming damage (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetChanceToDodge", + "private": true, + "sentence": "Change the chance to dodge on _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetChanceToDodgeOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Chance to dodge (Range: 0 to 1)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the flat damage reduction from the armor. Incoming damage is reduced by this value.", + "fullName": "Armor flat damage reduction", + "functionType": "ExpressionAndCondition", + "group": "Health configuration", + "name": "FlatDamageReduction", + "sentence": "the armor flat damage reduction", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyFlatDamageReduction()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FlatDamageReduction", + "name": "SetFlatDamageReductionOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyFlatDamageReduction" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Flat reduction from armor", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the flat damage reduction from armor. Incoming damage is reduced by this value.", + "fullName": "Flat damage reduction from armor (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetFlatDamageReduction", + "private": true, + "sentence": "Change the flat damage reduction from armor on _PARAM0_ to _PARAM2_ points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetFlatDamageReductionOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Flat reduction from armor", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the percent damage reduction from armor (range: 0 to 1).", + "fullName": "Armor percent damage reduction", + "functionType": "ExpressionAndCondition", + "group": "Health configuration", + "name": "PercentDamageReduction", + "sentence": "the armor percent damage reduction", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyPercentDamageReduction()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "PercentDamageReduction", + "name": "SetPercentDamageReductionOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyPercentDamageReduction" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Percent damage reduction from armor", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the percent damage reduction from armor. Range: 0 to 1.", + "fullName": "Percent damage reduction from armor (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetPercentDamageReduction", + "private": true, + "sentence": "Change the percent damage reduction from armor on _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPercentDamageReductionOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Percent damage reduction from armor", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Allow heals to increase health above max health. Regeneration will not exceed max health.", + "fullName": "Allow over-healing", + "functionType": "Action", + "group": "Health configuration", + "name": "AllowOverHealing", + "sentence": "Allow over-healing on _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyAllowOverHealing" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyAllowOverHealing" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Allow over-healing", + "name": "Value", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Mark object as hit at least once.", + "fullName": "Mark object as hit at least once", + "functionType": "Action", + "group": "Health configuration", + "name": "SetHitAtLeastOnce", + "private": true, + "sentence": "Mark _PARAM0_ as hit at least once: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyHitAtLeastOnce" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyHitAtLeastOnce" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Hit at least once", + "name": "Value", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Mark object as just damaged.", + "fullName": "Mark object as just damaged", + "functionType": "Action", + "group": "Health configuration", + "name": "SetJustDamaged", + "private": true, + "sentence": "Mark _PARAM0_ as just damaged: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyIsHealthJustDamaged" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyIsHealthJustDamaged" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Just damaged", + "name": "Value", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Trigger damage cooldown.", + "fullName": "Trigger damage cooldown", + "functionType": "Action", + "group": "Health", + "name": "TriggerDamageCooldown", + "sentence": "Trigger the damage cooldown on _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Mark that the object was hit at least once (used for initial state of damage cooldown)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Health::Health::HitAtLeastOnce" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetHitAtLeastOnce" + }, + "parameters": [ + "Object", + "Behavior", + "yes", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"__Health.TimeSinceLastHit\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object has been hit at least once.", + "fullName": "Object has been hit at least once", + "functionType": "Condition", + "group": "Health", + "name": "HitAtLeastOnce", + "private": true, + "sentence": "_PARAM0_ has been hit at least once", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "This condition is used to prevent \"damage cooldown\" from being active when the game starts." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyHitAtLeastOnce" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if health was just damaged previously in the events.", + "fullName": "Is health just damaged", + "functionType": "Condition", + "group": "Health", + "name": "IsJustDamaged", + "sentence": "Health has just been damaged on _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyIsHealthJustDamaged" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object was just healed previously in the events.", + "fullName": "Is just healed", + "functionType": "Condition", + "group": "Health", + "name": "IsJustHealed", + "sentence": "_PARAM0_ has just been healed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyIsJustHealed" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if damage cooldown is active. Object and shield cannot be damaged while this is active.", + "fullName": "Is damage cooldown active", + "functionType": "Condition", + "group": "Health", + "name": "IsDamageCooldownActive", + "sentence": "Damage cooldown on _PARAM0_ is active", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyHitAtLeastOnce" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "Health::Health::PropertyDamageCooldown" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"__Health.TimeSinceLastHit\"", + "<", + "Object.Behavior::PropertyDamageCooldown()" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the time before damage cooldown ends (seconds).", + "fullName": "Time remaining in damage cooldown", + "functionType": "ExpressionAndCondition", + "group": "Health", + "name": "DamageCooldownRemaining", + "sentence": "the time before damage cooldown end", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::IsDamageCooldownActive" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "max(0,Object.Behavior::PropertyDamageCooldown() - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is considered dead (no health points).", + "fullName": "Is dead", + "functionType": "Condition", + "group": "Health", + "name": "IsDead", + "sentence": "_PARAM0_ is dead", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the time since last taken hit (seconds).", + "fullName": "Time since last hit", + "functionType": "ExpressionAndCondition", + "group": "Health", + "name": "TimeSinceLastHit", + "sentence": "the time since last taken hit on health", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\")" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the health damage taken from most recent hit.", + "fullName": "Health damage taken from most recent hit", + "functionType": "ExpressionAndCondition", + "group": "Health", + "name": "PreviousDamageTaken", + "sentence": "the health damage taken from most recent hit", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyDamageToBeApplied()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum shield points of the object.", + "fullName": "Maximum shield points", + "functionType": "ExpressionAndCondition", + "group": "Shield configuration", + "name": "MaxShield", + "sentence": "the maximum shield points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyMaxShieldPoints()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MaxShield", + "name": "SetMaxShieldOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyMaxShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Maximum shield", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the maximum shield points of the object.", + "fullName": "Maximum shield points (deprecated)", + "functionType": "Action", + "group": "Shield configuration", + "name": "SetMaxShield", + "private": true, + "sentence": "Change the maximum shield of _PARAM0_ to _PARAM2_ points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetMaxShieldOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Maximum shield", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change maximum shield points.", + "fullName": "Max shield points (deprecated)", + "functionType": "Action", + "group": "Shield configuration", + "name": "SetMaxShieldPoints", + "private": true, + "sentence": "Change the maximum shield points on _PARAM0_ to _PARAM2_ points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetMaxShieldOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Shield points", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the current shield points of the object.", + "fullName": "Shield points", + "functionType": "ExpressionAndCondition", + "group": "Shield", + "name": "ShieldPoints", + "sentence": "the shield points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyCurrentShieldPoints()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ShieldPoints", + "name": "SetShieldPointsOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Shield points", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change current shield points. Will not trigger damage cooldown.", + "fullName": "Shield points (deprecated)", + "functionType": "Action", + "group": "Shield configuration", + "name": "SetShieldPoints", + "private": true, + "sentence": "Change current shield points on _PARAM0_ to _PARAM2_ points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetShieldPointsOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Shield points", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the rate of shield regeneration (points per second).", + "fullName": "Rate of shield regeneration", + "functionType": "ExpressionAndCondition", + "group": "Shield configuration", + "name": "ShieldRegenRate", + "sentence": "the rate of shield regeneration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyShieldRegenRate()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ShieldRegenRate", + "name": "SetShieldRegenRateOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyShieldRegenRate" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Regeneration rate (points per second)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change rate of shield regeneration.", + "fullName": "Shield regeneration rate (deprecated)", + "functionType": "Action", + "group": "Shield configuration", + "name": "SetShieldRegenRate", + "private": true, + "sentence": "Change the shield regeneration rate of _PARAM0_ to _PARAM2_ points per second", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetShieldRegenRateOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Regeneration rate (points per second)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the delay before shield regeneration starts after being hit (seconds).", + "fullName": "Shield regeneration delay", + "functionType": "ExpressionAndCondition", + "group": "Shield configuration", + "name": "ShieldRegenDelay", + "sentence": "the shield regeneration delay", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyShieldRegenDelay()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ShieldRegenDelay", + "name": "SetShieldRegenDelayOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyShieldRegenDelay" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Regeneration delay (seconds)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change delay before shield regeneration starts after being hit.", + "fullName": "Shield regeneration delay (deprecated)", + "functionType": "Action", + "group": "Shield configuration", + "name": "SetShieldRegenDelay", + "private": true, + "sentence": "Change the shield regeneration delay on _PARAM0_ to _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetShieldRegenDelayOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Regeneration delay (seconds)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the duration of the shield (seconds). A value of \"0\" means the shield is permanent.", + "fullName": "Duration of shield", + "functionType": "ExpressionAndCondition", + "group": "Shield configuration", + "name": "ShieldDuration", + "sentence": "the duration of the shield", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyShieldDuration()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ShieldDuration", + "name": "SetShieldDurationOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyShieldDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Shield duration (seconds)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change duration of shield. Use \"0\" to make shield permanent.", + "fullName": "Duration of shield (deprecated)", + "functionType": "Action", + "group": "Shield configuration", + "name": "SetShieldDuration", + "private": true, + "sentence": "Change the duration of shield on _PARAM0_ to _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetShieldDurationOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Shield duration (seconds)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Renew shield duration to it's full value.", + "fullName": "Renew shield duration", + "functionType": "Action", + "group": "Shield", + "name": "RenewShieldDuration", + "sentence": "Renew the shield duration on _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"__Health.ShieldDuration\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Activate the shield by setting the shield points and renewing the shield duration (optional).", + "fullName": "Activate shield", + "functionType": "Action", + "group": "Shield", + "name": "ActivateShield", + "sentence": "Activate the shield on _PARAM0_ with _PARAM2_ points (Renew shield duration: _PARAM3_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"ShieldPoints\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyMaxShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(GetArgumentAsNumber(\"ShieldPoints\"),Object.Behavior::MaxShield())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"RenewShieldDuration\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::RenewShieldDuration" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Shield points", + "name": "ShieldPoints", + "type": "expression" + }, + { + "defaultValue": "yes", + "description": "Renew shield duration", + "name": "RenewShieldDuration", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Enable (or disable) blocking excess damage when shield breaks.", + "fullName": "Block excess damage when shield breaks", + "functionType": "Action", + "group": "Shield configuration", + "name": "SetShieldBlockExcessDamage", + "sentence": "Shield on _PARAM0_ blocks excess damage when it breaks: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyBlockExcessDamage" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyBlockExcessDamage" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Block excess damage", + "name": "Value", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the shield was just damaged previously in the events.", + "fullName": "Is shield just damaged", + "functionType": "Condition", + "group": "Shield", + "name": "IsShieldJustDamaged", + "sentence": "Shield on _PARAM0_ has just been damaged", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyIsShieldJustDamaged" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if incoming damage was just dodged.", + "fullName": "Damage was just dodged", + "functionType": "Condition", + "group": "Health", + "name": "IsJustDodged", + "sentence": "_PARAM0_ just dodged incoming damage", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyIsJustDodged" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the shield is active (based on shield points and duration).", + "fullName": "Is shield active", + "functionType": "Condition", + "group": "Shield", + "name": "IsShieldActive", + "sentence": "Shield on _PARAM0_ is active", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "To be considered \"active\", a shield must have positive points AND not exceed duration" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Don't check the timer when duration is zero (or negative)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyShieldDuration" + }, + "parameters": [ + "Object", + "Behavior", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyShieldDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"__Health.ShieldDuration\"", + "<", + "Object.Behavior::PropertyShieldDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the time before the shield duration ends (seconds).", + "fullName": "Time before shield duration ends", + "functionType": "ExpressionAndCondition", + "group": "Shield", + "name": "ShieldTimeRemaining", + "sentence": "the time before the shield duration end", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyShieldDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "max(0,Object.Behavior::PropertyShieldDuration() - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the shield damage taken from most recent hit.", + "fullName": "Shield damage taken from most recent hit", + "functionType": "ExpressionAndCondition", + "group": "Shield", + "name": "PreviousDamageToShield", + "sentence": "the shield damage taken from most recent hit", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyShieldDamageTaken()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the health points gained from previous heal.", + "fullName": "Health points gained from previous heal", + "functionType": "ExpressionAndCondition", + "group": "Health", + "name": "PreviousHealAmount", + "sentence": "the health points gained from previous heal", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyHealToBeApplied()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "100", + "type": "Number", + "label": "Starting health", + "description": "", + "group": "Health", + "extraInformation": [], + "name": "Health" + }, + { + "value": "0", + "type": "Number", + "label": "Current health (life) points", + "description": "", + "group": "Health", + "extraInformation": [], + "hidden": true, + "name": "CurrentHealth" + }, + { + "value": "100", + "type": "Number", + "label": "Maximum health", + "description": "Use 0 for no maximum.", + "group": "Health", + "extraInformation": [], + "name": "MaxHealth" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Damage cooldown", + "description": "", + "group": "Health", + "extraInformation": [], + "name": "DamageCooldown" + }, + { + "value": "", + "type": "Boolean", + "label": "Allow heals to increase health above max health (regen will never exceed max health)", + "description": "", + "group": "Health", + "extraInformation": [], + "advanced": true, + "name": "AllowOverHealing" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "Health", + "extraInformation": [], + "hidden": true, + "name": "IsHealthJustDamaged" + }, + { + "value": "0", + "type": "Number", + "label": "Damage to health from the previous incoming damage", + "description": "", + "group": "Health", + "extraInformation": [], + "hidden": true, + "name": "DamageToBeApplied" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "Health", + "extraInformation": [], + "hidden": true, + "name": "HitAtLeastOnce" + }, + { + "value": "0", + "type": "Number", + "label": "Chance to dodge incoming damage (between 0 and 1)", + "description": "When a damage is dodged, no damage is applied.", + "group": "Health", + "extraInformation": [], + "advanced": true, + "name": "ChanceToDodge" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "Health", + "extraInformation": [], + "hidden": true, + "name": "IsJustDodged" + }, + { + "value": "0", + "type": "Number", + "label": "Health points gained from the previous heal", + "description": "", + "group": "Health", + "extraInformation": [], + "hidden": true, + "name": "HealToBeApplied" + }, + { + "value": "0", + "type": "Number", + "label": "Rate of health regeneration (points per second)", + "description": "", + "group": "Health regeneration", + "extraInformation": [], + "advanced": true, + "name": "HealthRegenRate" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Health regeneration delay ", + "description": "Delay before health regeneration starts after a hit.", + "group": "Health regeneration", + "extraInformation": [], + "advanced": true, + "name": "HealthRegenDelay" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsJustHealed" + }, + { + "value": "", + "type": "Number", + "label": "Current shield points", + "description": "", + "group": "Shield", + "extraInformation": [], + "hidden": true, + "name": "CurrentShieldPoints" + }, + { + "value": "0", + "type": "Number", + "label": "Maximum shield", + "description": "Leave 0 for unlimited.", + "group": "Shield", + "extraInformation": [], + "advanced": true, + "name": "MaxShieldPoints" + }, + { + "value": "5", + "type": "Number", + "unit": "Second", + "label": "Duration of shield", + "description": "Use 0 to make the shield permanent.", + "group": "Shield", + "extraInformation": [], + "advanced": true, + "name": "ShieldDuration" + }, + { + "value": "0", + "type": "Number", + "label": "Rate of shield regeneration (points per second)", + "description": "", + "group": "Shield regeneration", + "extraInformation": [], + "advanced": true, + "name": "ShieldRegenRate" + }, + { + "value": "", + "type": "Boolean", + "label": "Block excess damage when shield is broken", + "description": "", + "group": "Shield", + "extraInformation": [], + "advanced": true, + "name": "BlockExcessDamage" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Shield regeneration delay", + "description": "Delay before shield regeneration starts after a hit.", + "group": "Shield regeneration", + "extraInformation": [], + "advanced": true, + "name": "ShieldRegenDelay" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "Shield", + "extraInformation": [], + "hidden": true, + "name": "IsShieldJustDamaged" + }, + { + "value": "", + "type": "Number", + "label": "Damage to shield from the previous incoming damage", + "description": "", + "group": "Shield", + "extraInformation": [], + "hidden": true, + "name": "ShieldDamageTaken" + }, + { + "value": "0", + "type": "Number", + "label": "Flat damage reduction from armor", + "description": "Incoming damages are reduced by this value.", + "group": "Armor", + "extraInformation": [], + "advanced": true, + "name": "FlatDamageReduction" + }, + { + "value": "0", + "type": "Number", + "label": "Percentage damage reduction from armor (between 0 and 1)", + "description": "", + "group": "Armor", + "extraInformation": [], + "advanced": true, + "name": "PercentDamageReduction" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "User interface", + "extensionNamespace": "", + "fullName": "Resource bar (continuous)", + "helpPath": "/objects/resource-bar", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8cGF0aCBkPSJNMjgsMTJIMTRINGMtMi4yLDAtNCwxLjgtNCw0czEuOCw0LDQsNGgxMGgxNGMyLjIsMCw0LTEuOCw0LTRTMzAuMiwxMiwyOCwxMnogTTQsMThjLTEuMSwwLTItMC45LTItMnMwLjktMiwyLTJoMTANCgljMS4xLDAsMiwwLjksMiwycy0wLjksMi0yLDJINHoiLz4NCjwvc3ZnPg0K", + "name": "PanelSpriteContinuousBar", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Interface Elements/ea06363a57846caab544f536b78a952234b68d4941d41c1577852a1d61aefec3_Interface Elements_interface_ui_loading_progress_bar.svg", + "shortDescription": "A bar that represents a resource in the game (health, mana, ammo, etc).", + "version": "1.1.1", + "description": [ + "A bar that represents a resource in the game (health, mana, ammo, etc).", + "", + "There are ready-to-use resource bars in the asset-store [resource bars pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=resource-bars-resource-bars)." + ], + "origin": { + "identifier": "PanelSpriteContinuousBar", + "name": "gdevelop-extension-store" + }, + "tags": [ + "resource", + "bar", + "health", + "mana", + "shield", + "hearts", + "lives", + "ammo" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1", + "q8ubdigLvIRXLxsJDDTaokO41mc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", + "fullName": "Resource bar", + "name": "ResourceBar", + "objectType": "", + "private": true, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "This is done after the events to allow users to read the previous value at the end of the change." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"__ResourceBar.LastValueChange\"", + "<=", + "Object.Behavior::PropertyPreviousHighValueDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::UpdatePreviousHighValue" + }, + "parameters": [ + "Object", + "Behavior", + "=" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the value of the object.", + "fullName": "Value", + "functionType": "ExpressionAndCondition", + "name": "Value", + "sentence": "the value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyValue()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Value", + "name": "SetValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::SetPropertyValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(GetArgumentAsNumber(\"Value\"), 0, Object.Behavior::MaxValue())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::PropertyValue" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "Object.Behavior::PreviousHighValue()" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"__ResourceBar.LastValueChange\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::PropertyValue" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "Object.Behavior::PropertyPreviousHighValue()" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::UpdatePreviousHighValue" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum value of the object.", + "fullName": "Maximum value", + "functionType": "ExpressionAndCondition", + "group": "Resource bar configuration", + "name": "MaxValue", + "sentence": "the maximum value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyMaxValue()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MaxValue", + "name": "SetMaxValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::SetPropertyMaxValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the bar is empty.", + "fullName": "Empty", + "functionType": "Condition", + "name": "IsEmpty", + "sentence": "_PARAM0_ bar is empty", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::PropertyValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the bar is full.", + "fullName": "Full", + "functionType": "Condition", + "name": "IsFull", + "sentence": "_PARAM0_ bar is full", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::PropertyValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyMaxValue()" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the previous high value of the resource bar before the current change.", + "fullName": "Previous high value", + "functionType": "ExpressionAndCondition", + "name": "PreviousHighValue", + "sentence": "the previous high value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyPreviousHighValue()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Force the previous resource value to update to the current one.", + "fullName": "Update previous value", + "functionType": "Action", + "name": "UpdatePreviousHighValue", + "sentence": "Update the previous resource value of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::SetPropertyPreviousHighValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyValue()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the previous high value conservation duration (in seconds) of the object.", + "fullName": "Previous high value conservation duration", + "functionType": "ExpressionAndCondition", + "group": "FillBar bar configuration", + "name": "PreviousHighValueDuration", + "sentence": "the previous high value conservation duration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyPreviousHighValueDuration()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "PreviousHighValueDuration", + "name": "SetPreviousHighValueDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::SetPropertyPreviousHighValueDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the resource value is changing.", + "fullName": "Value is changing", + "functionType": "Condition", + "name": "IsChanging", + "sentence": "_PARAM0_ value is changing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::PreviousHighValue" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "Object.Behavior::PropertyValue()", + "" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"__ResourceBar.LastValueChange\"", + "<=", + "Object.Behavior::PropertyPreviousHighValueDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Value", + "description": "", + "group": "", + "extraInformation": [], + "name": "Value" + }, + { + "value": "3", + "type": "Number", + "label": "Maximum value", + "description": "", + "group": "", + "extraInformation": [], + "name": "MaxValue" + }, + { + "value": "", + "type": "Number", + "label": "Previous high value", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "PreviousHighValue" + }, + { + "value": "1", + "type": "Number", + "label": "Previous high value conservation duration (in seconds)", + "description": "", + "group": "", + "extraInformation": [], + "name": "PreviousHighValueDuration" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [ + { + "areaMaxX": 64, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "defaultName": "ResourceBar", + "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", + "fullName": "Resource bar (continuous)", + "name": "PanelSpriteContinuousBar", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "This allows to detect a change of \"intial value\" on hot reload." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPropertyPreviousInitialValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyInitialValue()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Create the child-object instances." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Background", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "FillBar", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Background", + "=", + "1" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "FillBar", + "=", + "3" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyPreviousHighValueDuration" + }, + "parameters": [ + "Object", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Buffer", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Buffer", + "=", + "2" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Create the label over the bar." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Label", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Label", + "=", + "4" + ] + }, + { + "type": { + "value": "TextObject::SetTextAlignment" + }, + "parameters": [ + "Label", + "\"center\"" + ] + }, + { + "type": { + "value": "TextObject::SetWrapping" + }, + "parameters": [ + "Label", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyShowLabel" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Label" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Pass the configuration to the behavior." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetMaxValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyMaxValue()", + "Object.PropertyMaxValue()" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyInitialValue()", + "Object.PropertyInitialValue()" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPreviousValueDuration" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyPreviousHighValueDuration()", + "" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "FillBar", + "Tween", + "\"ChangeValue\"" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "FillBar", + "=", + "Object.WidthForValue()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetMaxValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyMaxValue()", + "Object.PropertyMaxValue()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyInitialValue" + }, + "parameters": [ + "Object", + "!=", + "Object.PropertyPreviousInitialValue()" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPropertyPreviousInitialValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyInitialValue()" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyInitialValue()", + "Object.PropertyInitialValue()" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPreviousValueDuration" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyPreviousHighValueDuration()", + "" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "FillBar", + "Tween", + "\"ChangeValue\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "FillBar", + "=", + "Object.WidthForValue()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Resize", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Children instances must be resized when the parent size change:\n- background is resized to take the full dimensions of the parent\n- the bar size is refreshed according to the value\n- the label is put back at the center of the bar\n\nThe scale is set back to 1 because it means that the parent instance has the same dimensions as the union of its children instances." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Object.Width()", + "!=", + "max(Background.BoundingBoxRight(), Label.BoundingBoxRight()) - min(Background.BoundingBoxLeft(), Label.BoundingBoxLeft())" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Object.Height()", + "!=", + "max(Background.BoundingBoxBottom(), Label.BoundingBoxBottom()) - min(Background.BoundingBoxTop(), Label.BoundingBoxTop())" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Background", + "Width", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Background", + "Height", + "=", + "Object.Height()" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::Scale" + }, + "parameters": [ + "Object", + "=", + "1" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Background", + "=", + "Background.Variable(Width)" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Background", + "=", + "Background.Variable(Height)" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::IsChanging" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectWidthTween" + }, + "parameters": [ + "Buffer", + "Tween", + "\"ChangeValue\"", + "Object.WidthForValue()", + "\"linear\"", + "Object.PropertyEasingDuration() * 1000", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "FillBar", + "<", + "Buffer.Width()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Buffer", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "FillBar", + ">=", + "Buffer.Width()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Buffer" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Center the bar according to the button configuration. This is used in doStepPostEvents when the button is resized.", + "fullName": "Update layout", + "functionType": "Action", + "name": "UpdateLayout", + "private": true, + "sentence": "Update layout of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "FillBar", + "=", + "Object.PropertyBarLeftPadding()", + "=", + "Object.PropertyBarTopPadding()" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "FillBar", + "=", + "Object.WidthForValue()" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "FillBar", + "=", + "round(Background.Height() - Object.PropertyBarTopPadding() - Object.PropertyBarBottomPadding())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Buffer", + "=", + "FillBar.X()", + "=", + "FillBar.Y()" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Buffer", + "=", + "FillBar.Width()" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Buffer", + "=", + "FillBar.Height()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Label", + "=", + "Object.PropertyBarLeftPadding()", + "=", + "Object.PropertyBarTopPadding()" + ] + }, + { + "type": { + "value": "TextObject::WrappingWidth" + }, + "parameters": [ + "Label", + "=", + "Object.FullBarWidth()" + ] + }, + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Label", + "=", + "FillBar.CenterY()" + ] + }, + { + "type": { + "value": "SetCenterX" + }, + "parameters": [ + "Label", + "=", + "Background.CenterX() + (Object.PropertyBarLeftPadding() - Object.PropertyBarRightPadding()) / 2" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the value of the object.", + "fullName": "Value", + "functionType": "ExpressionAndCondition", + "group": "Resource bar", + "name": "Value", + "sentence": "the value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FillBar.ResourceBar::Value()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Value", + "name": "SetValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::SetValue" + }, + "parameters": [ + "FillBar", + "ResourceBar", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyEasingDuration" + }, + "parameters": [ + "Object", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectWidthTween" + }, + "parameters": [ + "FillBar", + "Tween", + "\"ChangeValue\"", + "Object.WidthForValue()", + "\"linear\"", + "Object.PropertyEasingDuration() * 1000", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyEasingDuration" + }, + "parameters": [ + "Object", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "FillBar", + "=", + "Object.WidthForValue()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLabel" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::IsChanging" + }, + "parameters": [ + "FillBar", + "ResourceBar", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Buffer", + "=", + "round(Object.FullBarWidth() * FillBar.ResourceBar::PreviousHighValue() / FillBar.ResourceBar::MaxValue())" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum value of the object.", + "fullName": "Maximum value", + "functionType": "ExpressionAndCondition", + "group": "Resource bar configuration", + "name": "MaxValue", + "sentence": "the maximum value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FillBar.ResourceBar::PropertyMaxValue()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MaxValue", + "name": "SetMaxValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::SetMaxValue" + }, + "parameters": [ + "FillBar", + "ResourceBar", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLabel" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the bar is empty.", + "fullName": "Empty", + "functionType": "Condition", + "group": "Resource bar", + "name": "IsEmpty", + "sentence": "_PARAM0_ is empty", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::IsEmpty" + }, + "parameters": [ + "FillBar", + "ResourceBar", + "=" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the bar is full.", + "fullName": "Full", + "functionType": "Condition", + "group": "Resource bar", + "name": "IsFull", + "sentence": "_PARAM0_ is full", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::IsFull" + }, + "parameters": [ + "FillBar", + "ResourceBar", + "=" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the previous value conservation duration (in seconds) of the object.", + "fullName": "Previous value conservation duration", + "functionType": "ExpressionAndCondition", + "group": "Resource bar configuration", + "name": "PreviousValueDuration", + "sentence": "the previous value conservation duration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FillBar.ResourceBar::PropertyPreviousHighValueDuration()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "PreviousValueDuration", + "name": "SetPreviousValueDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::SetPreviousHighValueDuration" + }, + "parameters": [ + "FillBar", + "ResourceBar", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"Value\"", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Buffer", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"Value\"", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Buffer" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the resource value is changing.", + "fullName": "Value is changing", + "functionType": "Condition", + "group": "Resource bar", + "name": "IsChanging", + "private": true, + "sentence": "_PARAM0_ value is changing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::IsChanging" + }, + "parameters": [ + "FillBar", + "ResourceBar", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "Value width", + "functionType": "Expression", + "name": "WidthForValue", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "round(Object.FullBarWidth() * FillBar.ResourceBar::Value() / FillBar.ResourceBar::MaxValue())" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Expression", + "name": "FullBarWidth", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Background.Width() - Object.PropertyBarLeftPadding() - Object.PropertyBarRightPadding()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the label is shown.", + "fullName": "Label is shown", + "functionType": "Condition", + "group": "Resource bar configuration", + "name": "IsLabelShown", + "sentence": "_PARAM0_ label is shown", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyShowLabel" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Show (or hide) the label on the bar.", + "fullName": "Show label", + "functionType": "Action", + "group": "Resource bar configuration", + "name": "SetLabelShown", + "sentence": "Show the label of _PARAM0_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPropertyShowLabel" + }, + "parameters": [ + "Object", + "no" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Label" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPropertyShowLabel" + }, + "parameters": [ + "Object", + "yes" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Label", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + }, + { + "description": "Show the label", + "name": "Value", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Update the text that display the current value and maximum value.", + "fullName": "Update label", + "functionType": "Action", + "name": "UpdateLabel", + "private": true, + "sentence": "Update label of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextObject::String" + }, + "parameters": [ + "Label", + "=", + "ToString(round(Object.Value())) + \" / \" + ToString(Object.MaxValue())" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "Bar", + "extraInformation": [ + "Label", + "FillBar", + "Buffer" + ], + "name": "BarLeftPadding" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "Bar", + "extraInformation": [ + "Label", + "FillBar", + "Buffer" + ], + "name": "BarTopPadding" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "Bar", + "extraInformation": [ + "Label", + "FillBar", + "Buffer" + ], + "name": "BarRightPadding" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "Bar", + "extraInformation": [ + "Label", + "FillBar", + "Buffer" + ], + "name": "BarBottomPadding" + }, + { + "value": "3", + "type": "Number", + "label": "Maximum value", + "description": "", + "group": "", + "extraInformation": [], + "name": "MaxValue" + }, + { + "value": "3", + "type": "Number", + "label": "Initial value", + "description": "", + "group": "", + "extraInformation": [], + "name": "InitialValue" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "It's used to detect a change at hot reload.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "PreviousInitialValue" + }, + { + "value": "1", + "type": "Number", + "label": "Previous high value conservation duration (in seconds)", + "description": "", + "group": "Animation", + "extraInformation": [], + "name": "PreviousHighValueDuration" + }, + { + "value": "0.25", + "type": "Number", + "label": "Easing duration", + "description": "", + "group": "Animation", + "extraInformation": [], + "name": "EasingDuration" + }, + { + "value": "true", + "type": "Boolean", + "label": "Show the label", + "description": "", + "group": "", + "extraInformation": [ + "Label" + ], + "name": "ShowLabel" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Buffer" + ], + "hidden": true, + "name": "ShowBuffer" + }, + { + "value": "Center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Label" + ], + "hidden": true, + "name": "LabelVerticalAnchorOrigin" + }, + { + "value": "Center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "FillBar" + ], + "hidden": true, + "name": "LabelVerticalAnchorTarget" + } + ], + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Label", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "2 / 3", + "font": "", + "textAlignment": "center", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "2 / 3", + "font": "", + "textAlignment": "center", + "characterSize": 20, + "color": "0;0;0" + } + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "FillBar", + "rightMargin": 0, + "texture": "", + "tiled": true, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "ResourceBar", + "type": "PanelSpriteContinuousBar::ResourceBar", + "Value": 1, + "MaxValue": 3, + "PreviousValue": 0 + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Buffer", + "rightMargin": 0, + "texture": "", + "tiled": true, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Background", + "rightMargin": 0, + "texture": "", + "tiled": true, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Label" + }, + { + "objectName": "FillBar" + }, + { + "objectName": "Buffer" + }, + { + "objectName": "Background" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [] + } + ] + }, + { + "author": "VegeTato, arthuro555", + "category": "General", + "extensionNamespace": "", + "fullName": "Repeat every X seconds", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXJlcGVhdCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNywxN0g3VjE0TDMsMThMNywyMlYxOUgxOVYxM0gxN003LDdIMTdWMTBMMjEsNkwxNywyVjVINVYxMUg3VjdaIiAvPjwvc3ZnPg==", + "name": "RepeatEveryXSeconds", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/repeat.svg", + "shortDescription": "Trigger an event every X seconds.", + "version": "0.1.1", + "description": "Convenience conditions, actions and behaviors for timers to trigger a condition every X seconds.", + "origin": { + "identifier": "RepeatEveryXSeconds", + "name": "gdevelop-extension-store" + }, + "tags": [ + "repeat", + "timer", + "time" + ], + "authorIds": [ + "ZgrsWuRTAkXgeuPV9bo0zuEcA2w1", + "IRIhkkTTl2UHhfjrLTTH5GYwkYu1", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Triggers every X seconds.", + "fullName": "Repeat with a scene timer", + "functionType": "Condition", + "name": "Repeat", + "sentence": "Repeat every _PARAM2_ seconds using timer _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "CompareTimer" + }, + "parameters": [ + "", + "TimerName", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetTimer" + }, + "parameters": [ + "player", + "TimerName" + ] + }, + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "__RepeatEveryXSeconds.Repetitions[TimerName]", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "TODO: It should keep the overflowing time to be more precise (it would need JavaScript)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareTimer" + }, + "parameters": [ + "player", + "TimerName", + ">=", + "LoopDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetTimer" + }, + "parameters": [ + "player", + "TimerName" + ] + }, + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "__RepeatEveryXSeconds.Repetitions[TimerName]", + "+", + "1" + ] + }, + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Timer name used to loop", + "name": "TimerName", + "type": "string" + }, + { + "description": "Duration in seconds between each repetition", + "name": "LoopDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the number of times the timer has repeated.", + "fullName": "Repetition number of a scene timer", + "functionType": "ExpressionAndCondition", + "name": "Repetition", + "sentence": "Repetition number of timer _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Variable(__RepeatEveryXSeconds.Repetitions[TimerName])" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Timer name used to loop", + "name": "TimerName", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Triggers every X seconds X amount of times.", + "fullName": "Repeat with a scene timer X times", + "functionType": "Condition", + "name": "RepeatXTimes", + "sentence": "Repeat every _PARAM2_ seconds _PARAM3_ times using timer _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "MaxLoop", + "<", + "0" + ] + }, + { + "type": { + "value": "RepeatEveryXSeconds::Repetition" + }, + "parameters": [ + "", + "<", + "MaxLoop", + "TimerName", + "" + ] + } + ] + }, + { + "type": { + "value": "RepeatEveryXSeconds::Repeat" + }, + "parameters": [ + "", + "TimerName", + "LoopDuration", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Timer name used to loop", + "name": "TimerName", + "type": "string" + }, + { + "description": "Duration in seconds between each repetition", + "name": "LoopDuration", + "type": "expression" + }, + { + "description": "The limit of loops", + "longDescription": "Maximum nuber of repetition (-1 to repeat forever).", + "name": "MaxLoop", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Reset repetition count of a scene timer.", + "fullName": "Reset repetition count of a scene timer", + "functionType": "Action", + "name": "DeleteTimer", + "sentence": "Reset repetition count for timer _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RemoveTimer" + }, + "parameters": [ + "player", + "TimerName" + ] + }, + { + "type": { + "value": "VariableRemoveChild" + }, + "parameters": [ + "__RepeatEveryXSeconds.Repetitions", + "TimerName" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Timer name used to loop", + "name": "TimerName", + "type": "string" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Allows to repeat an object timer every X seconds.", + "fullName": "Repeat every X seconds", + "name": "RepeatTimer", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "TimerName" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RepeatEveryXSeconds::RepeatTimer", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Triggers every X seconds.", + "fullName": "Repeat with an object timer", + "functionType": "Condition", + "group": "Timers", + "name": "Repeat2", + "sentence": "Repeat every _PARAM3_ seconds using timer _PARAM2_ of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "TimerName", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "TimerName" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__RepeatEveryXSeconds.Repetitions[TimerName]", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "TODO: It should keep the overflowing time to be more precise (it would need JavaScript)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "TimerName", + ">=", + "LoopDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "TimerName" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__RepeatEveryXSeconds.Repetitions[TimerName]", + "+", + "1" + ] + }, + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RepeatEveryXSeconds::RepeatTimer", + "type": "behavior" + }, + { + "description": "Timer name used to loop", + "name": "TimerName", + "type": "string" + }, + { + "description": "Duration in seconds between each repetition", + "name": "LoopDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the number of times the timer has repeated.", + "fullName": "Repetition number of an object timer", + "functionType": "ExpressionAndCondition", + "group": "Timers", + "name": "Repetition", + "sentence": "Repetition number of timer _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Variable(__RepeatEveryXSeconds.Repetitions[TimerName])" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RepeatEveryXSeconds::RepeatTimer", + "type": "behavior" + }, + { + "description": "Timer name used to loop", + "name": "TimerName", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Triggers every X seconds X amount of times.", + "fullName": "Repeat with an object timer X times", + "functionType": "Condition", + "group": "Timers", + "name": "RepeatXTimes", + "sentence": "Repeat every _PARAM3_ seconds _PARAM4_ times using timer _PARAM2_ of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "MaxLoop", + "<", + "0" + ] + }, + { + "type": { + "value": "RepeatEveryXSeconds::RepeatTimer::Repetition" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "MaxLoop", + "TimerName", + "" + ] + } + ] + }, + { + "type": { + "value": "RepeatEveryXSeconds::RepeatTimer::Repeat2" + }, + "parameters": [ + "Object", + "Behavior", + "TimerName", + "LoopDuration", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RepeatEveryXSeconds::RepeatTimer", + "type": "behavior" + }, + { + "description": "Timer name used to loop", + "name": "TimerName", + "type": "string" + }, + { + "description": "Duration in seconds between each repetition", + "name": "LoopDuration", + "type": "expression" + }, + { + "description": "The limit of loops", + "longDescription": "Maximum nuber of repetition (-1 to repeat forever).", + "name": "MaxLoop", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Reset repetition count of an object timer.", + "fullName": "Reset repetition count of an object timer", + "functionType": "Action", + "group": "Timers", + "name": "DeleteTimer", + "sentence": "Reset repetition count for timer _PARAM2_ of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "TimerName" + ] + }, + { + "type": { + "value": "ObjectVariableRemoveChild" + }, + "parameters": [ + "Object", + "__RepeatEveryXSeconds.Repetitions", + "TimerName" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RepeatEveryXSeconds::RepeatTimer", + "type": "behavior" + }, + { + "description": "Timer name used to loop", + "name": "TimerName", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Triggers every X seconds, where X is defined in the behavior properties.", + "fullName": "Repeat every X seconds (deprecated)", + "functionType": "Condition", + "name": "Repeat", + "private": true, + "sentence": "Recurring timer _PARAM1_ of _PARAM0_ has triggered", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectTimer" + }, + "parameters": [ + "Object", + "TimerName", + "TimerLength" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "RepeatEveryXSeconds::RepeatTimer::PropertyLimit" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "-1" + ] + }, + { + "type": { + "value": "RepeatEveryXSeconds::RepeatTimer::PropertyCounter" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "Limit" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "TimerName" + ] + }, + { + "type": { + "value": "RepeatEveryXSeconds::RepeatTimer::SetPropertyCounter" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + }, + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RepeatEveryXSeconds::RepeatTimer", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Pauses a recurring timer.", + "fullName": "Pause a recurring timer (deprecated)", + "functionType": "Action", + "name": "Pause", + "private": true, + "sentence": "Pause recurring timer _PARAM1_ of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PauseObjectTimer" + }, + "parameters": [ + "Object", + "TimerName" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RepeatEveryXSeconds::RepeatTimer", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Resumes a paused recurring timer.", + "fullName": "Resume a recurring timer (deprecated)", + "functionType": "Action", + "name": "Resume", + "private": true, + "sentence": "Resume recurring timer _PARAM1_ of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "UnPauseObjectTimer" + }, + "parameters": [ + "Object", + "TimerName" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RepeatEveryXSeconds::RepeatTimer", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Allows to trigger the recurring timer X times again.", + "fullName": "Reset the limit (deprecated)", + "functionType": "Action", + "name": "ResetLimit", + "private": true, + "sentence": "Allow to trigger the recurring timer _PARAM1_ of _PARAM0_ X times again", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RepeatEveryXSeconds::RepeatTimer::SetPropertyCounter" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RepeatEveryXSeconds::RepeatTimer", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "MyTimer", + "type": "String", + "label": "The name of the timer to repeat", + "description": "", + "group": "", + "extraInformation": [], + "deprecated": true, + "name": "TimerName" + }, + { + "value": "1", + "type": "Number", + "label": "The time between each trigger (in seconds)", + "description": "", + "group": "", + "extraInformation": [], + "deprecated": true, + "name": "TimerLength" + }, + { + "value": "-1", + "type": "Number", + "label": "How many times should the timer trigger? -1 for forever.", + "description": "", + "group": "", + "extraInformation": [], + "deprecated": true, + "name": "Limit" + }, + { + "value": "0", + "type": "Number", + "label": "An internal counter", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Counter" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Input", + "extensionNamespace": "", + "fullName": "Multitouch joystick and buttons (sprite)", + "helpPath": "/objects/multitouch-joystick", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMTYiIGN5PSIxNiIgcj0iMTMiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjI4LjQsMTIgMjAsMTIgMjAsMy42ICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMjAsMjguNCAyMCwyMCAyOC40LDIwICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMy42LDIwIDEyLDIwIDEyLDI4LjQgIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIxMiwzLjYgMTIsMTIgMy42LDEyICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIxNiw2IDE2LjcsNyAxNS4zLDcgIi8+DQo8cG9seWdvbiBjbGFzcz0ic3QwIiBwb2ludHM9IjE2LDI2IDE1LjMsMjUgMTYuNywyNSAiLz4NCjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iNiwxNiA3LDE1LjMgNywxNi43ICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIyNiwxNiAyNSwxNi43IDI1LDE1LjMgIi8+DQo8L3N2Zz4NCg==", + "name": "SpriteMultitouchJoystick", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Videogames/Videogames_controller_joystick_arrows_direction.svg", + "shortDescription": "Joysticks or buttons for touchscreens.", + "version": "1.3.0", + "description": [ + "Multitouch joysticks can be used the same way as physical gamepads:", + "- 4 or 8 directions", + "- Analogus pads", + "- Player selection", + "- Controls mapping for top-down movement and platformer characters", + "", + "There are ready-to-use joysticks in the asset-store [multitouch joysticks pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=multitouch-joysticks-multitouch-joysticks)." + ], + "origin": { + "identifier": "SpriteMultitouchJoystick", + "name": "gdevelop-extension-store" + }, + "tags": [ + "multitouch", + "joystick", + "thumbstick", + "controller", + "touchscreen", + "twin stick", + "shooter", + "virtual", + "platformer", + "platform", + "top-down" + ], + "authorIds": [ + "gqDaZjCfevOOxBYkK6zlhtZnXCg1", + "1OgYzWp5UeVPbiWGJwI6vqfgZLC3", + "v0YRpdAnIucZFgiRCCecqVnGKno2", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Check if a button is pressed on a gamepad.", + "fullName": "Multitouch controller button pressed", + "functionType": "Condition", + "name": "IsButtonPressed", + "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarSceneTxt" + }, + "parameters": [ + "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Button name", + "name": "Button", + "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a button is released on a gamepad.", + "fullName": "Multitouch controller button released", + "functionType": "Condition", + "name": "IsButtonReleased", + "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is released", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarSceneTxt" + }, + "parameters": [ + "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "=", + "\"Released\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Button name", + "name": "Button", + "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change a button state for a multitouch controller.", + "fullName": "Button state", + "functionType": "Action", + "name": "SetButtonState", + "private": true, + "sentence": "Mark _PARAM2_ button as _PARAM3_ for multitouch controller _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarSceneTxt" + }, + "parameters": [ + "__MultitouchJoystick.Controllers[ControllerIdentifier].Buttons[Button].State", + "=", + "ButtonState" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Button name", + "name": "Button", + "type": "string" + }, + { + "description": "Button state", + "name": "ButtonState", + "supplementaryInformation": "[\"Idle\",\"Pressed\",\"Released\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Change the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", + "fullName": "Dead zone radius", + "functionType": "Action", + "name": "SetDeadZone", + "private": true, + "sentence": "Change the dead zone of multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", + "=", + "DeadZoneRadius" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "type": "string" + }, + { + "description": "Dead zone radius", + "name": "DeadZoneRadius", + "supplementaryInformation": "[]", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", + "fullName": "Dead zone radius", + "functionType": "Expression", + "name": "DeadZone", + "private": true, + "sentence": "Change multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ dead zone to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Variable(__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "the direction index (left = 1, bottom = 1, right = 2, top = 3) for an angle (in degrees).", + "fullName": "Angle to 4-way index", + "functionType": "ExpressionAndCondition", + "name": "AngleTo4Way", + "private": true, + "sentence": "The angle _PARAM1_ 4-way index", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "mod(round(GetArgumentAsNumber(\"Angle\") * 4 / 360), 4)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Angle", + "name": "Angle", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the direction index (left = 1, bottom-left = 1... top-left = 7) for an angle (in degrees).", + "fullName": "Angle to 8-way index", + "functionType": "ExpressionAndCondition", + "name": "AngleTo8Way", + "private": true, + "sentence": "The angle _PARAM1_ 8-way index", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "mod(round(GetArgumentAsNumber(\"Angle\") * 8 / 360), 8)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Angle", + "name": "Angle", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if angle is in a given direction.", + "fullName": "Angle 4-way direction", + "functionType": "Condition", + "name": "IsAngleIn4WayDirection", + "private": true, + "sentence": "The angle _PARAM1_ is the 4-way direction _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Right\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo4Way" + }, + "parameters": [ + "", + "=", + "0", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Down\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo4Way" + }, + "parameters": [ + "", + "=", + "1", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Left\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo4Way" + }, + "parameters": [ + "", + "=", + "2", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Up\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo4Way" + }, + "parameters": [ + "", + "=", + "3", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Angle", + "name": "Angle", + "type": "expression" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if angle is in a given direction.", + "fullName": "Angle 8-way direction", + "functionType": "Condition", + "name": "IsAngleIn8WayDirection", + "private": true, + "sentence": "The angle _PARAM1_ is the 8-way direction _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Right\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "0", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"DownRight\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "1", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Down\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "2", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"DownLeft\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "3", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Left\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "4", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"UpLeft\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "5", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Up\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "6", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"UpRight\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "7", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Angle", + "name": "Angle", + "type": "expression" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (4-way)", + "functionType": "Condition", + "name": "IsDirectionPushed4Way", + "sentence": "Joystick _PARAM2_ of multitouch controller _PARAM1_ is pushed in direction _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make sure the joystick has moved from center" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::JoystickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "JoystickIdentifier", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::IsAngleIn4WayDirection" + }, + "parameters": [ + "", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (8-way)", + "functionType": "Condition", + "name": "IsDirectionPushed8Way", + "sentence": "Joystick _PARAM2_ of multitouch controller _PARAM1_ is pushed in direction _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make sure the joystick has moved from center" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::JoystickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "JoystickIdentifier", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::IsAngleIn8WayDirection" + }, + "parameters": [ + "", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "the percentage the thumb has been pulled away from the joystick center (Range: 0 to 1).", + "fullName": "Joystick force (deprecated)", + "functionType": "ExpressionAndCondition", + "name": "JoystickForce", + "private": true, + "sentence": "Joystick _PARAM2_ of multitouch controller _PARAM1_ force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "the force of multitouch contoller stick (from 0 to 1).", + "fullName": "Stick force", + "functionType": "ExpressionAndCondition", + "name": "StickForce", + "sentence": "multitouch controller _PARAM1_ _PARAM2_ stick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "max(0, Variable(__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force) - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier)) / (1 - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Stick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Change the percentage the thumb has been pulled away from the joystick center (Range: 0 to 1).", + "fullName": "Joystick force", + "functionType": "Action", + "name": "SetJoystickForce", + "private": true, + "sentence": "Change the force of the joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "type": "string" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the joystick is pointing towards (Range: -180 to 180).", + "fullName": "Joystick angle (deprecated)", + "functionType": "Expression", + "name": "JoystickAngle", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "SpriteMultitouchJoystick::StickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the multitouch controller stick is pointing towards (Range: -180 to 180).", + "fullName": "Stick angle", + "functionType": "Expression", + "name": "StickAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Change the angle the joystick is pointing towards (Range: -180 to 180).", + "fullName": "Joystick angle", + "functionType": "Action", + "name": "SetJoystickAngle", + "private": true, + "sentence": "Change the angle of the joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "type": "string" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the multitouch contoller stick force on X axis (from -1 at the left to 1 at the right).", + "fullName": "Stick X force", + "functionType": "Expression", + "name": "StickForceX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "SpriteMultitouchJoystick::JoystickForce(ControllerIdentifier, JoystickIdentifier) * cos(ToRad(SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the multitouch contoller stick force on Y axis (from -1 at the top to 1 at the bottom).", + "fullName": "Stick Y force", + "functionType": "Expression", + "name": "StickForceY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "SpriteMultitouchJoystick::JoystickForce(ControllerIdentifier, JoystickIdentifier) * sin(ToRad(SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Joystick that can be controlled by interacting with a touchscreen.", + "fullName": "Multitouch Joystick", + "name": "MultitouchJoystick", + "objectType": "", + "private": true, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SetDeadZone" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "Object.Behavior::PropertyDeadZoneRadius()", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasGameJustResumed" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Manage touches", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StartedTouchOrMouseCount()", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Move thumb back to center when not being pressed (acts like a spring on a real controller)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasTouchEnded" + }, + "parameters": [ + "", + "Object.Behavior::PropertyTouchId()" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Update joystick position", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickAngle" + }, + "parameters": [ + "Object", + "Behavior", + "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))", + "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(2 * DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)) / Object.Width(), 0, 1)", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick force (from 0 to 1).", + "fullName": "Joystick force", + "functionType": "ExpressionAndCondition", + "name": "JoystickForce", + "sentence": "the joystick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "max(0, JoystickForce - DeadZoneRadius) / (1 - DeadZoneRadius)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JoystickForce", + "name": "SetJoystickForce", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SetJoystickForce" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickForce", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the joystick is pointing towards (Range: -180 to 180).", + "fullName": "Joystick angle", + "functionType": "Expression", + "name": "JoystickAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "JoystickAngle" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the angle the joystick is pointing towards (Range: -180 to 180).", + "fullName": "Joystick angle", + "functionType": "Action", + "name": "SetJoystickAngle", + "private": true, + "sentence": "Change the joystick angle of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickAngle" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SetJoystickAngle" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "Object.Behavior::PropertyJoystickAngle()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, + { + "description": "Angle", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the stick force on X axis (from -1 at the left to 1 at the right).", + "fullName": "Stick X force", + "functionType": "Expression", + "name": "StickForceX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::JoystickForce() * cos(ToRad(Object.Behavior::JoystickAngle()))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the stick force on Y axis (from -1 at the top to 1 at the bottom).", + "fullName": "Stick Y force", + "functionType": "Expression", + "name": "StickForceY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::JoystickForce() * sin(ToRad(Object.Behavior::JoystickAngle()))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (4-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed4Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::IsAngleIn4WayDirection" + }, + "parameters": [ + "", + "JoystickAngle", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (8-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed8Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::IsAngleIn8WayDirection" + }, + "parameters": [ + "", + "JoystickAngle", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a joystick is pressed.", + "fullName": "Joystick pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Joystick _PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Reset the joystick values (except for angle, which stays the same)", + "fullName": "Reset", + "functionType": "Action", + "name": "Reset", + "private": true, + "sentence": "Reset the joystick of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the multitouch controller identifier.", + "fullName": "Multitouch controller identifier", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "ControllerIdentifier", + "sentence": "the multitouch controller identifier", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyControllerIdentifier()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ControllerIdentifier", + "name": "SetControllerIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyControllerIdentifier" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick name.", + "fullName": "Joystick name", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "JoystickIdentifier", + "sentence": "the joystick name", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.Behavior::PropertyJoystickIdentifier()" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JoystickIdentifier", + "name": "SetJoystickIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickIdentifier" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the dead zone radius (range: 0 to 1) of the joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", + "fullName": "Dead zone radius", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "DeadZoneRadius", + "sentence": "the dead zone radius", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "DeadZoneRadius" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DeadZoneRadius", + "name": "SetDeadZoneRadius", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyDeadZoneRadius" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "String", + "label": "Joystick name", + "description": "", + "group": "", + "extraInformation": [], + "name": "JoystickIdentifier" + }, + { + "value": "0.4", + "type": "Number", + "label": "Dead zone radius (range: 0 to 1)", + "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", + "group": "", + "extraInformation": [], + "name": "DeadZoneRadius" + }, + { + "value": "0", + "type": "Number", + "label": "Joystick angle (range: -180 to 180)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "JoystickAngle" + }, + { + "value": "0", + "type": "Number", + "label": "Joystick force (range: 0 to 1)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "JoystickForce" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchId" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchIndex" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Detect button presses made on a touchscreen.", + "fullName": "Multitouch button", + "name": "MultitouchButton", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsReleased" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyIsReleased" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" + }, + "parameters": [ + "Object", + "Behavior", + "\"Idle\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StartedTouchOrMouseCount()", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" + }, + "parameters": [ + "Object", + "Behavior", + "\"Pressed\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "HasTouchEnded" + }, + "parameters": [ + "", + "Object.Behavior::PropertyTouchId()" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" + }, + "parameters": [ + "Object", + "Behavior", + "\"Released\"", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyIsReleased" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if button is released.", + "fullName": "Button released", + "functionType": "Condition", + "name": "IsReleased", + "sentence": "Button _PARAM0_ is released", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyIsReleased" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if button is pressed.", + "fullName": "Button pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Button _PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Button state", + "functionType": "Action", + "name": "SetButtonState", + "private": true, + "sentence": "Mark the button _PARAM0_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SetButtonState" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyButtonIdentifier()", + "GetArgumentAsString(\"ButtonState\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + }, + { + "description": "Button state", + "name": "ButtonState", + "supplementaryInformation": "[\"Idle\",\"Pressed\",\"Released\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Button identifier", + "description": "", + "group": "", + "extraInformation": [], + "name": "ButtonIdentifier" + }, + { + "value": "0", + "type": "Number", + "label": "TouchID", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchId" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchIndex" + }, + { + "value": "", + "type": "Boolean", + "label": "Button released", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsReleased" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a platformer character with a multitouch controller.", + "fullName": "Platformer multitouch controller mapper", + "name": "PlatformerMultitouchMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "Property" + ] + }, + { + "type": { + "value": "PlatformBehavior::SimulateLadderKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsButtonPressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJumpButton()", + "\"Down\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::PlatformerMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Platform character behavior", + "description": "", + "group": "", + "extraInformation": [ + "PlatformBehavior::PlatformerObjectBehavior" + ], + "name": "Property" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a top-down character with a multitouch controller.", + "fullName": "Top-down multitouch controller mapper", + "name": "TopDownMultitouchMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", + "SpriteMultitouchJoystick::StickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", + "sign(SpriteMultitouchJoystick::StickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier()))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "TopDownMovementBehavior::DiagonalsAllowed" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TopDownMovementBehavior::DiagonalsAllowed" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"UpLeft\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"UpRight\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"DownLeft\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"DownRight\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Top-down movement behavior", + "description": "", + "group": "", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" + ], + "name": "TopDownMovement" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "description": "", + "group": "", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "Analog", + "type": "Choice", + "label": "Stick mode", + "description": "", + "group": "Controls", + "extraInformation": [ + "Analog", + "360°", + "8 Directions" + ], + "name": "StickMode" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [ + { + "areaMaxX": 64, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "defaultName": "Joystick", + "description": "Joystick for touchscreens.", + "fullName": "Multitouch Joystick", + "name": "SpriteMultitouchJoystick", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Border", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Thumb", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Border", + "=", + "1" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Thumb", + "=", + "2" + ] + }, + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Border", + "=", + "0", + "=", + "0" + ] + }, + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Thumb", + "=", + "0", + "=", + "0" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "SetIncludedInParentCollisionMask" + }, + "parameters": [ + "Thumb", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreAutour" + }, + "parameters": [ + "Thumb", + "Border", + "Border.MultitouchJoystick::JoystickForce() * Border.Width() / 2", + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Pass the object property values to the behavior.", + "fullName": "Update configuration", + "functionType": "Action", + "name": "UpdateConfiguration", + "private": true, + "sentence": "Update the configuration of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Object.PropertyControllerIdentifier()", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Object.PropertyJoystickIdentifier()", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Object.PropertyDeadZoneRadius()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "De/activate control of the joystick.", + "fullName": "De/activate control", + "functionType": "Action", + "name": "ActivateControl", + "sentence": "Activate control of _PARAM0_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Activate", + "name": "ShouldActivate", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a stick is pressed.", + "fullName": "Stick pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Stick _PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsPressed" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "!=" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick force (from 0 to 1).", + "fullName": "Joystick force (deprecated)", + "functionType": "ExpressionAndCondition", + "name": "JoystickForce", + "private": true, + "sentence": "the joystick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickForce()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the strick force (from 0 to 1).", + "fullName": "Stick force", + "functionType": "ExpressionAndCondition", + "name": "StickForce", + "sentence": "the stick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickForce()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the stick force on X axis (from -1 at the left to 1 at the right).", + "fullName": "Stick X force", + "functionType": "ExpressionAndCondition", + "name": "StickForceX", + "sentence": "the stick X force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::StickForceX()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the stick force on Y axis (from -1 at the top to 1 at the bottom).", + "fullName": "Stick Y force", + "functionType": "ExpressionAndCondition", + "name": "StickForceY", + "sentence": "the stick Y force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::StickForceY()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the joystick is pointing towards (from -180 to 180).", + "fullName": "Joystick angle (deprecated)", + "functionType": "Expression", + "name": "JoystickAngle", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the stick is pointing towards (from -180 to 180).", + "fullName": "Stick angle", + "functionType": "Expression", + "name": "StickAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (4-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed4Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (8-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed8Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "the multitouch controller identifier (1, 2, 3, 4...).", + "fullName": "Multitouch controller identifier", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "ControllerIdentifier", + "sentence": "the multitouch controller identifier", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyControllerIdentifier()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ControllerIdentifier", + "name": "SetControllerIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick name of the object.", + "fullName": "Joystick name", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "JoystickIdentifier", + "sentence": "the joystick name", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyJoystickIdentifier()" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JoystickIdentifier", + "name": "SetJoystickIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "GetArgumentAsString(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the dead zone radius of the joystick (range: 0 to 1). The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", + "fullName": "Dead zone radius", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "DeadZoneRadius", + "sentence": "the dead zone radius", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyDeadZoneRadius()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DeadZoneRadius", + "name": "SetDeadZoneRadius", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "description": "", + "group": "", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "0.4", + "type": "Number", + "label": "Dead zone radius (range: 0 to 1)", + "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", + "group": "", + "extraInformation": [], + "name": "DeadZoneRadius" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Thumb" + ], + "hidden": true, + "name": "ThumbAnchorOrigin" + }, + { + "value": "Center-center", + "type": "Number", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ThumbAnchorTarget" + }, + { + "value": "true", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Thumb" + ], + "hidden": true, + "name": "ThumbIsScaledProportionally" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ParentOrigin" + } + ], + "objects": [ + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Thumb", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Border", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "MultitouchJoystick", + "type": "SpriteMultitouchJoystick::MultitouchJoystick", + "ControllerIdentifier": 1, + "JoystickIdentifier": "Primary", + "FloatingEnabled": false, + "DeadZoneRadius": 0.4, + "JoystickAngle": 0, + "JoystickForce": 0, + "TouchId": 0, + "TouchIndex": 0 + } + ], + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Thumb" + }, + { + "objectName": "Border" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [] + } + ] + }, + { + "author": "", + "category": "Visual effect", + "extensionNamespace": "", + "fullName": "3D particle emitter", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWZpcmUiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTcuNjYgMTEuMkMxNy40MyAxMC45IDE3LjE1IDEwLjY0IDE2Ljg5IDEwLjM4QzE2LjIyIDkuNzggMTUuNDYgOS4zNSAxNC44MiA4LjcyQzEzLjMzIDcuMjYgMTMgNC44NSAxMy45NSAzQzEzIDMuMjMgMTIuMTcgMy43NSAxMS40NiA0LjMyQzguODcgNi40IDcuODUgMTAuMDcgOS4wNyAxMy4yMkM5LjExIDEzLjMyIDkuMTUgMTMuNDIgOS4xNSAxMy41NUM5LjE1IDEzLjc3IDkgMTMuOTcgOC44IDE0LjA1QzguNTcgMTQuMTUgOC4zMyAxNC4wOSA4LjE0IDEzLjkzQzguMDggMTMuODggOC4wNCAxMy44MyA4IDEzLjc2QzYuODcgMTIuMzMgNi42OSAxMC4yOCA3LjQ1IDguNjRDNS43OCAxMCA0Ljg3IDEyLjMgNSAxNC40N0M1LjA2IDE0Ljk3IDUuMTIgMTUuNDcgNS4yOSAxNS45N0M1LjQzIDE2LjU3IDUuNyAxNy4xNyA2IDE3LjdDNy4wOCAxOS40MyA4Ljk1IDIwLjY3IDEwLjk2IDIwLjkyQzEzLjEgMjEuMTkgMTUuMzkgMjAuOCAxNy4wMyAxOS4zMkMxOC44NiAxNy42NiAxOS41IDE1IDE4LjU2IDEyLjcyTDE4LjQzIDEyLjQ2QzE4LjIyIDEyIDE3LjY2IDExLjIgMTcuNjYgMTEuMk0xNC41IDE3LjVDMTQuMjIgMTcuNzQgMTMuNzYgMTggMTMuNCAxOC4xQzEyLjI4IDE4LjUgMTEuMTYgMTcuOTQgMTAuNSAxNy4yOEMxMS42OSAxNyAxMi40IDE2LjEyIDEyLjYxIDE1LjIzQzEyLjc4IDE0LjQzIDEyLjQ2IDEzLjc3IDEyLjMzIDEzQzEyLjIxIDEyLjI2IDEyLjIzIDExLjYzIDEyLjUgMTAuOTRDMTIuNjkgMTEuMzIgMTIuODkgMTEuNyAxMy4xMyAxMkMxMy45IDEzIDE1LjExIDEzLjQ0IDE1LjM3IDE0LjhDMTUuNDEgMTQuOTQgMTUuNDMgMTUuMDggMTUuNDMgMTUuMjNDMTUuNDYgMTYuMDUgMTUuMSAxNi45NSAxNC41IDE3LjVIMTQuNVoiIC8+PC9zdmc+", + "name": "ParticleEmitter3D", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/f2e5a34bf465f781866677762d385d6c8e9e8d203383f2df9a3b7e0fad6a2cb5_fire.svg", + "shortDescription": "Display a large number of particles to create visual effects.", + "version": "2.0.2", + "description": [ + "Particle emitters can be used to display:", + "- Fire", + "- Smoke", + "- Splashes", + "- Lights", + "", + "Breaking change", + "- 2.0.0", + " - Object properties for position and rotation have been removed. They must be set with the instance editor or the action.", + "- 1.0.0", + " - Particles were 3 times too small" + ], + "origin": { + "identifier": "ParticleEmitter3D", + "name": "gdevelop-extension-store" + }, + "tags": [ + "3d", + "particle", + "explosion", + "fire", + "smoke", + "splash", + "light" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Define helper classes JavaScript code.", + "fullName": "Define helper classes", + "functionType": "Action", + "name": "DefineHelperClasses", + "private": true, + "sentence": "Define helper classes JavaScript code", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (gdjs.__particleEmmiter3DExtension) {", + " return;", + "}", + "", + "class ParticleEmitter3DRenderer extends gdjs.CustomRuntimeObject3DRenderer {", + " constructor(", + " object,", + " instanceContainer,", + " parent", + " ) {", + " super(object, instanceContainer, parent);", + " }", + "", + " _updateThreeGroup() {", + " const threeObject3D = this.get3DRendererObject();", + "", + " threeObject3D.rotation.set(", + " gdjs.toRad(this._object.getRotationX()),", + " gdjs.toRad(this._object.getRotationY()),", + " -gdjs.toRad(this._object.angle)", + " );", + "", + " threeObject3D.position.set(", + " this._object.getX(),", + " -this._object.getY(),", + " this._object.getZ()", + " );", + "", + " threeObject3D.scale.set(", + " this._object.isFlippedX() ? -1 : 1,", + " this._object.isFlippedY() ? -1 : 1,", + " this._object.isFlippedZ() ? -1 : 1", + " );", + "", + " threeObject3D.visible = !this._object.hidden;", + "", + " this._isContainerDirty = true;", + " }", + "}", + "", + "/**", + " * @param {string} colorString", + " * @param {THREE.Vector4} threeColor", + " */", + "const setThreeColor = (colorString, threeColor = new THREE.Vector4()) => {", + " const integerColor = gdjs.rgbOrHexToRGBColor(colorString);", + " threeColor.x = integerColor[0] / 255;", + " threeColor.y = integerColor[1] / 255;", + " threeColor.z = integerColor[2] / 255;", + "};", + "", + "/**", + " * @param {string} integerOpacity", + " * @param {THREE.Vector4} threeColor", + " */", + "const setThreeOpacity = (integerOpacity, threeColor = new THREE.Vector4()) => {", + " threeColor.w = integerOpacity / 255;", + "};", + "", + "class ParticleEmitterAdapter {", + " /**", + " * @param particleSystem {ParticleSystem}", + " * @param colorOverLife {ColorOverLife}", + " * @param sizeOverLife {SizeOverLife}", + " * @param applyForce {ApplyForce}", + " */", + " constructor(particleSystem, colorOverLife, sizeOverLife, applyForce) {", + " this.particleSystem = particleSystem;", + " this.colorOverLife = colorOverLife;", + " this.sizeOverLife = sizeOverLife;", + " this.applyForce = applyForce;", + " }", + "", + " /**", + " * @param startColor {string}", + " */", + " setStartColor(startColor) {", + " setThreeColor(startColor, this.colorOverLife.color.color.keys[0][0]);", + " }", + "", + " /**", + " * @param endColor {string}", + " */", + " setEndColor(endColor) {", + " setThreeColor(endColor, this.colorOverLife.color.color.keys[1][0]);", + " }", + "", + " /**", + " * @param startOpacity {number}", + " */", + " setStartOpacity(startOpacity) {", + " this.colorOverLife.color.alpha.keys[0][0] = startOpacity / 255;", + " }", + "", + " /**", + " * @param endOpacity {number}", + " */", + " setEndOpacity(endOpacity) {", + " this.colorOverLife.color.alpha.keys[1][0] = endOpacity / 255;", + " }", + "", + " /**", + " * @param flow {number}", + " */", + " setFlow(flow) {", + " this.particleSystem.emissionOverTime.value = flow;", + " }", + "", + " /**", + " * @param startMinSize {number}", + " */", + " setStartMinSize(startMinSize) {", + " this.particleSystem.startSize.a = startMinSize;", + " }", + "", + " /**", + " * @param startMaxSize {number}", + " */", + " setStartMaxSize(startMaxSize) {", + " this.particleSystem.startSize.b = startMaxSize;", + " }", + "", + " /**", + " * @param endScale {number}", + " */", + " setEndScale(endScale) {", + " /** @type Bezier */", + " const bezier = this.sizeOverLife.size.functions[0][0];", + " bezier.p[0] = 1;", + " bezier.p[1] = gdjs.evtTools.common.lerp(1, endScale, 1 / 3);", + " bezier.p[2] = gdjs.evtTools.common.lerp(1, endScale, 2 / 3);", + " bezier.p[3] = endScale;", + " }", + "", + " /**", + " * @param startSpeedMin {number}", + " */", + " setStartSpeedMin(startSpeedMin) {", + " this.particleSystem.startSpeed.a = startSpeedMin;", + " }", + "", + " /**", + " * @param startSpeedMax {number}", + " */", + " setStartSpeedMax(startSpeedMax) {", + " this.particleSystem.startSpeed.b = startSpeedMax;", + " }", + "", + " /**", + " * @param lifespanMin {number}", + " */", + " setLifespanMin(lifespanMin) {", + " this.particleSystem.startLife.a = lifespanMin;", + " }", + "", + " /**", + " * @param lifespanMax {number}", + " */", + " setLifespanMax(lifespanMax) {", + " this.particleSystem.startLife.b = lifespanMax;", + " }", + "", + " /**", + " * @param duration {number}", + " */", + " setDuration(duration) {", + " this.particleSystem.duration = duration || Number.POSITIVE_INFINITY;", + " }", + "", + " /**", + " * @param areParticlesRelative {boolean}", + " */", + " setParticlesRelative(areParticlesRelative) {", + " this.particleSystem.worldSpace = !areParticlesRelative;", + " }", + "", + " /**", + " * @param sprayConeAngle {number}", + " */", + " setSprayConeAngle(sprayConeAngle) {", + " if (0 < sprayConeAngle && sprayConeAngle <= 180) {", + " if (!this.particleSystem.emitterShape.angle) {", + " this.particleSystem.emitterShape = new ConeEmitter({ radius: 0.1, angle: Math.PI / 8 });", + " }", + " this.particleSystem.emitterShape.angle = sprayConeAngle * Math.PI / 180;", + " }", + " else {", + " if (this.particleSystem.emitterShape.angle) {", + " this.particleSystem.emitterShape = new PointEmitter();", + " }", + " }", + " }", + "", + " /**", + " * @param blending {string}", + " */", + " setBlending(blendingString) {", + " const blending =", + " blendingString === \"Additive\" ? THREE.AdditiveBlending :", + " blendingString === \"Normal\" ? THREE.NormalBlending :", + " blendingString === \"Subtractive\" ? THREE.SubtractiveBlending :", + " blendingString === \"Multiply\" ? THREE.MultiplyBlending :", + " blendingString === \"None\" ? THREE.NoBlending :", + " THREE.AdditiveBlending;", + " // TODO This doesn't work.", + " this.particleSystem.blending = blending;", + " }", + "", + " /**", + " * @param gravity {number}", + " */", + " setGravity(gravity) {", + " this.applyForce.magnitude.value = gravity;", + " }", + "", + " /**", + " * @param gravityTop {string}", + " */", + " setGravityTop(gravityTop) {", + " // TODO Make gravity absolute even when \"relative\" is enabled. ", + " switch (gravityTop) {", + " case \"Z+\":", + " this.applyForce.direction.set(0, 0, -1);", + " break;", + "", + " case \"Y-\":", + " this.applyForce.direction.set(0, 1, 0);", + " break;", + " }", + " }", + "}", + "", + "", + "", + "/**", + " * three.quarks v0.11.2 build Mon Jan 22 2024", + " * https://github.com/Alchemist0823/three.quarks#readme", + " * Copyright 2024 Alchemist0823 , MIT", + " */", + "", + "class ParticleEmitter extends THREE.Object3D {", + " constructor(system) {", + " super();", + " this.type = 'ParticleEmitter';", + " this.system = system;", + " }", + " clone() {", + " const system = this.system.clone();", + " system.emitter.copy(this, true);", + " return system.emitter;", + " }", + " dispose() { }", + " extractFromCache(cache) {", + " const values = [];", + " for (const key in cache) {", + " const data = cache[key];", + " delete data.metadata;", + " values.push(data);", + " }", + " return values;", + " }", + " toJSON(meta, options = {}) {", + " const isRootObject = meta === undefined || typeof meta === 'string';", + " const output = {};", + " if (isRootObject) {", + " meta = {", + " geometries: {},", + " materials: {},", + " textures: {},", + " images: {},", + " shapes: {},", + " skeletons: {},", + " animations: {},", + " nodes: {},", + " };", + " output.metadata = {", + " version: 4.5,", + " type: 'Object',", + " generator: 'Object3D.toJSON',", + " };", + " }", + " const object = {};", + " object.uuid = this.uuid;", + " object.type = this.type;", + " if (this.name !== '')", + " object.name = this.name;", + " if (this.castShadow === true)", + " object.castShadow = true;", + " if (this.receiveShadow === true)", + " object.receiveShadow = true;", + " if (this.visible === false)", + " object.visible = false;", + " if (this.frustumCulled === false)", + " object.frustumCulled = false;", + " if (this.renderOrder !== 0)", + " object.renderOrder = this.renderOrder;", + " if (JSON.stringify(this.userData) !== '{}')", + " object.userData = this.userData;", + " object.layers = this.layers.mask;", + " object.matrix = this.matrix.toArray();", + " if (this.matrixAutoUpdate === false)", + " object.matrixAutoUpdate = false;", + " if (this.system !== null)", + " object.ps = this.system.toJSON(meta, options);", + " if (this.children.length > 0) {", + " object.children = [];", + " for (let i = 0; i < this.children.length; i++) {", + " if (this.children[i].type !== 'ParticleSystemPreview') {", + " object.children.push(this.children[i].toJSON(meta).object);", + " }", + " }", + " }", + " if (isRootObject) {", + " const geometries = this.extractFromCache(meta.geometries);", + " const materials = this.extractFromCache(meta.materials);", + " const textures = this.extractFromCache(meta.textures);", + " const images = this.extractFromCache(meta.images);", + " if (geometries.length > 0)", + " output.geometries = geometries;", + " if (materials.length > 0)", + " output.materials = materials;", + " if (textures.length > 0)", + " output.textures = textures;", + " if (images.length > 0)", + " output.images = images;", + " }", + " output.object = object;", + " return output;", + " }", + "}", + "", + "class LinkedListNode {", + " constructor(data) {", + " this.data = data;", + " this.next = null;", + " this.prev = null;", + " }", + " hasPrev() {", + " return this.prev !== null;", + " }", + " hasNext() {", + " return this.next !== null;", + " }", + "}", + "class LinkedList {", + " constructor() {", + " this.length = 0;", + " this.head = this.tail = null;", + " }", + " isEmpty() {", + " return this.head === null;", + " }", + " clear() {", + " this.length = 0;", + " this.head = this.tail = null;", + " }", + " front() {", + " if (this.head === null)", + " return null;", + " return this.head.data;", + " }", + " back() {", + " if (this.tail === null)", + " return null;", + " return this.tail.data;", + " }", + " dequeue() {", + " if (this.head) {", + " const value = this.head.data;", + " this.head = this.head.next;", + " if (!this.head) {", + " this.tail = null;", + " }", + " else {", + " this.head.prev = null;", + " }", + " this.length--;", + " return value;", + " }", + " return undefined;", + " }", + " pop() {", + " if (this.tail) {", + " const value = this.tail.data;", + " this.tail = this.tail.prev;", + " if (!this.tail) {", + " this.head = null;", + " }", + " else {", + " this.tail.next = null;", + " }", + " this.length--;", + " return value;", + " }", + " return undefined;", + " }", + " queue(data) {", + " const node = new LinkedListNode(data);", + " if (!this.tail) {", + " this.tail = node;", + " }", + " if (this.head) {", + " this.head.prev = node;", + " node.next = this.head;", + " }", + " this.head = node;", + " this.length++;", + " }", + " push(data) {", + " const node = new LinkedListNode(data);", + " if (!this.head) {", + " this.head = node;", + " }", + " if (this.tail) {", + " this.tail.next = node;", + " node.prev = this.tail;", + " }", + " this.tail = node;", + " this.length++;", + " }", + " insertBefore(node, data) {", + " const newNode = new LinkedListNode(data);", + " newNode.next = node;", + " newNode.prev = node.prev;", + " if (newNode.prev !== null) {", + " newNode.prev.next = newNode;", + " }", + " newNode.next.prev = newNode;", + " if (node == this.head) {", + " this.head = newNode;", + " }", + " this.length++;", + " }", + " remove(data) {", + " if (this.head === null || this.tail === null) {", + " return;", + " }", + " let tempNode = this.head;", + " if (data === this.head.data) {", + " this.head = this.head.next;", + " }", + " if (data === this.tail.data) {", + " this.tail = this.tail.prev;", + " }", + " while (tempNode.next !== null && tempNode.data !== data) {", + " tempNode = tempNode.next;", + " }", + " if (tempNode.data === data) {", + " if (tempNode.prev !== null)", + " tempNode.prev.next = tempNode.next;", + " if (tempNode.next !== null)", + " tempNode.next.prev = tempNode.prev;", + " this.length--;", + " }", + " }", + " *values() {", + " let current = this.head;", + " while (current !== null) {", + " yield current.data;", + " current = current.next;", + " }", + " }", + "}", + "", + "class NodeParticle {", + " constructor() {", + " this.position = new THREE.Vector3();", + " this.velocity = new THREE.Vector3();", + " this.age = 0;", + " this.life = 1;", + " this.size = 1;", + " this.rotation = 0;", + " this.color = new THREE.Vector4(1, 1, 1, 1);", + " this.uvTile = 0;", + " }", + " get died() {", + " return this.age >= this.life;", + " }", + " reset() {", + " this.position.set(0, 0, 0);", + " this.velocity.set(0, 0, 0);", + " this.age = 0;", + " this.life = 1;", + " this.size = 1;", + " this.rotation = 0;", + " this.color.set(1, 1, 1, 1);", + " this.uvTile = 0;", + " }", + "}", + "class SpriteParticle {", + " constructor() {", + " this.startSpeed = 0;", + " this.startColor = new THREE.Vector4();", + " this.startSize = 1;", + " this.position = new THREE.Vector3();", + " this.velocity = new THREE.Vector3();", + " this.age = 0;", + " this.life = 1;", + " this.size = 1;", + " this.speedModifier = 1;", + " this.rotation = 0;", + " this.color = new THREE.Vector4();", + " this.uvTile = 0;", + " }", + " get died() {", + " return this.age >= this.life;", + " }", + "}", + "class RecordState {", + " constructor(position, size, color) {", + " this.position = position;", + " this.size = size;", + " this.color = color;", + " }", + "}", + "class TrailParticle {", + " constructor() {", + " this.startSpeed = 0;", + " this.startColor = new THREE.Vector4();", + " this.startSize = 1;", + " this.position = new THREE.Vector3();", + " this.velocity = new THREE.Vector3();", + " this.age = 0;", + " this.life = 1;", + " this.size = 1;", + " this.length = 100;", + " this.speedModifier = 1;", + " this.color = new THREE.Vector4();", + " this.previous = new LinkedList();", + " this.uvTile = 0;", + " }", + " update() {", + " if (this.age <= this.life) {", + " this.previous.push(new RecordState(this.position.clone(), this.size, this.color.clone()));", + " }", + " else {", + " if (this.previous.length > 0) {", + " this.previous.dequeue();", + " }", + " }", + " while (this.previous.length > this.length) {", + " this.previous.dequeue();", + " }", + " }", + " get died() {", + " return this.age >= this.life;", + " }", + " reset() {", + " this.previous.clear();", + " }", + "}", + "", + "class Bezier {", + " constructor(p1, p2, p3, p4) {", + " this.p = [p1, p2, p3, p4];", + " }", + " genValue(t) {", + " const t2 = t * t;", + " const t3 = t * t * t;", + " const mt = 1 - t;", + " const mt2 = mt * mt;", + " const mt3 = mt2 * mt;", + " return this.p[0] * mt3 + this.p[1] * mt2 * t * 3 + this.p[2] * mt * t2 * 3 + this.p[3] * t3;", + " }", + " derivativeCoefficients(points) {", + " const dpoints = [];", + " for (let p = points, c = p.length - 1; c > 0; c--) {", + " const list = [];", + " for (let j = 0; j < c; j++) {", + " const dpt = c * (p[j + 1] - p[j]);", + " list.push(dpt);", + " }", + " dpoints.push(list);", + " p = list;", + " }", + " return dpoints;", + " }", + " getSlope(t) {", + " const p = this.derivativeCoefficients(this.p)[0];", + " const mt = 1 - t;", + " const a = mt * mt;", + " const b = mt * t * 2;", + " const c = t * t;", + " return a * p[0] + b * p[1] + c * p[2];", + " }", + " controlCurve(d0, d1) {", + " this.p[1] = d0 / 3 + this.p[0];", + " this.p[2] = this.p[3] - d1 / 3;", + " }", + " hull(t) {", + " let p = this.p;", + " let _p = [], pt, idx = 0, i = 0, l = 0;", + " const q = [];", + " q[idx++] = p[0];", + " q[idx++] = p[1];", + " q[idx++] = p[2];", + " q[idx++] = p[3];", + " while (p.length > 1) {", + " _p = [];", + " for (i = 0, l = p.length - 1; i < l; i++) {", + " pt = t * p[i] + (1 - t) * p[i + 1];", + " q[idx++] = pt;", + " _p.push(pt);", + " }", + " p = _p;", + " }", + " return q;", + " }", + " split(t) {", + " const q = this.hull(t);", + " const result = {", + " left: new Bezier(q[0], q[4], q[7], q[9]),", + " right: new Bezier(q[9], q[8], q[6], q[3]),", + " span: q", + " };", + " return result;", + " }", + " clone() {", + " return new Bezier(this.p[0], this.p[1], this.p[2], this.p[3]);", + " }", + " toJSON() {", + " return {", + " p0: this.p[0],", + " p1: this.p[1],", + " p2: this.p[2],", + " p3: this.p[3],", + " };", + " }", + " static fromJSON(json) {", + " return new Bezier(json.p0, json.p1, json.p2, json.p3);", + " }", + "}", + "", + "const ColorToJSON = (color) => {", + " return { r: color.x, g: color.y, b: color.z, a: color.w };", + "};", + "const JSONToColor = (json) => {", + " return new THREE.Vector4(json.r, json.g, json.b, json.a);", + "};", + "const JSONToValue = (json, type) => {", + " switch (type) {", + " case 'Vector3':", + " return new THREE.Vector3(json.x, json.y, json.z);", + " case 'Vector4':", + " return new THREE.Vector4(json.x, json.y, json.z, json.w);", + " case 'Color':", + " return new THREE.Vector3(json.r, json.g, json.b);", + " case 'Number':", + " return json;", + " default:", + " return json;", + " }", + "};", + "const ValueToJSON = (value, type) => {", + " switch (type) {", + " case 'Vector3':", + " return { x: value.x, y: value.y, z: value.z };", + " case 'Vector4':", + " return { x: value.x, y: value.y, z: value.z, w: value.w };", + " case 'Color':", + " return { r: value.x, g: value.y, b: value.z };", + " case 'Number':", + " return value;", + " default:", + " return value;", + " }", + "};", + "", + "class RandomColor {", + " constructor(a, b) {", + " this.a = a;", + " this.b = b;", + " this.type = \"value\";", + " }", + " genColor(color) {", + " const rand = Math.random();", + " return color.copy(this.a).lerp(this.b, rand);", + " }", + " toJSON() {", + " return {", + " type: \"RandomColor\",", + " a: ColorToJSON(this.a),", + " b: ColorToJSON(this.b),", + " };", + " }", + " static fromJSON(json) {", + " return new RandomColor(JSONToColor(json.a), JSONToColor(json.b));", + " }", + " clone() {", + " return new RandomColor(this.a.clone(), this.b.clone());", + " }", + "}", + "", + "class ColorRange {", + " constructor(a, b) {", + " this.a = a;", + " this.b = b;", + " this.type = 'value';", + " }", + " genColor(color, t) {", + " return color.copy(this.a).lerp(this.b, Math.random());", + " }", + " toJSON() {", + " return {", + " type: 'ColorRange',", + " a: ColorToJSON(this.a),", + " b: ColorToJSON(this.b),", + " };", + " }", + " static fromJSON(json) {", + " return new ColorRange(JSONToColor(json.a), JSONToColor(json.b));", + " }", + " clone() {", + " return new ColorRange(this.a.clone(), this.b.clone());", + " }", + "}", + "", + "class ContinuousLinearFunction {", + " constructor(keys, subType) {", + " this.subType = subType;", + " this.type = 'function';", + " this.keys = keys;", + " }", + " findKey(t) {", + " let mid = 0;", + " let left = 0, right = this.keys.length - 1;", + " while (left + 1 < right) {", + " mid = Math.floor((left + right) / 2);", + " if (t < this.getStartX(mid))", + " right = mid - 1;", + " else if (t > this.getEndX(mid))", + " left = mid + 1;", + " else", + " return mid;", + " }", + " for (let i = left; i <= right; i++) {", + " if (t >= this.getStartX(i) && t <= this.getEndX(i))", + " return i;", + " }", + " return -1;", + " }", + " getStartX(index) {", + " return this.keys[index][1];", + " }", + " getEndX(index) {", + " if (index + 1 < this.keys.length)", + " return this.keys[index + 1][1];", + " return 1;", + " }", + " genValue(value, t) {", + " const index = this.findKey(t);", + " if (this.subType === 'Number') {", + " if (index === -1) {", + " return this.keys[0][0];", + " }", + " else if (index + 1 >= this.keys.length) {", + " return this.keys[this.keys.length - 1][0];", + " }", + " return ((this.keys[index + 1][0] - this.keys[index][0]) *", + " ((t - this.getStartX(index)) / (this.getEndX(index) - this.getStartX(index))) +", + " this.keys[index][0]);", + " }", + " else {", + " if (index === -1) {", + " return value.copy(this.keys[0][0]);", + " }", + " if (index + 1 >= this.keys.length) {", + " return value.copy(this.keys[this.keys.length - 1][0]);", + " }", + " return value", + " .copy(this.keys[index][0])", + " .lerp(this.keys[index + 1][0], (t - this.getStartX(index)) / (this.getEndX(index) - this.getStartX(index)));", + " }", + " }", + " toJSON() {", + " this.keys[0][0].constructor.name;", + " return {", + " type: 'CLinearFunction',", + " subType: this.subType,", + " keys: this.keys.map(([color, pos]) => ({ value: ValueToJSON(color, this.subType), pos: pos })),", + " };", + " }", + " static fromJSON(json) {", + " return new ContinuousLinearFunction(json.keys.map((pair) => [JSONToValue(pair.value, json.subType), pair.pos]), json.subType);", + " }", + " clone() {", + " if (this.subType === 'Number') {", + " return new ContinuousLinearFunction(this.keys.map(([value, pos]) => [value, pos]), this.subType);", + " }", + " else {", + " return new ContinuousLinearFunction(this.keys.map(([value, pos]) => [value.clone(), pos]), this.subType);", + " }", + " }", + "}", + "", + "const tempVec3 = new THREE.Vector3();", + "class Gradient {", + " constructor(color = [", + " [new THREE.Vector3(0, 0, 0), 0],", + " [new THREE.Vector3(1, 1, 1), 0],", + " ], alpha = [", + " [1, 0],", + " [1, 1],", + " ]) {", + " this.type = 'function';", + " this.color = new ContinuousLinearFunction(color, 'Color');", + " this.alpha = new ContinuousLinearFunction(alpha, 'Number');", + " }", + " genColor(color, t) {", + " this.color.genValue(tempVec3, t);", + " return color.set(tempVec3.x, tempVec3.y, tempVec3.z, this.alpha.genValue(1, t));", + " }", + " toJSON() {", + " return {", + " type: 'Gradient',", + " color: this.color.toJSON(),", + " alpha: this.alpha.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " if (json.functions) {", + " const keys = json.functions.map((func) => [ColorRange.fromJSON(func.function).a, func.start]);", + " if (json.functions.length > 0) {", + " keys.push([ColorRange.fromJSON(json.functions[json.functions.length - 1].function).b, 1]);", + " }", + " return new Gradient(keys.map((key) => [new THREE.Vector3(key[0].x, key[0].y, key[0].z), key[1]]), keys.map((key) => [key[0].w, key[1]]));", + " }", + " else {", + " const gradient = new Gradient();", + " gradient.alpha = ContinuousLinearFunction.fromJSON(json.alpha);", + " gradient.color = ContinuousLinearFunction.fromJSON(json.color);", + " return gradient;", + " }", + " }", + " clone() {", + " const gradient = new Gradient();", + " gradient.alpha = this.alpha.clone();", + " gradient.color = this.color.clone();", + " return gradient;", + " }", + "}", + "", + "const tempColor = new THREE.Vector4();", + "class RandomColorBetweenGradient {", + " constructor(gradient1, gradient2) {", + " this.type = 'memorizedFunction';", + " this.gradient1 = gradient1;", + " this.gradient2 = gradient2;", + " }", + " startGen(memory) {", + " memory.rand = Math.random();", + " }", + " genColor(color, t, memory) {", + " this.gradient1.genColor(color, t);", + " this.gradient2.genColor(tempColor, t);", + " if (memory && memory.rand) {", + " color.lerp(tempColor, memory.rand);", + " }", + " else {", + " color.lerp(tempColor, Math.random());", + " }", + " return color;", + " }", + " toJSON() {", + " return {", + " type: 'RandomColorBetweenGradient',", + " gradient1: this.gradient1.toJSON(),", + " gradient2: this.gradient2.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new RandomColorBetweenGradient(Gradient.fromJSON(json.gradient1), Gradient.fromJSON(json.gradient2));", + " }", + " clone() {", + " return new RandomColorBetweenGradient(this.gradient1.clone(), this.gradient2.clone());", + " }", + "}", + "", + "class ConstantColor {", + " constructor(color) {", + " this.color = color;", + " this.type = 'value';", + " }", + " genColor(color) {", + " return color.copy(this.color);", + " }", + " toJSON() {", + " return {", + " type: 'ConstantColor',", + " color: ColorToJSON(this.color),", + " };", + " }", + " static fromJSON(json) {", + " return new ConstantColor(JSONToColor(json.color));", + " }", + " clone() {", + " return new ConstantColor(this.color.clone());", + " }", + "}", + "function ColorGeneratorFromJSON(json) {", + " switch (json.type) {", + " case 'ConstantColor':", + " return ConstantColor.fromJSON(json);", + " case 'ColorRange':", + " return ColorRange.fromJSON(json);", + " case 'RandomColor':", + " return RandomColor.fromJSON(json);", + " case 'Gradient':", + " return Gradient.fromJSON(json);", + " case 'RandomColorBetweenGradient':", + " return RandomColorBetweenGradient.fromJSON(json);", + " default:", + " return new ConstantColor(new THREE.Vector4(1, 1, 1, 1));", + " }", + "}", + "", + "class ConstantValue {", + " constructor(value) {", + " this.value = value;", + " this.type = 'value';", + " }", + " genValue() {", + " return this.value;", + " }", + " toJSON() {", + " return {", + " type: \"ConstantValue\",", + " value: this.value", + " };", + " }", + " static fromJSON(json) {", + " return new ConstantValue(json.value);", + " }", + " clone() {", + " return new ConstantValue(this.value);", + " }", + "}", + "", + "class IntervalValue {", + " constructor(a, b) {", + " this.a = a;", + " this.b = b;", + " this.type = 'value';", + " }", + " genValue() {", + " return THREE.MathUtils.lerp(this.a, this.b, Math.random());", + " }", + " toJSON() {", + " return {", + " type: 'IntervalValue',", + " a: this.a,", + " b: this.b,", + " };", + " }", + " static fromJSON(json) {", + " return new IntervalValue(json.a, json.b);", + " }", + " clone() {", + " return new IntervalValue(this.a, this.b);", + " }", + "}", + "", + "class PiecewiseFunction {", + " constructor() {", + " this.functions = new Array();", + " }", + " findFunction(t) {", + " let mid = 0;", + " let left = 0, right = this.functions.length - 1;", + " while (left + 1 < right) {", + " mid = Math.floor((left + right) / 2);", + " if (t < this.getStartX(mid))", + " right = mid - 1;", + " else if (t > this.getEndX(mid))", + " left = mid + 1;", + " else", + " return mid;", + " }", + " for (let i = left; i <= right; i++) {", + " if (t >= this.functions[i][1] && t <= this.getEndX(i))", + " return i;", + " }", + " return -1;", + " }", + " getStartX(index) {", + " return this.functions[index][1];", + " }", + " setStartX(index, x) {", + " if (index > 0)", + " this.functions[index][1] = x;", + " }", + " getEndX(index) {", + " if (index + 1 < this.functions.length)", + " return this.functions[index + 1][1];", + " return 1;", + " }", + " setEndX(index, x) {", + " if (index + 1 < this.functions.length)", + " this.functions[index + 1][1] = x;", + " }", + " insertFunction(t, func) {", + " const index = this.findFunction(t);", + " this.functions.splice(index + 1, 0, [func, t]);", + " }", + " removeFunction(index) {", + " return this.functions.splice(index, 1)[0][0];", + " }", + " getFunction(index) {", + " return this.functions[index][0];", + " }", + " setFunction(index, func) {", + " this.functions[index][0] = func;", + " }", + " get numOfFunctions() {", + " return this.functions.length;", + " }", + "}", + "", + "class PiecewiseBezier extends PiecewiseFunction {", + " constructor(curves = [[new Bezier(0, 1.0 / 3, 1.0 / 3 * 2, 1), 0]]) {", + " super();", + " this.type = \"function\";", + " this.functions = curves;", + " }", + " genValue(t = 0) {", + " const index = this.findFunction(t);", + " if (index === -1) {", + " return 0;", + " }", + " return this.functions[index][0].genValue((t - this.getStartX(index)) / (this.getEndX(index) - this.getStartX(index)));", + " }", + " toSVG(length, segments) {", + " if (segments < 1)", + " return \"\";", + " let result = [\"M\", 0, this.functions[0][0].p[0]].join(\" \");", + " for (let i = 1.0 / segments; i <= 1; i += 1.0 / segments) {", + " result = [result, \"L\", i * length, this.genValue(i)].join(\" \");", + " }", + " return result;", + " }", + " toJSON() {", + " return {", + " type: \"PiecewiseBezier\",", + " functions: this.functions.map(([bezier, start]) => ({ function: bezier.toJSON(), start: start })),", + " };", + " }", + " static fromJSON(json) {", + " return new PiecewiseBezier(json.functions.map((piecewiseFunction) => ([Bezier.fromJSON(piecewiseFunction.function), piecewiseFunction.start])));", + " }", + " clone() {", + " return new PiecewiseBezier(this.functions.map(([bezier, start]) => ([bezier.clone(), start])));", + " }", + "}", + "", + "function ValueGeneratorFromJSON(json) {", + " switch (json.type) {", + " case 'ConstantValue':", + " return ConstantValue.fromJSON(json);", + " case 'IntervalValue':", + " return IntervalValue.fromJSON(json);", + " case 'PiecewiseBezier':", + " return PiecewiseBezier.fromJSON(json);", + " default:", + " return new ConstantValue(0);", + " }", + "}", + "", + "class RandomQuatGenerator {", + " constructor() {", + " this.type = \"rotation\";", + " }", + " genValue(quat, t) {", + " let x, y, z, u, v, w;", + " do {", + " x = Math.random() * 2 - 1;", + " y = Math.random() * 2 - 1;", + " z = x * x + y * y;", + " } while (z > 1);", + " do {", + " u = Math.random() * 2 - 1;", + " v = Math.random() * 2 - 1;", + " w = u * u + v * v;", + " } while (w > 1);", + " const s = Math.sqrt((1 - z) / w);", + " quat.set(x, y, s * u, s * v);", + " return quat;", + " }", + " toJSON() {", + " return {", + " type: \"RandomQuat\"", + " };", + " }", + " static fromJSON(json) {", + " return new RandomQuatGenerator();", + " }", + " clone() {", + " return new RandomQuatGenerator();", + " }", + "}", + "", + "class AxisAngleGenerator {", + " constructor(axis, angle) {", + " this.axis = axis;", + " this.angle = angle;", + " this.type = 'rotation';", + " }", + " genValue(quat, t) {", + " return quat.setFromAxisAngle(this.axis, this.angle.genValue(t));", + " }", + " toJSON() {", + " return {", + " type: 'AxisAngle',", + " axis: { x: this.axis.x, y: this.axis.y, z: this.axis.z },", + " angle: this.angle.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new AxisAngleGenerator(new THREE.Vector3(json.axis.x, json.axis.y, json.axis.z), ValueGeneratorFromJSON(json.angle));", + " }", + " clone() {", + " return new AxisAngleGenerator(this.axis.clone(), this.angle.clone());", + " }", + "}", + "", + "class EulerGenerator {", + " constructor(angleX, angleY, angleZ, eulerOrder) {", + " this.angleX = angleX;", + " this.angleY = angleY;", + " this.angleZ = angleZ;", + " this.type = 'rotation';", + " this.eular = new THREE.Euler(0, 0, 0, eulerOrder);", + " }", + " genValue(quat, t) {", + " this.eular.set(this.angleX.genValue(t), this.angleY.genValue(t), this.angleZ.genValue(t));", + " return quat.setFromEuler(this.eular);", + " }", + " toJSON() {", + " return {", + " type: 'Euler',", + " angleX: this.angleX.toJSON(),", + " angleY: this.angleY.toJSON(),", + " angleZ: this.angleZ.toJSON(),", + " eulerOrder: this.eular.order,", + " };", + " }", + " static fromJSON(json) {", + " return new EulerGenerator(ValueGeneratorFromJSON(json.angleX), ValueGeneratorFromJSON(json.angleY), ValueGeneratorFromJSON(json.angleZ), json.eulerOrder);", + " }", + " clone() {", + " return new EulerGenerator(this.angleX, this.angleY, this.angleZ, this.eular.order);", + " }", + "}", + "", + "function RotationGeneratorFromJSON(json) {", + " switch (json.type) {", + " case 'AxisAngle':", + " return AxisAngleGenerator.fromJSON(json);", + " case 'Euler':", + " return EulerGenerator.fromJSON(json);", + " case 'RandomQuat':", + " return RandomQuatGenerator.fromJSON(json);", + " default:", + " return new RandomQuatGenerator();", + " }", + "}", + "", + "function GeneratorFromJSON(json) {", + " switch (json.type) {", + " case 'ConstantValue':", + " case 'IntervalValue':", + " case 'PiecewiseBezier':", + " return ValueGeneratorFromJSON(json);", + " case 'AxisAngle':", + " case 'RandomQuat':", + " case 'Euler':", + " return RotationGeneratorFromJSON(json);", + " default:", + " return new ConstantValue(0);", + " }", + "}", + "", + "class ColorOverLife {", + " constructor(color) {", + " this.color = color;", + " this.type = 'ColorOverLife';", + " }", + " initialize(particle) {", + " if (this.color.type === 'memorizedFunction') {", + " particle.colorOverLifeMemory = {};", + " this.color.startGen(particle.colorOverLifeMemory);", + " }", + " }", + " update(particle, delta) {", + " if (this.color.type === 'memorizedFunction') {", + " this.color.genColor(particle.color, particle.age / particle.life, particle.colorOverLifeMemory);", + " }", + " else {", + " this.color.genColor(particle.color, particle.age / particle.life);", + " }", + " particle.color.x *= particle.startColor.x;", + " particle.color.y *= particle.startColor.y;", + " particle.color.z *= particle.startColor.z;", + " particle.color.w *= particle.startColor.w;", + " }", + " frameUpdate(delta) { }", + " toJSON() {", + " return {", + " type: this.type,", + " color: this.color.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new ColorOverLife(ColorGeneratorFromJSON(json.color));", + " }", + " clone() {", + " return new ColorOverLife(this.color.clone());", + " }", + " reset() { }", + "}", + "", + "class RotationOverLife {", + " constructor(angularVelocity) {", + " this.angularVelocity = angularVelocity;", + " this.type = 'RotationOverLife';", + " this.dynamic = !(angularVelocity instanceof ConstantValue || angularVelocity instanceof IntervalValue);", + " }", + " initialize(particle) {", + " this.dynamic = !(this.angularVelocity instanceof ConstantValue || this.angularVelocity instanceof IntervalValue);", + " if (!this.dynamic && typeof particle.rotation === 'number') {", + " particle.angularVelocity = this.angularVelocity.genValue();", + " }", + " }", + " update(particle, delta) {", + " if (!this.dynamic) {", + " if (typeof particle.rotation === 'number') {", + " particle.rotation += delta * particle.angularVelocity;", + " }", + " }", + " else {", + " if (typeof particle.rotation === 'number') {", + " particle.rotation +=", + " delta * this.angularVelocity.genValue(particle.age / particle.life);", + " }", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " angularVelocity: this.angularVelocity.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new RotationOverLife(ValueGeneratorFromJSON(json.angularVelocity));", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new RotationOverLife(this.angularVelocity.clone());", + " }", + " reset() { }", + "}", + "", + "const IdentityQuaternion = new THREE.Quaternion();", + "class Rotation3DOverLife {", + " constructor(angularVelocity) {", + " this.angularVelocity = angularVelocity;", + " this.type = 'Rotation3DOverLife';", + " this.tempQuat = new THREE.Quaternion();", + " this.dynamic = !(angularVelocity instanceof RandomQuatGenerator);", + " }", + " initialize(particle) {", + " this.dynamic = !(this.angularVelocity instanceof RandomQuatGenerator);", + " if (particle.rotation instanceof THREE.Quaternion) {", + " particle.angularVelocity = new THREE.Quaternion();", + " this.angularVelocity.genValue(particle.angularVelocity);", + " }", + " }", + " update(particle, delta) {", + " if (particle.rotation instanceof THREE.Quaternion) {", + " if (!this.dynamic) {", + " this.tempQuat.slerpQuaternions(IdentityQuaternion, particle.angularVelocity, delta);", + " particle.rotation.multiply(this.tempQuat);", + " }", + " else {", + " this.angularVelocity.genValue(this.tempQuat, particle.age / particle.life);", + " this.tempQuat.slerpQuaternions(IdentityQuaternion, this.tempQuat, delta);", + " particle.rotation.multiply(this.tempQuat);", + " }", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " angularVelocity: this.angularVelocity.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new Rotation3DOverLife(RotationGeneratorFromJSON(json.angularVelocity));", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new Rotation3DOverLife(this.angularVelocity.clone());", + " }", + " reset() { }", + "}", + "", + "class ForceOverLife {", + " initialize(particle) { }", + " constructor(x, y, z) {", + " this.x = x;", + " this.y = y;", + " this.z = z;", + " this.type = 'ForceOverLife';", + " this._temp = new THREE.Vector3();", + " }", + " update(particle, delta) {", + " this._temp.set(this.x.genValue(particle.age / particle.life), this.y.genValue(particle.age / particle.life), this.z.genValue(particle.age / particle.life));", + " particle.velocity.addScaledVector(this._temp, delta);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " x: this.x.toJSON(),", + " y: this.y.toJSON(),", + " z: this.z.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new ForceOverLife(ValueGeneratorFromJSON(json.x), ValueGeneratorFromJSON(json.y), ValueGeneratorFromJSON(json.z));", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new ForceOverLife(this.x.clone(), this.y.clone(), this.z.clone());", + " }", + " reset() { }", + "}", + "", + "class SizeOverLife {", + " initialize(particle) {", + " }", + " constructor(size) {", + " this.size = size;", + " this.type = 'SizeOverLife';", + " }", + " update(particle) {", + " particle.size = particle.startSize * this.size.genValue(particle.age / particle.life);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " size: this.size.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new SizeOverLife(ValueGeneratorFromJSON(json.size));", + " }", + " frameUpdate(delta) {", + " }", + " clone() {", + " return new SizeOverLife(this.size.clone());", + " }", + " reset() {", + " }", + "}", + "", + "class SpeedOverLife {", + " initialize(particle) {", + " }", + " constructor(speed) {", + " this.speed = speed;", + " this.type = 'SpeedOverLife';", + " }", + " update(particle) {", + " particle.speedModifier = this.speed.genValue(particle.age / particle.life);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new SpeedOverLife(ValueGeneratorFromJSON(json.speed));", + " }", + " frameUpdate(delta) {", + " }", + " clone() {", + " return new SpeedOverLife(this.speed.clone());", + " }", + " reset() {", + " }", + "}", + "", + "class FrameOverLife {", + " constructor(frame) {", + " this.frame = frame;", + " this.type = 'FrameOverLife';", + " }", + " initialize(particle) {", + " if (!(this.frame instanceof PiecewiseBezier)) {", + " particle.uvTile = Math.floor(this.frame.genValue(0) + 0.001);", + " }", + " }", + " update(particle, delta) {", + " if (this.frame instanceof PiecewiseBezier) {", + " particle.uvTile = Math.floor(this.frame.genValue(particle.age / particle.life) + 0.001);", + " }", + " }", + " frameUpdate(delta) { }", + " toJSON() {", + " return {", + " type: this.type,", + " frame: this.frame.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new FrameOverLife(ValueGeneratorFromJSON(json.frame));", + " }", + " clone() {", + " return new FrameOverLife(this.frame.clone());", + " }", + " reset() { }", + "}", + "", + "new THREE.Vector3(0, 0, 1);", + "class OrbitOverLife {", + " constructor(orbitSpeed, axis = new THREE.Vector3(0, 1, 0)) {", + " this.orbitSpeed = orbitSpeed;", + " this.axis = axis;", + " this.type = 'OrbitOverLife';", + " this.temp = new THREE.Vector3();", + " this.rotation = new THREE.Quaternion();", + " this.line = new THREE.Line3();", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " this.line.set(new THREE.Vector3(0, 0, 0), this.axis);", + " this.line.closestPointToPoint(particle.position, false, this.temp);", + " this.rotation.setFromAxisAngle(this.axis, this.orbitSpeed.genValue(particle.age / particle.life) * delta);", + " particle.position.sub(this.temp);", + " particle.position.applyQuaternion(this.rotation);", + " particle.position.add(this.temp);", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " orbitSpeed: this.orbitSpeed.toJSON(),", + " axis: [this.axis.x, this.axis.y, this.axis.z],", + " };", + " }", + " static fromJSON(json) {", + " return new OrbitOverLife(ValueGeneratorFromJSON(json.orbitSpeed), json.axis ? new THREE.Vector3(json.axis[0], json.axis[1], json.axis[2]) : undefined);", + " }", + " clone() {", + " return new OrbitOverLife(this.orbitSpeed.clone());", + " }", + " reset() {", + " }", + "}", + "", + "class WidthOverLength {", + " initialize(particle) {", + " }", + " constructor(width) {", + " this.width = width;", + " this.type = 'WidthOverLength';", + " }", + " update(particle) {", + " if (particle instanceof TrailParticle) {", + " const iter = particle.previous.values();", + " for (let i = 0; i < particle.previous.length; i++) {", + " const cur = iter.next();", + " cur.value.size = this.width.genValue((particle.previous.length - i) / particle.length);", + " }", + " }", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " width: this.width.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new WidthOverLength(ValueGeneratorFromJSON(json.width));", + " }", + " clone() {", + " return new WidthOverLength(this.width.clone());", + " }", + " reset() {", + " }", + "}", + "", + "class ApplyForce {", + " constructor(direction, magnitude) {", + " this.direction = direction;", + " this.magnitude = magnitude;", + " this.type = 'ApplyForce';", + " this.magnitudeValue = this.magnitude.genValue();", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " particle.velocity.addScaledVector(this.direction, this.magnitudeValue * delta);", + " }", + " frameUpdate(delta) {", + " this.magnitudeValue = this.magnitude.genValue();", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " direction: [this.direction.x, this.direction.y, this.direction.z],", + " magnitude: this.magnitude.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " var _a;", + " return new ApplyForce(new THREE.Vector3(json.direction[0], json.direction[1], json.direction[2]), ValueGeneratorFromJSON((_a = json.magnitude) !== null && _a !== void 0 ? _a : json.force));", + " }", + " clone() {", + " return new ApplyForce(this.direction.clone(), this.magnitude.clone());", + " }", + " reset() {", + " }", + "}", + "", + "class GravityForce {", + " constructor(center, magnitude) {", + " this.center = center;", + " this.magnitude = magnitude;", + " this.type = 'GravityForce';", + " this.temp = new THREE.Vector3();", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " this.temp.copy(this.center).sub(particle.position).normalize();", + " particle.velocity.addScaledVector(this.temp, this.magnitude / particle.position.distanceToSquared(this.center) * delta);", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " center: [this.center.x, this.center.y, this.center.z],", + " magnitude: this.magnitude,", + " };", + " }", + " static fromJSON(json) {", + " return new GravityForce(new THREE.Vector3(json.center[0], json.center[1], json.center[2]), json.magnitude);", + " }", + " clone() {", + " return new GravityForce(this.center.clone(), this.magnitude);", + " }", + " reset() {", + " }", + "}", + "", + "new THREE.Vector3(0, 0, 1);", + "class ChangeEmitDirection {", + " constructor(angle) {", + " this.angle = angle;", + " this.type = 'ChangeEmitDirection';", + " this._temp = new THREE.Vector3();", + " this._q = new THREE.Quaternion();", + " }", + " initialize(particle) {", + " const len = particle.velocity.length();", + " if (len == 0)", + " return;", + " particle.velocity.normalize();", + " if (particle.velocity.x === 0 && particle.velocity.y === 0) {", + " this._temp.set(0, particle.velocity.z, 0);", + " }", + " else {", + " this._temp.set(-particle.velocity.y, particle.velocity.x, 0);", + " }", + " this._q.setFromAxisAngle(this._temp.normalize(), this.angle.genValue());", + " this._temp.copy(particle.velocity);", + " particle.velocity.applyQuaternion(this._q);", + " this._q.setFromAxisAngle(this._temp, Math.random() * Math.PI * 2);", + " particle.velocity.applyQuaternion(this._q);", + " particle.velocity.setLength(len);", + " }", + " update(particle, delta) {", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " angle: this.angle.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new ChangeEmitDirection(ValueGeneratorFromJSON(json.angle));", + " }", + " clone() {", + " return new ChangeEmitDirection(this.angle);", + " }", + " reset() {", + " }", + "}", + "", + "const VECTOR_ONE = new THREE.Vector3(1, 1, 1);", + "const VECTOR_Z = new THREE.Vector3(0, 0, 1);", + "let SubParticleEmitMode = void 0;", + "(function (SubParticleEmitMode) {", + " SubParticleEmitMode[SubParticleEmitMode[\"Death\"] = 0] = \"Death\";", + " SubParticleEmitMode[SubParticleEmitMode[\"Birth\"] = 1] = \"Birth\";", + " SubParticleEmitMode[SubParticleEmitMode[\"Frame\"] = 2] = \"Frame\";", + "})(SubParticleEmitMode || (SubParticleEmitMode = {}));", + "class EmitSubParticleSystem {", + " constructor(particleSystem, useVelocityAsBasis, subParticleSystem, mode = SubParticleEmitMode.Frame, emitProbability = 1) {", + " this.particleSystem = particleSystem;", + " this.useVelocityAsBasis = useVelocityAsBasis;", + " this.subParticleSystem = subParticleSystem;", + " this.mode = mode;", + " this.emitProbability = emitProbability;", + " this.type = 'EmitSubParticleSystem';", + " this.q_ = new THREE.Quaternion();", + " this.v_ = new THREE.Vector3();", + " this.v2_ = new THREE.Vector3();", + " this.subEmissions = new Array();", + " if (this.subParticleSystem && this.subParticleSystem.system) {", + " this.subParticleSystem.system.onlyUsedByOther = true;", + " }", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " if (this.mode === SubParticleEmitMode.Frame) {", + " this.emit(particle, delta);", + " }", + " else if (this.mode === SubParticleEmitMode.Birth && particle.age === 0) {", + " this.emit(particle, delta);", + " }", + " else if (this.mode === SubParticleEmitMode.Death && particle.age + delta >= particle.life) {", + " this.emit(particle, delta);", + " }", + " }", + " emit(particle, delta) {", + " if (!this.subParticleSystem)", + " return;", + " if (Math.random() > this.emitProbability) {", + " return;", + " }", + " const m = new THREE.Matrix4();", + " this.setMatrixFromParticle(m, particle);", + " this.subEmissions.push({", + " burstIndex: 0,", + " burstWaveIndex: 0,", + " time: 0,", + " waitEmiting: 0,", + " matrix: m,", + " travelDistance: 0,", + " particle: particle,", + " });", + " }", + " frameUpdate(delta) {", + " if (!this.subParticleSystem)", + " return;", + " for (let i = 0; i < this.subEmissions.length; i++) {", + " if (this.subEmissions[i].time >= this.subParticleSystem.system.duration) {", + " this.subEmissions[i] = this.subEmissions[this.subEmissions.length - 1];", + " this.subEmissions.length = this.subEmissions.length - 1;", + " i--;", + " }", + " else {", + " let subEmissionState = this.subEmissions[i];", + " if (subEmissionState.particle && subEmissionState.particle.age < subEmissionState.particle.life) {", + " this.setMatrixFromParticle(subEmissionState.matrix, subEmissionState.particle);", + " }", + " else {", + " subEmissionState.particle = undefined;", + " }", + " this.subParticleSystem.system.emit(delta, subEmissionState, subEmissionState.matrix);", + " }", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " subParticleSystem: this.subParticleSystem ? this.subParticleSystem.uuid : '',", + " useVelocityAsBasis: this.useVelocityAsBasis,", + " mode: this.mode,", + " emitProbability: this.emitProbability,", + " };", + " }", + " static fromJSON(json, particleSystem) {", + " return new EmitSubParticleSystem(particleSystem, json.useVelocityAsBasis, json.subParticleSystem, json.mode, json.emitProbability);", + " }", + " clone() {", + " return new EmitSubParticleSystem(this.particleSystem, this.useVelocityAsBasis, this.subParticleSystem, this.mode, this.emitProbability);", + " }", + " reset() { }", + " setMatrixFromParticle(m, particle) {", + " let rotation;", + " if (particle.rotation === undefined || this.useVelocityAsBasis) {", + " if (particle.velocity.x === 0 &&", + " particle.velocity.y === 0 &&", + " (particle.velocity.z === 1 || particle.velocity.z === 0)) {", + " m.set(1, 0, 0, particle.position.x, 0, 1, 0, particle.position.y, 0, 0, 1, particle.position.z, 0, 0, 0, 1);", + " }", + " else {", + " this.v_.copy(VECTOR_Z).cross(particle.velocity);", + " this.v2_.copy(particle.velocity).cross(this.v_);", + " const len = this.v_.length();", + " const len2 = this.v2_.length();", + " m.set(this.v_.x / len, this.v2_.x / len2, particle.velocity.x, particle.position.x, this.v_.y / len, this.v2_.y / len2, particle.velocity.y, particle.position.y, this.v_.z / len, this.v2_.z / len2, particle.velocity.z, particle.position.z, 0, 0, 0, 1);", + " }", + " }", + " else {", + " if (particle.rotation instanceof THREE.Quaternion) {", + " rotation = particle.rotation;", + " }", + " else {", + " this.q_.setFromAxisAngle(VECTOR_Z, particle.rotation);", + " rotation = this.q_;", + " }", + " m.compose(particle.position, rotation, VECTOR_ONE);", + " }", + " if (!this.particleSystem.worldSpace) {", + " m.multiplyMatrices(this.particleSystem.emitter.matrixWorld, m);", + " }", + " }", + "}", + "", + "const F2 = 0.5 * (Math.sqrt(3.0) - 1.0);", + "const G2 = (3.0 - Math.sqrt(3.0)) / 6.0;", + "const F3 = 1.0 / 3.0;", + "const G3 = 1.0 / 6.0;", + "const F4 = (Math.sqrt(5.0) - 1.0) / 4.0;", + "const G4 = (5.0 - Math.sqrt(5.0)) / 20.0;", + "const grad3 = new Float32Array([1, 1, 0,", + " -1, 1, 0,", + " 1, -1, 0,", + " -1, -1, 0,", + " 1, 0, 1,", + " -1, 0, 1,", + " 1, 0, -1,", + " -1, 0, -1,", + " 0, 1, 1,", + " 0, -1, 1,", + " 0, 1, -1,", + " 0, -1, -1]);", + "const grad4 = new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,", + " 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,", + " 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,", + " -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,", + " 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,", + " -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,", + " 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,", + " -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]);", + "class SimplexNoise {", + " constructor(randomOrSeed = Math.random) {", + " const random = typeof randomOrSeed == 'function' ? randomOrSeed : alea(randomOrSeed);", + " this.p = buildPermutationTable(random);", + " this.perm = new Uint8Array(512);", + " this.permMod12 = new Uint8Array(512);", + " for (let i = 0; i < 512; i++) {", + " this.perm[i] = this.p[i & 255];", + " this.permMod12[i] = this.perm[i] % 12;", + " }", + " }", + " noise2D(x, y) {", + " const permMod12 = this.permMod12;", + " const perm = this.perm;", + " let n0 = 0;", + " let n1 = 0;", + " let n2 = 0;", + " const s = (x + y) * F2;", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const t = (i + j) * G2;", + " const X0 = i - t;", + " const Y0 = j - t;", + " const x0 = x - X0;", + " const y0 = y - Y0;", + " let i1, j1;", + " if (x0 > y0) {", + " i1 = 1;", + " j1 = 0;", + " }", + " else {", + " i1 = 0;", + " j1 = 1;", + " }", + " const x1 = x0 - i1 + G2;", + " const y1 = y0 - j1 + G2;", + " const x2 = x0 - 1.0 + 2.0 * G2;", + " const y2 = y0 - 1.0 + 2.0 * G2;", + " const ii = i & 255;", + " const jj = j & 255;", + " let t0 = 0.5 - x0 * x0 - y0 * y0;", + " if (t0 >= 0) {", + " const gi0 = permMod12[ii + perm[jj]] * 3;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0);", + " }", + " let t1 = 0.5 - x1 * x1 - y1 * y1;", + " if (t1 >= 0) {", + " const gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);", + " }", + " let t2 = 0.5 - x2 * x2 - y2 * y2;", + " if (t2 >= 0) {", + " const gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);", + " }", + " return 70.0 * (n0 + n1 + n2);", + " }", + " noise3D(x, y, z) {", + " const permMod12 = this.permMod12;", + " const perm = this.perm;", + " let n0, n1, n2, n3;", + " const s = (x + y + z) * F3;", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const k = Math.floor(z + s);", + " const t = (i + j + k) * G3;", + " const X0 = i - t;", + " const Y0 = j - t;", + " const Z0 = k - t;", + " const x0 = x - X0;", + " const y0 = y - Y0;", + " const z0 = z - Z0;", + " let i1, j1, k1;", + " let i2, j2, k2;", + " if (x0 >= y0) {", + " if (y0 >= z0) {", + " i1 = 1;", + " j1 = 0;", + " k1 = 0;", + " i2 = 1;", + " j2 = 1;", + " k2 = 0;", + " }", + " else if (x0 >= z0) {", + " i1 = 1;", + " j1 = 0;", + " k1 = 0;", + " i2 = 1;", + " j2 = 0;", + " k2 = 1;", + " }", + " else {", + " i1 = 0;", + " j1 = 0;", + " k1 = 1;", + " i2 = 1;", + " j2 = 0;", + " k2 = 1;", + " }", + " }", + " else {", + " if (y0 < z0) {", + " i1 = 0;", + " j1 = 0;", + " k1 = 1;", + " i2 = 0;", + " j2 = 1;", + " k2 = 1;", + " }", + " else if (x0 < z0) {", + " i1 = 0;", + " j1 = 1;", + " k1 = 0;", + " i2 = 0;", + " j2 = 1;", + " k2 = 1;", + " }", + " else {", + " i1 = 0;", + " j1 = 1;", + " k1 = 0;", + " i2 = 1;", + " j2 = 1;", + " k2 = 0;", + " }", + " }", + " const x1 = x0 - i1 + G3;", + " const y1 = y0 - j1 + G3;", + " const z1 = z0 - k1 + G3;", + " const x2 = x0 - i2 + 2.0 * G3;", + " const y2 = y0 - j2 + 2.0 * G3;", + " const z2 = z0 - k2 + 2.0 * G3;", + " const x3 = x0 - 1.0 + 3.0 * G3;", + " const y3 = y0 - 1.0 + 3.0 * G3;", + " const z3 = z0 - 1.0 + 3.0 * G3;", + " const ii = i & 255;", + " const jj = j & 255;", + " const kk = k & 255;", + " let t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0;", + " if (t0 < 0)", + " n0 = 0.0;", + " else {", + " const gi0 = permMod12[ii + perm[jj + perm[kk]]] * 3;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0 + grad3[gi0 + 2] * z0);", + " }", + " let t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1;", + " if (t1 < 0)", + " n1 = 0.0;", + " else {", + " const gi1 = permMod12[ii + i1 + perm[jj + j1 + perm[kk + k1]]] * 3;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1 + grad3[gi1 + 2] * z1);", + " }", + " let t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2;", + " if (t2 < 0)", + " n2 = 0.0;", + " else {", + " const gi2 = permMod12[ii + i2 + perm[jj + j2 + perm[kk + k2]]] * 3;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2 + grad3[gi2 + 2] * z2);", + " }", + " let t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3;", + " if (t3 < 0)", + " n3 = 0.0;", + " else {", + " const gi3 = permMod12[ii + 1 + perm[jj + 1 + perm[kk + 1]]] * 3;", + " t3 *= t3;", + " n3 = t3 * t3 * (grad3[gi3] * x3 + grad3[gi3 + 1] * y3 + grad3[gi3 + 2] * z3);", + " }", + " return 32.0 * (n0 + n1 + n2 + n3);", + " }", + " noise4D(x, y, z, w) {", + " const perm = this.perm;", + " let n0, n1, n2, n3, n4;", + " const s = (x + y + z + w) * F4;", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const k = Math.floor(z + s);", + " const l = Math.floor(w + s);", + " const t = (i + j + k + l) * G4;", + " const X0 = i - t;", + " const Y0 = j - t;", + " const Z0 = k - t;", + " const W0 = l - t;", + " const x0 = x - X0;", + " const y0 = y - Y0;", + " const z0 = z - Z0;", + " const w0 = w - W0;", + " let rankx = 0;", + " let ranky = 0;", + " let rankz = 0;", + " let rankw = 0;", + " if (x0 > y0)", + " rankx++;", + " else", + " ranky++;", + " if (x0 > z0)", + " rankx++;", + " else", + " rankz++;", + " if (x0 > w0)", + " rankx++;", + " else", + " rankw++;", + " if (y0 > z0)", + " ranky++;", + " else", + " rankz++;", + " if (y0 > w0)", + " ranky++;", + " else", + " rankw++;", + " if (z0 > w0)", + " rankz++;", + " else", + " rankw++;", + " const i1 = rankx >= 3 ? 1 : 0;", + " const j1 = ranky >= 3 ? 1 : 0;", + " const k1 = rankz >= 3 ? 1 : 0;", + " const l1 = rankw >= 3 ? 1 : 0;", + " const i2 = rankx >= 2 ? 1 : 0;", + " const j2 = ranky >= 2 ? 1 : 0;", + " const k2 = rankz >= 2 ? 1 : 0;", + " const l2 = rankw >= 2 ? 1 : 0;", + " const i3 = rankx >= 1 ? 1 : 0;", + " const j3 = ranky >= 1 ? 1 : 0;", + " const k3 = rankz >= 1 ? 1 : 0;", + " const l3 = rankw >= 1 ? 1 : 0;", + " const x1 = x0 - i1 + G4;", + " const y1 = y0 - j1 + G4;", + " const z1 = z0 - k1 + G4;", + " const w1 = w0 - l1 + G4;", + " const x2 = x0 - i2 + 2.0 * G4;", + " const y2 = y0 - j2 + 2.0 * G4;", + " const z2 = z0 - k2 + 2.0 * G4;", + " const w2 = w0 - l2 + 2.0 * G4;", + " const x3 = x0 - i3 + 3.0 * G4;", + " const y3 = y0 - j3 + 3.0 * G4;", + " const z3 = z0 - k3 + 3.0 * G4;", + " const w3 = w0 - l3 + 3.0 * G4;", + " const x4 = x0 - 1.0 + 4.0 * G4;", + " const y4 = y0 - 1.0 + 4.0 * G4;", + " const z4 = z0 - 1.0 + 4.0 * G4;", + " const w4 = w0 - 1.0 + 4.0 * G4;", + " const ii = i & 255;", + " const jj = j & 255;", + " const kk = k & 255;", + " const ll = l & 255;", + " let t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;", + " if (t0 < 0)", + " n0 = 0.0;", + " else {", + " const gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);", + " }", + " let t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;", + " if (t1 < 0)", + " n1 = 0.0;", + " else {", + " const gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);", + " }", + " let t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;", + " if (t2 < 0)", + " n2 = 0.0;", + " else {", + " const gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);", + " }", + " let t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;", + " if (t3 < 0)", + " n3 = 0.0;", + " else {", + " const gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;", + " t3 *= t3;", + " n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);", + " }", + " let t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;", + " if (t4 < 0)", + " n4 = 0.0;", + " else {", + " const gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;", + " t4 *= t4;", + " n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);", + " }", + " return 27.0 * (n0 + n1 + n2 + n3 + n4);", + " }", + "}", + "function buildPermutationTable(random) {", + " const p = new Uint8Array(256);", + " for (let i = 0; i < 256; i++) {", + " p[i] = i;", + " }", + " for (let i = 0; i < 255; i++) {", + " const r = i + ~~(random() * (256 - i));", + " const aux = p[i];", + " p[i] = p[r];", + " p[r] = aux;", + " }", + " return p;", + "}", + "function alea(seed) {", + " let s0 = 0;", + " let s1 = 0;", + " let s2 = 0;", + " let c = 1;", + " const mash = masher();", + " s0 = mash(' ');", + " s1 = mash(' ');", + " s2 = mash(' ');", + " s0 -= mash(seed);", + " if (s0 < 0) {", + " s0 += 1;", + " }", + " s1 -= mash(seed);", + " if (s1 < 0) {", + " s1 += 1;", + " }", + " s2 -= mash(seed);", + " if (s2 < 0) {", + " s2 += 1;", + " }", + " return function () {", + " const t = 2091639 * s0 + c * 2.3283064365386963e-10;", + " s0 = s1;", + " s1 = s2;", + " return s2 = t - (c = t | 0);", + " };", + "}", + "function masher() {", + " let n = 0xefc8249d;", + " return function (data) {", + " data = data.toString();", + " for (let i = 0; i < data.length; i++) {", + " n += data.charCodeAt(i);", + " let h = 0.02519603282416938 * n;", + " n = h >>> 0;", + " h -= n;", + " h *= n;", + " n = h >>> 0;", + " h -= n;", + " n += h * 0x100000000;", + " }", + " return (n >>> 0) * 2.3283064365386963e-10;", + " };", + "}", + "", + "class TurbulenceField {", + " constructor(scale, octaves, velocityMultiplier, timeScale) {", + " this.scale = scale;", + " this.octaves = octaves;", + " this.velocityMultiplier = velocityMultiplier;", + " this.timeScale = timeScale;", + " this.type = 'TurbulenceField';", + " this.generator = new SimplexNoise();", + " this.timeOffset = new THREE.Vector3();", + " this.temp = new THREE.Vector3();", + " this.temp2 = new THREE.Vector3();", + " this.timeOffset.x = Math.random() / this.scale.x * this.timeScale.x;", + " this.timeOffset.y = Math.random() / this.scale.y * this.timeScale.y;", + " this.timeOffset.z = Math.random() / this.scale.z * this.timeScale.z;", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " const x = particle.position.x / this.scale.x;", + " const y = particle.position.y / this.scale.y;", + " const z = particle.position.z / this.scale.z;", + " this.temp.set(0, 0, 0);", + " let lvl = 1;", + " for (let i = 0; i < this.octaves; i++) {", + " this.temp2.set(this.generator.noise4D(x * lvl, y * lvl, z * lvl, this.timeOffset.x * lvl) / lvl, this.generator.noise4D(x * lvl, y * lvl, z * lvl, this.timeOffset.y * lvl) / lvl, this.generator.noise4D(x * lvl, y * lvl, z * lvl, this.timeOffset.z * lvl) / lvl);", + " this.temp.add(this.temp2);", + " lvl *= 2;", + " }", + " this.temp.multiply(this.velocityMultiplier);", + " particle.velocity.addScaledVector(this.temp, delta);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " scale: [this.scale.x, this.scale.y, this.scale.z],", + " octaves: this.octaves,", + " velocityMultiplier: [this.velocityMultiplier.x, this.velocityMultiplier.y, this.velocityMultiplier.z],", + " timeScale: [this.timeScale.x, this.timeScale.y, this.timeScale.z],", + " };", + " }", + " frameUpdate(delta) {", + " this.timeOffset.x += delta * this.timeScale.x;", + " this.timeOffset.y += delta * this.timeScale.y;", + " this.timeOffset.z += delta * this.timeScale.z;", + " }", + " static fromJSON(json) {", + " return new TurbulenceField(new THREE.Vector3(json.scale[0], json.scale[1], json.scale[2]), json.octaves, new THREE.Vector3(json.velocityMultiplier[0], json.velocityMultiplier[1], json.velocityMultiplier[2]), new THREE.Vector3(json.timeScale[0], json.timeScale[1], json.timeScale[2]));", + " }", + " clone() {", + " return new TurbulenceField(this.scale.clone(), this.octaves, this.velocityMultiplier.clone(), this.timeScale.clone());", + " }", + " reset() {", + " }", + "}", + "", + "function randomInt(a, b) {", + " return Math.floor(Math.random() * (b - a)) + a;", + "}", + "", + "const generators = [];", + "const tempV$2 = new THREE.Vector3();", + "const tempQ$2 = new THREE.Quaternion();", + "class Noise {", + " constructor(frequency, power, positionAmount = new ConstantValue(1), rotationAmount = new ConstantValue(0)) {", + " this.frequency = frequency;", + " this.power = power;", + " this.positionAmount = positionAmount;", + " this.rotationAmount = rotationAmount;", + " this.type = 'Noise';", + " this.duration = 0;", + " if (generators.length === 0) {", + " for (let i = 0; i < 100; i++) {", + " generators.push(new SimplexNoise());", + " }", + " }", + " }", + " initialize(particle) {", + " particle.lastPosNoise = new THREE.Vector3();", + " if (typeof particle.rotation === 'number') {", + " particle.lastRotNoise = 0;", + " }", + " else {", + " particle.lastRotNoise = new THREE.Quaternion();", + " }", + " particle.generatorIndex = [randomInt(0, 100), randomInt(0, 100), randomInt(0, 100), randomInt(0, 100)];", + " }", + " update(particle, _) {", + " let frequency = this.frequency.genValue(particle.age / particle.life);", + " let power = this.power.genValue(particle.age / particle.life);", + " let positionAmount = this.positionAmount.genValue(particle.age / particle.life);", + " let rotationAmount = this.rotationAmount.genValue(particle.age / particle.life);", + " if (positionAmount > 0 && particle.lastPosNoise !== undefined) {", + " particle.position.sub(particle.lastPosNoise);", + " tempV$2.set(generators[particle.generatorIndex[0]].noise2D(0, particle.age * frequency) *", + " power *", + " positionAmount, generators[particle.generatorIndex[1]].noise2D(0, particle.age * frequency) *", + " power *", + " positionAmount, generators[particle.generatorIndex[2]].noise2D(0, particle.age * frequency) *", + " power *", + " positionAmount);", + " particle.position.add(tempV$2);", + " particle.lastPosNoise.copy(tempV$2);", + " }", + " if (rotationAmount > 0 && particle.lastRotNoise !== undefined) {", + " if (typeof particle.rotation === 'number') {", + " particle.rotation -= particle.lastRotNoise;", + " particle.rotation +=", + " generators[particle.generatorIndex[3]].noise2D(0, particle.age * frequency) *", + " Math.PI *", + " power *", + " rotationAmount;", + " }", + " else {", + " particle.lastRotNoise.invert();", + " particle.rotation.multiply(particle.lastRotNoise);", + " tempQ$2", + " .set(generators[particle.generatorIndex[0]].noise2D(0, particle.age * frequency) *", + " power *", + " rotationAmount, generators[particle.generatorIndex[1]].noise2D(0, particle.age * frequency) *", + " power *", + " rotationAmount, generators[particle.generatorIndex[2]].noise2D(0, particle.age * frequency) *", + " power *", + " rotationAmount, generators[particle.generatorIndex[3]].noise2D(0, particle.age * frequency) *", + " power *", + " rotationAmount)", + " .normalize();", + " particle.rotation.multiply(tempQ$2);", + " particle.lastRotNoise.copy(tempQ$2);", + " }", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " frequency: this.frequency.toJSON(),", + " power: this.power.toJSON(),", + " positionAmount: this.positionAmount.toJSON(),", + " rotationAmount: this.rotationAmount.toJSON(),", + " };", + " }", + " frameUpdate(delta) {", + " this.duration += delta;", + " }", + " static fromJSON(json) {", + " return new Noise(ValueGeneratorFromJSON(json.frequency), ValueGeneratorFromJSON(json.power), ValueGeneratorFromJSON(json.positionAmount), ValueGeneratorFromJSON(json.rotationAmount));", + " }", + " clone() {", + " return new Noise(this.frequency.clone(), this.power.clone(), this.positionAmount.clone(), this.rotationAmount.clone());", + " }", + " reset() { }", + "}", + "", + "class TextureSequencer {", + " constructor(scaleX = 0, scaleY = 0, position = new THREE.Vector3()) {", + " this.scaleX = scaleX;", + " this.scaleY = scaleY;", + " this.position = position;", + " this.locations = [];", + " }", + " transform(position, index) {", + " position.x = this.locations[index % this.locations.length].x * this.scaleX + this.position.x;", + " position.y = this.locations[index % this.locations.length].y * this.scaleY + this.position.y;", + " position.z = this.position.z;", + " }", + " static fromJSON(json) {", + " const textureSequencer = new TextureSequencer(json.scaleX, json.scaleY, new THREE.Vector3(json.position[0], json.position[1], json.position[2]));", + " textureSequencer.locations = json.locations.map((loc) => new THREE.Vector2(loc.x, loc.y));", + " return textureSequencer;", + " }", + " clone() {", + " const textureSequencer = new TextureSequencer(this.scaleX, this.scaleY, this.position.clone());", + " textureSequencer.locations = this.locations.map(loc => loc.clone());", + " return textureSequencer;", + " }", + " toJSON() {", + " return {", + " scaleX: this.scaleX,", + " scaleY: this.scaleY,", + " position: this.position,", + " locations: this.locations.map(loc => ({", + " x: loc.x,", + " y: loc.y,", + " }))", + " };", + " }", + " fromImage(img, threshold) {", + " const canvas = document.createElement(\"canvas\");", + " canvas.width = img.width;", + " canvas.height = img.height;", + " const ctx = canvas.getContext(\"2d\");", + " if (!ctx) {", + " return;", + " }", + " ctx.drawImage(img, 0, 0);", + " const data = ctx.getImageData(0, 0, canvas.width, canvas.height, { colorSpace: \"srgb\" });", + " canvas.remove();", + " this.locations.length = 0;", + " for (let i = 0; i < data.height; i++) {", + " for (let j = 0; j < data.width; j++) {", + " if (data.data[(i * data.width + j) * 4 + 3] > threshold) {", + " this.locations.push(new THREE.Vector2(j, data.height - i));", + " }", + " }", + " }", + " }", + "}", + "", + "function SequencerFromJSON(json) {", + " switch (json.type) {", + " case 'TextureSequencer':", + " return TextureSequencer.fromJSON(json);", + " default:", + " return new TextureSequencer();", + " }", + "}", + "", + "class ApplySequences {", + " constructor(delayBetweenParticles) {", + " this.type = 'ApplySequences';", + " this.sequencers = [];", + " this.time = 0;", + " this.index = 0;", + " this.pCount = 0;", + " this.tempV = new THREE.Vector3();", + " this.delay = delayBetweenParticles;", + " }", + " initialize(particle) {", + " particle.id = this.pCount;", + " particle.dst = new THREE.Vector3();", + " particle.begin = new THREE.Vector3();", + " particle.inMotion = false;", + " this.pCount++;", + " }", + " reset() {", + " this.time = 0;", + " this.index = 0;", + " this.pCount = 0;", + " }", + " update(particle, delta) {", + " const sequencer = this.sequencers[this.index];", + " const delay = particle.id * this.delay;", + " if (this.time >= sequencer[0].a + delay && this.time <= sequencer[0].b + delay) {", + " if (!particle.inMotion) {", + " particle.inMotion = true;", + " particle.begin.copy(particle.position);", + " sequencer[1].transform(particle.dst, particle.id);", + " }", + " particle.position.lerpVectors(particle.begin, particle.dst, ApplySequences.BEZIER.genValue((this.time - sequencer[0].a - delay) / (sequencer[0].b - sequencer[0].a)));", + " }", + " else if (this.time > sequencer[0].b + delay) {", + " particle.inMotion = false;", + " }", + " }", + " frameUpdate(delta) {", + " while (this.index + 1 < this.sequencers.length && this.time >= this.sequencers[this.index + 1][0].a) {", + " this.index++;", + " }", + " this.time += delta;", + " }", + " appendSequencer(range, sequencer) {", + " this.sequencers.push([range, sequencer]);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " delay: this.delay,", + " sequencers: this.sequencers.map(([range, sequencer]) => ({", + " range: range.toJSON(),", + " sequencer: sequencer.toJSON(),", + " })),", + " };", + " }", + " static fromJSON(json) {", + " const seq = new ApplySequences(json.delay);", + " json.sequencers.forEach((sequencerJson) => {", + " seq.sequencers.push([ValueGeneratorFromJSON(sequencerJson.range), SequencerFromJSON(sequencerJson.sequencer)]);", + " });", + " return seq;", + " }", + " clone() {", + " const applySequences = new ApplySequences(this.delay);", + " applySequences.sequencers = this.sequencers.map(seq => [seq[0].clone(), seq[1].clone()]);", + " return applySequences;", + " }", + "}", + "ApplySequences.BEZIER = new Bezier(0, 0, 1, 1);", + "", + "let physicsResolver;", + "function setPhysicsResolver(resolver) {", + " physicsResolver = resolver;", + "}", + "function getPhysicsResolver() {", + " return physicsResolver;", + "}", + "class ApplyCollision {", + " constructor(resolver, bounce) {", + " this.resolver = resolver;", + " this.bounce = bounce;", + " this.type = 'ApplyCollision';", + " this.tempV = new THREE.Vector3();", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " if (this.resolver.resolve(particle.position, this.tempV)) {", + " particle.velocity.reflect(this.tempV).multiplyScalar(this.bounce);", + " }", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " bounce: this.bounce,", + " };", + " }", + " static fromJSON(json) {", + " return new ApplyCollision(getPhysicsResolver(), json.bounce);", + " }", + " clone() {", + " return new ApplyCollision(this.resolver, this.bounce);", + " }", + " reset() {", + " }", + "}", + "", + "class ColorBySpeed {", + " constructor(color, speedRange) {", + " this.color = color;", + " this.speedRange = speedRange;", + " this.type = 'ColorBySpeed';", + " }", + " initialize(particle) {", + " if (this.color.type === 'memorizedFunction') {", + " particle.colorOverLifeMemory = {};", + " this.color.startGen(particle.colorOverLifeMemory);", + " }", + " }", + " update(particle, delta) {", + " const t = (particle.startSpeed - this.speedRange.a) / (this.speedRange.b - this.speedRange.a);", + " if (this.color.type === 'memorizedFunction') {", + " this.color.genColor(particle.color, t, particle.colorOverLifeMemory);", + " }", + " else {", + " this.color.genColor(particle.color, t);", + " }", + " particle.color.x *= particle.startColor.x;", + " particle.color.y *= particle.startColor.y;", + " particle.color.z *= particle.startColor.z;", + " particle.color.w *= particle.startColor.w;", + " }", + " frameUpdate(delta) { }", + " toJSON() {", + " return {", + " type: this.type,", + " color: this.color.toJSON(),", + " speedRange: this.speedRange.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new ColorBySpeed(ColorGeneratorFromJSON(json.color), IntervalValue.fromJSON(json.speedRange));", + " }", + " clone() {", + " return new ColorBySpeed(this.color.clone(), this.speedRange.clone());", + " }", + " reset() { }", + "}", + "", + "class SizeBySpeed {", + " initialize(particle) { }", + " constructor(size, speedRange) {", + " this.size = size;", + " this.speedRange = speedRange;", + " this.type = 'SizeBySpeed';", + " }", + " update(particle) {", + " const t = (particle.startSpeed - this.speedRange.a) / (this.speedRange.b - this.speedRange.a);", + " particle.size = particle.startSize * this.size.genValue(t);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " size: this.size.toJSON(),", + " speedRange: this.speedRange.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new SizeBySpeed(ValueGeneratorFromJSON(json.size), IntervalValue.fromJSON(json.speedRange));", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new SizeBySpeed(this.size.clone(), this.speedRange.clone());", + " }", + " reset() { }", + "}", + "", + "class RotationBySpeed {", + " constructor(angularVelocity, speedRange) {", + " this.angularVelocity = angularVelocity;", + " this.speedRange = speedRange;", + " this.type = 'RotationBySpeed';", + " this.tempQuat = new THREE.Quaternion();", + " }", + " initialize(particle) { }", + " update(particle, delta) {", + " const t = (particle.startSpeed - this.speedRange.a) / (this.speedRange.b - this.speedRange.a);", + " particle.rotation += delta * this.angularVelocity.genValue(t);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " angularVelocity: this.angularVelocity.toJSON(),", + " speedRange: this.speedRange.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new RotationBySpeed(ValueGeneratorFromJSON(json.angularVelocity), IntervalValue.fromJSON(json.speedRange));", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new RotationBySpeed(this.angularVelocity.clone(), this.speedRange.clone());", + " }", + " reset() { }", + "}", + "", + "class LimitSpeedOverLife {", + " initialize(particle) { }", + " constructor(speed, dampen) {", + " this.speed = speed;", + " this.dampen = dampen;", + " this.type = 'LimitSpeedOverLife';", + " }", + " update(particle, delta) {", + " let speed = particle.velocity.length();", + " let limit = this.speed.genValue(particle.age / particle.life);", + " if (speed > limit) {", + " const percent = (speed - limit) / speed;", + " particle.velocity.multiplyScalar(1 - percent * this.dampen * delta * 20);", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " speed: this.speed.toJSON(),", + " dampen: this.dampen,", + " };", + " }", + " static fromJSON(json) {", + " return new LimitSpeedOverLife(ValueGeneratorFromJSON(json.speed), json.dampen);", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new LimitSpeedOverLife(this.speed.clone(), this.dampen);", + " }", + " reset() { }", + "}", + "", + "const BehaviorTypes = {", + " ApplyForce: {", + " type: 'ApplyForce',", + " constructor: ApplyForce,", + " params: [", + " ['direction', 'vec3'],", + " ['magnitude', 'value'],", + " ],", + " loadJSON: ApplyForce.fromJSON,", + " },", + " Noise: {", + " type: 'Noise',", + " constructor: Noise,", + " params: [", + " ['frequency', 'value'],", + " ['power', 'value'],", + " ['positionAmount', 'value'],", + " ['rotationAmount', 'value'],", + " ],", + " loadJSON: Noise.fromJSON,", + " },", + " TurbulenceField: {", + " type: 'TurbulenceField',", + " constructor: TurbulenceField,", + " params: [", + " ['scale', 'vec3'],", + " ['octaves', 'number'],", + " ['velocityMultiplier', 'vec3'],", + " ['timeScale', 'vec3'],", + " ],", + " loadJSON: TurbulenceField.fromJSON,", + " },", + " GravityForce: {", + " type: 'GravityForce',", + " constructor: GravityForce,", + " params: [", + " ['center', 'vec3'],", + " ['magnitude', 'number'],", + " ],", + " loadJSON: GravityForce.fromJSON,", + " },", + " ColorOverLife: {", + " type: 'ColorOverLife',", + " constructor: ColorOverLife,", + " params: [['color', 'colorFunc']],", + " loadJSON: ColorOverLife.fromJSON,", + " },", + " RotationOverLife: {", + " type: 'RotationOverLife',", + " constructor: RotationOverLife,", + " params: [['angularVelocity', 'valueFunc']],", + " loadJSON: RotationOverLife.fromJSON,", + " },", + " Rotation3DOverLife: {", + " type: 'Rotation3DOverLife',", + " constructor: Rotation3DOverLife,", + " params: [['angularVelocity', 'rotationFunc']],", + " loadJSON: Rotation3DOverLife.fromJSON,", + " },", + " SizeOverLife: {", + " type: 'SizeOverLife',", + " constructor: SizeOverLife,", + " params: [['size', 'valueFunc']],", + " loadJSON: SizeOverLife.fromJSON,", + " },", + " ColorBySpeed: {", + " type: 'ColorBySpeed',", + " constructor: ColorBySpeed,", + " params: [", + " ['color', 'colorFunc'],", + " ['speedRange', 'range'],", + " ],", + " loadJSON: ColorBySpeed.fromJSON,", + " },", + " RotationBySpeed: {", + " type: 'RotationBySpeed',", + " constructor: RotationBySpeed,", + " params: [", + " ['angularVelocity', 'valueFunc'],", + " ['speedRange', 'range'],", + " ],", + " loadJSON: RotationBySpeed.fromJSON,", + " },", + " SizeBySpeed: {", + " type: 'SizeBySpeed',", + " constructor: SizeBySpeed,", + " params: [", + " ['size', 'valueFunc'],", + " ['speedRange', 'range'],", + " ],", + " loadJSON: SizeBySpeed.fromJSON,", + " },", + " SpeedOverLife: {", + " type: 'SpeedOverLife',", + " constructor: SpeedOverLife,", + " params: [['speed', 'valueFunc']],", + " loadJSON: SpeedOverLife.fromJSON,", + " },", + " FrameOverLife: {", + " type: 'FrameOverLife',", + " constructor: FrameOverLife,", + " params: [['frame', 'valueFunc']],", + " loadJSON: FrameOverLife.fromJSON,", + " },", + " ForceOverLife: {", + " type: 'ForceOverLife',", + " constructor: ForceOverLife,", + " params: [", + " ['x', 'valueFunc'],", + " ['y', 'valueFunc'],", + " ['z', 'valueFunc'],", + " ],", + " loadJSON: ForceOverLife.fromJSON,", + " },", + " OrbitOverLife: {", + " type: 'OrbitOverLife',", + " constructor: OrbitOverLife,", + " params: [", + " ['orbitSpeed', 'valueFunc'],", + " ['axis', 'vec3'],", + " ],", + " loadJSON: OrbitOverLife.fromJSON,", + " },", + " WidthOverLength: {", + " type: 'WidthOverLength',", + " constructor: WidthOverLength,", + " params: [['width', 'valueFunc']],", + " loadJSON: WidthOverLength.fromJSON,", + " },", + " ChangeEmitDirection: {", + " type: 'ChangeEmitDirection',", + " constructor: ChangeEmitDirection,", + " params: [['angle', 'value']],", + " loadJSON: ChangeEmitDirection.fromJSON,", + " },", + " EmitSubParticleSystem: {", + " type: 'EmitSubParticleSystem',", + " constructor: EmitSubParticleSystem,", + " params: [", + " ['particleSystem', 'self'],", + " ['useVelocityAsBasis', 'boolean'],", + " ['subParticleSystem', 'particleSystem'],", + " ['mode', 'number'],", + " ['emitProbability', 'number'],", + " ],", + " loadJSON: EmitSubParticleSystem.fromJSON,", + " },", + " LimitSpeedOverLife: {", + " type: 'LimitSpeedOverLife',", + " constructor: LimitSpeedOverLife,", + " params: [", + " ['speed', 'valueFunc'],", + " ['dampen', 'number'],", + " ],", + " loadJSON: LimitSpeedOverLife.fromJSON,", + " },", + "};", + "function BehaviorFromJSON(json, particleSystem) {", + " return BehaviorTypes[json.type].loadJSON(json, particleSystem);", + "}", + "", + "let EmitterMode = void 0;", + "(function (EmitterMode) {", + " EmitterMode[EmitterMode[\"Random\"] = 0] = \"Random\";", + " EmitterMode[EmitterMode[\"Loop\"] = 1] = \"Loop\";", + " EmitterMode[EmitterMode[\"PingPong\"] = 2] = \"PingPong\";", + " EmitterMode[EmitterMode[\"Burst\"] = 3] = \"Burst\";", + "})(EmitterMode || (EmitterMode = {}));", + "function getValueFromEmitterMode(mode, currentValue, spread) {", + " let u;", + " if (EmitterMode.Random === mode) {", + " currentValue = Math.random();", + " }", + " if (spread > 0) {", + " u = Math.floor(currentValue / spread) * spread;", + " }", + " else {", + " u = currentValue;", + " }", + " switch (mode) {", + " case EmitterMode.Loop:", + " u = u % 1;", + " break;", + " case EmitterMode.PingPong:", + " u = Math.abs((u % 2) - 1);", + " break;", + " }", + " return u;", + "}", + "", + "class ConeEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d, _e, _f, _g;", + " this.type = 'cone';", + " this.currentValue = 0;", + " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", + " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", + " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", + " this.angle = (_d = parameters.angle) !== null && _d !== void 0 ? _d : Math.PI / 6;", + " this.mode = (_e = parameters.mode) !== null && _e !== void 0 ? _e : EmitterMode.Random;", + " this.spread = (_f = parameters.spread) !== null && _f !== void 0 ? _f : 0;", + " this.speed = (_g = parameters.speed) !== null && _g !== void 0 ? _g : new ConstantValue(1);", + " }", + " update(system, delta) {", + " if (EmitterMode.Random != this.mode) {", + " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", + " }", + " }", + " initialize(p) {", + " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", + " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", + " const theta = u * this.arc;", + " const r = Math.sqrt(rand);", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " p.position.x = r * cosTheta;", + " p.position.y = r * sinTheta;", + " p.position.z = 0;", + " const angle = this.angle * r;", + " p.velocity.set(0, 0, Math.cos(angle)).addScaledVector(p.position, Math.sin(angle)).multiplyScalar(p.startSpeed);", + " p.position.multiplyScalar(this.radius);", + " }", + " toJSON() {", + " return {", + " type: 'cone',", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " angle: this.angle,", + " mode: this.mode,", + " spread: this.spread,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new ConeEmitter({", + " radius: json.radius,", + " arc: json.arc,", + " thickness: json.thickness,", + " angle: json.angle,", + " mode: json.mode,", + " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", + " spread: json.spread,", + " });", + " }", + " clone() {", + " return new ConeEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " angle: this.angle,", + " mode: this.mode,", + " speed: this.speed.clone(),", + " spread: this.spread,", + " });", + " }", + "}", + "", + "class CircleEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d, _e, _f;", + " this.type = 'circle';", + " this.currentValue = 0;", + " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", + " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", + " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", + " this.mode = (_d = parameters.mode) !== null && _d !== void 0 ? _d : EmitterMode.Random;", + " this.spread = (_e = parameters.spread) !== null && _e !== void 0 ? _e : 0;", + " this.speed = (_f = parameters.speed) !== null && _f !== void 0 ? _f : new ConstantValue(1);", + " }", + " update(system, delta) {", + " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", + " }", + " initialize(p) {", + " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", + " const r = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", + " const theta = u * this.arc;", + " p.position.x = Math.cos(theta);", + " p.position.y = Math.sin(theta);", + " p.position.z = 0;", + " p.velocity.copy(p.position).multiplyScalar(p.startSpeed);", + " p.position.multiplyScalar(this.radius * r);", + " }", + " toJSON() {", + " return {", + " type: 'circle',", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " spread: this.spread,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new CircleEmitter({", + " radius: json.radius,", + " arc: json.arc,", + " thickness: json.thickness,", + " mode: json.mode,", + " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", + " spread: json.spread,", + " });", + " }", + " clone() {", + " return new CircleEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " speed: this.speed.clone(),", + " spread: this.spread,", + " });", + " }", + "}", + "", + "class DonutEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d, _e, _f, _g;", + " this.type = 'donut';", + " this.currentValue = 0;", + " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", + " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", + " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", + " this.donutRadius = (_d = parameters.donutRadius) !== null && _d !== void 0 ? _d : this.radius * 0.2;", + " this.mode = (_e = parameters.mode) !== null && _e !== void 0 ? _e : EmitterMode.Random;", + " this.spread = (_f = parameters.spread) !== null && _f !== void 0 ? _f : 0;", + " this.speed = (_g = parameters.speed) !== null && _g !== void 0 ? _g : new ConstantValue(1);", + " }", + " update(system, delta) {", + " if (EmitterMode.Random != this.mode) {", + " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", + " }", + " }", + " initialize(p) {", + " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", + " const v = Math.random();", + " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", + " const theta = u * this.arc;", + " const phi = v * Math.PI * 2;", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " p.position.x = this.radius * cosTheta;", + " p.position.y = this.radius * sinTheta;", + " p.position.z = 0;", + " p.velocity.z = this.donutRadius * rand * Math.sin(phi);", + " p.velocity.x = this.donutRadius * rand * Math.cos(phi) * cosTheta;", + " p.velocity.y = this.donutRadius * rand * Math.cos(phi) * sinTheta;", + " p.position.add(p.velocity);", + " p.velocity.normalize().multiplyScalar(p.startSpeed);", + " }", + " toJSON() {", + " return {", + " type: 'donut',", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " donutRadius: this.donutRadius,", + " mode: this.mode,", + " spread: this.spread,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new DonutEmitter({", + " radius: json.radius,", + " arc: json.arc,", + " thickness: json.thickness,", + " donutRadius: json.donutRadius,", + " mode: json.mode,", + " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", + " spread: json.spread,", + " });", + " }", + " clone() {", + " return new DonutEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " donutRadius: this.donutRadius,", + " mode: this.mode,", + " speed: this.speed.clone(),", + " spread: this.spread,", + " });", + " }", + "}", + "", + "class PointEmitter {", + " constructor() {", + " this.type = 'point';", + " }", + " update(system, delta) { }", + " initialize(p) {", + " const u = Math.random();", + " const v = Math.random();", + " const theta = u * Math.PI * 2;", + " const phi = Math.acos(2.0 * v - 1.0);", + " const r = Math.cbrt(Math.random());", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " const sinPhi = Math.sin(phi);", + " const cosPhi = Math.cos(phi);", + " p.velocity.x = r * sinPhi * cosTheta;", + " p.velocity.y = r * sinPhi * sinTheta;", + " p.velocity.z = r * cosPhi;", + " p.velocity.multiplyScalar(p.startSpeed);", + " p.position.setScalar(0);", + " }", + " toJSON() {", + " return {", + " type: 'point',", + " };", + " }", + " static fromJSON(json) {", + " return new PointEmitter();", + " }", + " clone() {", + " return new PointEmitter();", + " }", + "}", + "", + "class SphereEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d, _e, _f;", + " this.type = 'sphere';", + " this.currentValue = 0;", + " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", + " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", + " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", + " this.mode = (_d = parameters.mode) !== null && _d !== void 0 ? _d : EmitterMode.Random;", + " this.spread = (_e = parameters.spread) !== null && _e !== void 0 ? _e : 0;", + " this.speed = (_f = parameters.speed) !== null && _f !== void 0 ? _f : new ConstantValue(1);", + " }", + " update(system, delta) {", + " if (EmitterMode.Random != this.mode) {", + " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", + " }", + " }", + " initialize(p) {", + " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", + " const v = Math.random();", + " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", + " const theta = u * this.arc;", + " const phi = Math.acos(2.0 * v - 1.0);", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " const sinPhi = Math.sin(phi);", + " const cosPhi = Math.cos(phi);", + " p.position.x = sinPhi * cosTheta;", + " p.position.y = sinPhi * sinTheta;", + " p.position.z = cosPhi;", + " p.velocity.copy(p.position).multiplyScalar(p.startSpeed);", + " p.position.multiplyScalar(this.radius * rand);", + " }", + " toJSON() {", + " return {", + " type: 'sphere',", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " spread: this.spread,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new SphereEmitter({", + " radius: json.radius,", + " arc: json.arc,", + " thickness: json.thickness,", + " mode: json.mode,", + " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", + " spread: json.spread,", + " });", + " }", + " clone() {", + " return new SphereEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " speed: this.speed.clone(),", + " spread: this.spread,", + " });", + " }", + "}", + "", + "class HemisphereEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d, _e, _f;", + " this.type = 'sphere';", + " this.currentValue = 0;", + " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", + " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", + " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", + " this.mode = (_d = parameters.mode) !== null && _d !== void 0 ? _d : EmitterMode.Random;", + " this.spread = (_e = parameters.spread) !== null && _e !== void 0 ? _e : 0;", + " this.speed = (_f = parameters.speed) !== null && _f !== void 0 ? _f : new ConstantValue(1);", + " }", + " update(system, delta) {", + " if (EmitterMode.Random != this.mode) {", + " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", + " }", + " }", + " initialize(p) {", + " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", + " const v = Math.random();", + " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", + " const theta = u * this.arc;", + " const phi = Math.acos(v);", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " const sinPhi = Math.sin(phi);", + " const cosPhi = Math.cos(phi);", + " p.position.x = sinPhi * cosTheta;", + " p.position.y = sinPhi * sinTheta;", + " p.position.z = cosPhi;", + " p.velocity.copy(p.position).multiplyScalar(p.startSpeed);", + " p.position.multiplyScalar(this.radius * rand);", + " }", + " toJSON() {", + " return {", + " type: 'hemisphere',", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " spread: this.spread,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new HemisphereEmitter({", + " radius: json.radius,", + " arc: json.arc,", + " thickness: json.thickness,", + " mode: json.mode,", + " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", + " spread: json.spread,", + " });", + " }", + " clone() {", + " return new HemisphereEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " speed: this.speed.clone(),", + " spread: this.spread,", + " });", + " }", + "}", + "", + "class GridEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d;", + " this.type = 'grid';", + " this.width = (_a = parameters.width) !== null && _a !== void 0 ? _a : 1;", + " this.height = (_b = parameters.height) !== null && _b !== void 0 ? _b : 1;", + " this.column = (_c = parameters.column) !== null && _c !== void 0 ? _c : 10;", + " this.row = (_d = parameters.row) !== null && _d !== void 0 ? _d : 10;", + " }", + " initialize(p) {", + " const r = Math.floor(Math.random() * this.row);", + " const c = Math.floor(Math.random() * this.column);", + " p.position.x = (c * this.width) / this.column - this.width / 2;", + " p.position.y = (r * this.height) / this.row - this.height / 2;", + " p.position.z = 0;", + " p.velocity.set(0, 0, p.startSpeed);", + " }", + " toJSON() {", + " return {", + " type: 'grid',", + " width: this.width,", + " height: this.height,", + " column: this.column,", + " row: this.row,", + " };", + " }", + " static fromJSON(json) {", + " return new GridEmitter(json);", + " }", + " clone() {", + " return new GridEmitter({", + " width: this.width,", + " height: this.height,", + " column: this.column,", + " row: this.row,", + " });", + " }", + " update(system, delta) { }", + "}", + "", + "class MeshSurfaceEmitter {", + " get geometry() {", + " return this._geometry;", + " }", + " set geometry(geometry) {", + " this._geometry = geometry;", + " if (geometry === undefined) {", + " return;", + " }", + " if (typeof geometry === 'string') {", + " return;", + " }", + " const tri = new THREE.Triangle();", + " this._triangleIndexToArea.length = 0;", + " let area = 0;", + " if (!geometry.getIndex()) {", + " return;", + " }", + " const array = geometry.getIndex().array;", + " const triCount = array.length / 3;", + " this._triangleIndexToArea.push(0);", + " for (let i = 0; i < triCount; i++) {", + " tri.setFromAttributeAndIndices(geometry.getAttribute('position'), array[i * 3], array[i * 3 + 1], array[i * 3 + 2]);", + " area += tri.getArea();", + " this._triangleIndexToArea.push(area);", + " }", + " geometry.userData.triangleIndexToArea = this._triangleIndexToArea;", + " }", + " constructor(geometry) {", + " this.type = 'mesh_surface';", + " this._triangleIndexToArea = [];", + " this._tempA = new THREE.Vector3();", + " this._tempB = new THREE.Vector3();", + " this._tempC = new THREE.Vector3();", + " if (!geometry) {", + " return;", + " }", + " this.geometry = geometry;", + " }", + " initialize(p) {", + " const geometry = this._geometry;", + " if (!geometry || geometry.getIndex() === null) {", + " p.position.set(0, 0, 0);", + " p.velocity.set(0, 0, 1).multiplyScalar(p.startSpeed);", + " return;", + " }", + " const triCount = this._triangleIndexToArea.length - 1;", + " let left = 0, right = triCount;", + " const target = Math.random() * this._triangleIndexToArea[triCount];", + " while (left + 1 < right) {", + " const mid = Math.floor((left + right) / 2);", + " if (target < this._triangleIndexToArea[mid]) {", + " right = mid;", + " }", + " else {", + " left = mid;", + " }", + " }", + " let u1 = Math.random();", + " let u2 = Math.random();", + " if (u1 + u2 > 1) {", + " u1 = 1 - u1;", + " u2 = 1 - u2;", + " }", + " const index1 = geometry.getIndex().array[left * 3];", + " const index2 = geometry.getIndex().array[left * 3 + 1];", + " const index3 = geometry.getIndex().array[left * 3 + 2];", + " const positionBuffer = geometry.getAttribute('position');", + " this._tempA.fromBufferAttribute(positionBuffer, index1);", + " this._tempB.fromBufferAttribute(positionBuffer, index2);", + " this._tempC.fromBufferAttribute(positionBuffer, index3);", + " this._tempB.sub(this._tempA);", + " this._tempC.sub(this._tempA);", + " this._tempA.addScaledVector(this._tempB, u1).addScaledVector(this._tempC, u2);", + " p.position.copy(this._tempA);", + " this._tempA.copy(this._tempB).cross(this._tempC).normalize();", + " p.velocity.copy(this._tempA).normalize().multiplyScalar(p.startSpeed);", + " }", + " toJSON() {", + " return {", + " type: 'mesh_surface',", + " mesh: this._geometry ? this._geometry.uuid : '',", + " };", + " }", + " static fromJSON(json, meta) {", + " return new MeshSurfaceEmitter(meta.geometries[json.geometry]);", + " }", + " clone() {", + " return new MeshSurfaceEmitter(this._geometry);", + " }", + " update(system, delta) { }", + "}", + "", + "const EmitterShapes = {", + " circle: {", + " type: 'circle',", + " params: [", + " ['radius', 'number'],", + " ['arc', 'radian'],", + " ['thickness', 'number'],", + " ['mode', 'emitterMode'],", + " ['spread', 'number'],", + " ['speed', 'valueFunc'],", + " ],", + " constructor: CircleEmitter,", + " loadJSON: CircleEmitter.fromJSON,", + " },", + " cone: {", + " type: 'cone',", + " params: [", + " ['radius', 'number'],", + " ['arc', 'radian'],", + " ['thickness', 'number'],", + " ['angle', 'radian'],", + " ['mode', 'emitterMode'],", + " ['spread', 'number'],", + " ['speed', 'valueFunc'],", + " ],", + " constructor: ConeEmitter,", + " loadJSON: ConeEmitter.fromJSON,", + " },", + " donut: {", + " type: 'donut',", + " params: [", + " ['radius', 'number'],", + " ['arc', 'radian'],", + " ['thickness', 'number'],", + " ['donutRadius', 'number'],", + " ['mode', 'emitterMode'],", + " ['spread', 'number'],", + " ['speed', 'valueFunc'],", + " ],", + " constructor: DonutEmitter,", + " loadJSON: DonutEmitter.fromJSON,", + " },", + " point: { type: 'point', params: [], constructor: PointEmitter, loadJSON: PointEmitter.fromJSON },", + " sphere: {", + " type: 'sphere',", + " params: [", + " ['radius', 'number'],", + " ['arc', 'radian'],", + " ['thickness', 'number'],", + " ['angle', 'radian'],", + " ['mode', 'emitterMode'],", + " ['spread', 'number'],", + " ['speed', 'valueFunc'],", + " ],", + " constructor: SphereEmitter,", + " loadJSON: SphereEmitter.fromJSON,", + " },", + " hemisphere: {", + " type: 'hemisphere',", + " params: [", + " ['radius', 'number'],", + " ['arc', 'radian'],", + " ['thickness', 'number'],", + " ['angle', 'radian'],", + " ['mode', 'emitterMode'],", + " ['spread', 'number'],", + " ['speed', 'valueFunc'],", + " ],", + " constructor: HemisphereEmitter,", + " loadJSON: HemisphereEmitter.fromJSON,", + " },", + " grid: {", + " type: 'grid',", + " params: [", + " ['width', 'number'],", + " ['height', 'number'],", + " ['rows', 'number'],", + " ['column', 'number'],", + " ],", + " constructor: GridEmitter,", + " loadJSON: GridEmitter.fromJSON,", + " },", + " mesh_surface: {", + " type: 'mesh_surface',", + " params: [['geometry', 'geometry']],", + " constructor: MeshSurfaceEmitter,", + " loadJSON: MeshSurfaceEmitter.fromJSON,", + " },", + "};", + "function EmitterFromJSON(json, meta) {", + " return EmitterShapes[json.type].loadJSON(json, meta);", + "}", + "", + "let RenderMode = void 0;", + "(function (RenderMode) {", + " RenderMode[RenderMode[\"BillBoard\"] = 0] = \"BillBoard\";", + " RenderMode[RenderMode[\"StretchedBillBoard\"] = 1] = \"StretchedBillBoard\";", + " RenderMode[RenderMode[\"Mesh\"] = 2] = \"Mesh\";", + " RenderMode[RenderMode[\"Trail\"] = 3] = \"Trail\";", + " RenderMode[RenderMode[\"HorizontalBillBoard\"] = 4] = \"HorizontalBillBoard\";", + " RenderMode[RenderMode[\"VerticalBillBoard\"] = 5] = \"VerticalBillBoard\";", + "})(RenderMode || (RenderMode = {}));", + "class VFXBatch extends THREE.Mesh {", + " constructor(settings) {", + " super();", + " this.type = 'VFXBatch';", + " this.maxParticles = 1000;", + " this.systems = new Set();", + " const layers = new THREE.Layers();", + " layers.mask = settings.layers.mask;", + " const newMat = settings.material.clone();", + " newMat.defines = {};", + " Object.assign(newMat.defines, settings.material.defines);", + " this.settings = {", + " instancingGeometry: settings.instancingGeometry,", + " renderMode: settings.renderMode,", + " renderOrder: settings.renderOrder,", + " material: newMat,", + " uTileCount: settings.uTileCount,", + " vTileCount: settings.vTileCount,", + " layers: layers,", + " };", + " this.frustumCulled = false;", + " this.renderOrder = this.settings.renderOrder;", + " }", + " addSystem(system) {", + " this.systems.add(system);", + " }", + " removeSystem(system) {", + " this.systems.delete(system);", + " }", + "}", + "", + "const UP = new THREE.Vector3(0, 0, 1);", + "const tempQ$1 = new THREE.Quaternion();", + "const tempV$1 = new THREE.Vector3();", + "const tempV2$1 = new THREE.Vector3();", + "new THREE.Vector3();", + "const PREWARM_FPS$1 = 60;", + "const DEFAULT_GEOMETRY$1 = new THREE.PlaneGeometry(1, 1, 1, 1);", + "class ParticleSystem {", + " set time(time) {", + " this.emissionState.time = time;", + " }", + " get time() {", + " return this.emissionState.time;", + " }", + " get layers() {", + " return this.rendererSettings.layers;", + " }", + " get texture() {", + " return this.rendererSettings.material.map;", + " }", + " set texture(texture) {", + " this.rendererSettings.material.map = texture;", + " this.neededToUpdateRender = true;", + " }", + " get material() {", + " return this.rendererSettings.material;", + " }", + " set material(material) {", + " this.rendererSettings.material = material;", + " this.neededToUpdateRender = true;", + " }", + " get uTileCount() {", + " return this.rendererSettings.uTileCount;", + " }", + " set uTileCount(u) {", + " this.rendererSettings.uTileCount = u;", + " this.neededToUpdateRender = true;", + " }", + " get vTileCount() {", + " return this.rendererSettings.vTileCount;", + " }", + " set vTileCount(v) {", + " this.rendererSettings.vTileCount = v;", + " this.neededToUpdateRender = true;", + " }", + " get instancingGeometry() {", + " return this.rendererSettings.instancingGeometry;", + " }", + " set instancingGeometry(geometry) {", + " this.restart();", + " this.particles.length = 0;", + " this.rendererSettings.instancingGeometry = geometry;", + " this.neededToUpdateRender = true;", + " }", + " get renderMode() {", + " return this.rendererSettings.renderMode;", + " }", + " set renderMode(renderMode) {", + " if ((this.rendererSettings.renderMode != RenderMode.Trail && renderMode === RenderMode.Trail) ||", + " (this.rendererSettings.renderMode == RenderMode.Trail && renderMode !== RenderMode.Trail)) {", + " this.restart();", + " this.particles.length = 0;", + " }", + " if (this.rendererSettings.renderMode !== renderMode) {", + " switch (renderMode) {", + " case RenderMode.Trail:", + " this.rendererEmitterSettings = {", + " startLength: new ConstantValue(30),", + " followLocalOrigin: false,", + " };", + " break;", + " case RenderMode.Mesh:", + " this.rendererEmitterSettings = {", + " geometry: new THREE.PlaneGeometry(1, 1),", + " };", + " this.startRotation = new AxisAngleGenerator(new THREE.Vector3(0, 1, 0), new ConstantValue(0));", + " break;", + " case RenderMode.StretchedBillBoard:", + " this.rendererEmitterSettings = { speedFactor: 0, lengthFactor: 2 };", + " if (this.rendererSettings.renderMode === RenderMode.Mesh) {", + " this.startRotation = new ConstantValue(0);", + " }", + " break;", + " case RenderMode.BillBoard:", + " case RenderMode.VerticalBillBoard:", + " case RenderMode.HorizontalBillBoard:", + " this.rendererEmitterSettings = {};", + " if (this.rendererSettings.renderMode === RenderMode.Mesh) {", + " this.startRotation = new ConstantValue(0);", + " }", + " break;", + " }", + " }", + " this.rendererSettings.renderMode = renderMode;", + " this.neededToUpdateRender = true;", + " }", + " get renderOrder() {", + " return this.rendererSettings.renderOrder;", + " }", + " set renderOrder(renderOrder) {", + " this.rendererSettings.renderOrder = renderOrder;", + " this.neededToUpdateRender = true;", + " }", + " get blending() {", + " return this.rendererSettings.material.blending;", + " }", + " set blending(blending) {", + " this.rendererSettings.material.blending = blending;", + " this.neededToUpdateRender = true;", + " }", + " constructor(parameters) {", + " var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;", + " this.temp = new THREE.Vector3();", + " this.travelDistance = 0;", + " this.normalMatrix = new THREE.Matrix3();", + " this.firstTimeUpdate = true;", + " this.autoDestroy = parameters.autoDestroy === undefined ? false : parameters.autoDestroy;", + " this.duration = (_a = parameters.duration) !== null && _a !== void 0 ? _a : 1;", + " this.looping = parameters.looping === undefined ? true : parameters.looping;", + " this.prewarm = parameters.prewarm === undefined ? false : parameters.prewarm;", + " this.startLife = (_b = parameters.startLife) !== null && _b !== void 0 ? _b : new ConstantValue(5);", + " this.startSpeed = (_c = parameters.startSpeed) !== null && _c !== void 0 ? _c : new ConstantValue(0);", + " this.startRotation = (_d = parameters.startRotation) !== null && _d !== void 0 ? _d : new ConstantValue(0);", + " this.startSize = (_e = parameters.startSize) !== null && _e !== void 0 ? _e : new ConstantValue(1);", + " this.startColor = (_f = parameters.startColor) !== null && _f !== void 0 ? _f : new ConstantColor(new THREE.Vector4(1, 1, 1, 1));", + " this.emissionOverTime = (_g = parameters.emissionOverTime) !== null && _g !== void 0 ? _g : new ConstantValue(10);", + " this.emissionOverDistance = (_h = parameters.emissionOverDistance) !== null && _h !== void 0 ? _h : new ConstantValue(0);", + " this.emissionBursts = (_j = parameters.emissionBursts) !== null && _j !== void 0 ? _j : [];", + " this.onlyUsedByOther = (_k = parameters.onlyUsedByOther) !== null && _k !== void 0 ? _k : false;", + " this.emitterShape = (_l = parameters.shape) !== null && _l !== void 0 ? _l : new SphereEmitter();", + " this.behaviors = (_m = parameters.behaviors) !== null && _m !== void 0 ? _m : new Array();", + " this.worldSpace = (_o = parameters.worldSpace) !== null && _o !== void 0 ? _o : false;", + " this.rendererEmitterSettings = (_p = parameters.rendererEmitterSettings) !== null && _p !== void 0 ? _p : {};", + " if (parameters.renderMode === RenderMode.StretchedBillBoard) {", + " const stretchedBillboardSettings = this.rendererEmitterSettings;", + " if (parameters.speedFactor !== undefined) {", + " stretchedBillboardSettings.speedFactor = parameters.speedFactor;", + " }", + " stretchedBillboardSettings.speedFactor = (_q = stretchedBillboardSettings.speedFactor) !== null && _q !== void 0 ? _q : 0;", + " stretchedBillboardSettings.lengthFactor = (_r = stretchedBillboardSettings.lengthFactor) !== null && _r !== void 0 ? _r : 0;", + " }", + " this.rendererSettings = {", + " instancingGeometry: (_s = parameters.instancingGeometry) !== null && _s !== void 0 ? _s : DEFAULT_GEOMETRY$1,", + " renderMode: (_t = parameters.renderMode) !== null && _t !== void 0 ? _t : RenderMode.BillBoard,", + " renderOrder: (_u = parameters.renderOrder) !== null && _u !== void 0 ? _u : 0,", + " material: parameters.material,", + " uTileCount: (_v = parameters.uTileCount) !== null && _v !== void 0 ? _v : 1,", + " vTileCount: (_w = parameters.vTileCount) !== null && _w !== void 0 ? _w : 1,", + " layers: (_x = parameters.layers) !== null && _x !== void 0 ? _x : new THREE.Layers(),", + " };", + " this.neededToUpdateRender = true;", + " this.particles = new Array();", + " this.startTileIndex = parameters.startTileIndex || new ConstantValue(0);", + " this.emitter = new ParticleEmitter(this);", + " this.paused = false;", + " this.particleNum = 0;", + " this.emissionState = {", + " burstIndex: 0,", + " burstWaveIndex: 0,", + " time: 0,", + " waitEmiting: 0,", + " travelDistance: 0,", + " };", + " this.emitEnded = false;", + " this.markForDestroy = false;", + " this.prewarmed = false;", + " }", + " pause() {", + " this.paused = true;", + " }", + " play() {", + " this.paused = false;", + " }", + " spawn(count, emissionState, matrix) {", + " tempQ$1.setFromRotationMatrix(matrix);", + " const translation = tempV$1;", + " const quaternion = tempQ$1;", + " const scale = tempV2$1;", + " matrix.decompose(translation, quaternion, scale);", + " for (let i = 0; i < count; i++) {", + " this.particleNum++;", + " while (this.particles.length < this.particleNum) {", + " if (this.rendererSettings.renderMode === RenderMode.Trail) {", + " this.particles.push(new TrailParticle());", + " }", + " else {", + " this.particles.push(new SpriteParticle());", + " }", + " }", + " const particle = this.particles[this.particleNum - 1];", + " particle.speedModifier = 1;", + " this.startColor.genColor(particle.startColor, this.emissionState.time, {});", + " particle.color.copy(particle.startColor);", + " particle.startSpeed = this.startSpeed.genValue(emissionState.time / this.duration);", + " particle.life = this.startLife.genValue(emissionState.time / this.duration);", + " particle.age = 0;", + " particle.startSize = this.startSize.genValue(emissionState.time / this.duration);", + " particle.uvTile = Math.floor(this.startTileIndex.genValue() + 0.001);", + " particle.size = particle.startSize;", + " if (this.rendererSettings.renderMode === RenderMode.Mesh ||", + " this.rendererSettings.renderMode === RenderMode.BillBoard ||", + " this.rendererSettings.renderMode === RenderMode.VerticalBillBoard ||", + " this.rendererSettings.renderMode === RenderMode.HorizontalBillBoard ||", + " this.rendererSettings.renderMode === RenderMode.StretchedBillBoard) {", + " const sprite = particle;", + " if (this.rendererSettings.renderMode === RenderMode.Mesh) {", + " if (!(sprite.rotation instanceof THREE.Quaternion)) {", + " sprite.rotation = new THREE.Quaternion();", + " }", + " if (this.startRotation.type === 'rotation') {", + " this.startRotation.genValue(sprite.rotation, emissionState.time / this.duration);", + " }", + " else {", + " sprite.rotation.setFromAxisAngle(UP, this.startRotation.genValue((emissionState.time / this.duration)));", + " }", + " }", + " else {", + " if (this.startRotation.type === 'rotation') {", + " sprite.rotation = 0;", + " }", + " else {", + " sprite.rotation = this.startRotation.genValue(emissionState.time / this.duration);", + " }", + " }", + " }", + " else if (this.rendererSettings.renderMode === RenderMode.Trail) {", + " const trail = particle;", + " trail.length = this.rendererEmitterSettings.startLength.genValue(emissionState.time / this.duration);", + " }", + " this.emitterShape.initialize(particle);", + " if (this.rendererSettings.renderMode === RenderMode.Trail &&", + " this.rendererEmitterSettings.followLocalOrigin) {", + " const trail = particle;", + " trail.localPosition = new THREE.Vector3().copy(trail.position);", + " }", + " if (this.worldSpace) {", + " particle.position.applyMatrix4(matrix);", + " particle.startSize =", + " (particle.startSize * (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z))) / 3;", + " particle.size = particle.startSize;", + " particle.velocity.multiply(scale).applyMatrix3(this.normalMatrix);", + " if (particle.rotation && particle.rotation instanceof THREE.Quaternion) {", + " particle.rotation.multiplyQuaternions(tempQ$1, particle.rotation);", + " }", + " }", + " else {", + " if (this.onlyUsedByOther) {", + " particle.parentMatrix = matrix;", + " }", + " }", + " for (let j = 0; j < this.behaviors.length; j++) {", + " this.behaviors[j].initialize(particle);", + " }", + " }", + " }", + " endEmit() {", + " this.emitEnded = true;", + " if (this.autoDestroy) {", + " this.markForDestroy = true;", + " }", + " }", + " dispose() {", + " if (this._renderer)", + " this._renderer.deleteSystem(this);", + " this.emitter.dispose();", + " if (this.emitter.parent)", + " this.emitter.parent.remove(this.emitter);", + " }", + " restart() {", + " this.paused = false;", + " this.particleNum = 0;", + " this.emissionState.burstIndex = 0;", + " this.emissionState.burstWaveIndex = 0;", + " this.emissionState.time = 0;", + " this.emissionState.waitEmiting = 0;", + " this.behaviors.forEach((behavior) => {", + " behavior.reset();", + " });", + " this.emitEnded = false;", + " this.markForDestroy = false;", + " this.prewarmed = false;", + " }", + " update(delta) {", + " if (this.paused)", + " return;", + " let currentParent = this.emitter;", + " while (currentParent.parent) {", + " currentParent = currentParent.parent;", + " }", + " if (currentParent.type !== 'Scene') {", + " this.dispose();", + " return;", + " }", + " if (this.firstTimeUpdate) {", + " this.firstTimeUpdate = false;", + " this.emitter.updateWorldMatrix(true, false);", + " }", + " if (this.emitEnded && this.particleNum === 0) {", + " if (this.markForDestroy && this.emitter.parent)", + " this.dispose();", + " return;", + " }", + " if (this.looping && this.prewarm && !this.prewarmed) {", + " this.prewarmed = true;", + " for (let i = 0; i < this.duration * PREWARM_FPS$1; i++) {", + " this.update(1.0 / PREWARM_FPS$1);", + " }", + " }", + " if (delta > 0.1) {", + " delta = 0.1;", + " }", + " if (this.neededToUpdateRender) {", + " if (this._renderer)", + " this._renderer.updateSystem(this);", + " this.neededToUpdateRender = false;", + " }", + " if (!this.onlyUsedByOther) {", + " this.emit(delta, this.emissionState, this.emitter.matrixWorld);", + " }", + " this.emitterShape.update(this, delta);", + " for (let j = 0; j < this.behaviors.length; j++) {", + " for (let i = 0; i < this.particleNum; i++) {", + " if (!this.particles[i].died) {", + " this.behaviors[j].update(this.particles[i], delta);", + " }", + " }", + " this.behaviors[j].frameUpdate(delta);", + " }", + " for (let i = 0; i < this.particleNum; i++) {", + " if (this.rendererEmitterSettings.followLocalOrigin &&", + " this.particles[i].localPosition) {", + " this.particles[i].position.copy(this.particles[i].localPosition);", + " if (this.particles[i].parentMatrix) {", + " this.particles[i].position.applyMatrix4(this.particles[i].parentMatrix);", + " }", + " else {", + " this.particles[i].position.applyMatrix4(this.emitter.matrixWorld);", + " }", + " }", + " else {", + " this.particles[i].position.addScaledVector(this.particles[i].velocity, delta * this.particles[i].speedModifier);", + " }", + " this.particles[i].age += delta;", + " }", + " if (this.rendererSettings.renderMode === RenderMode.Trail) {", + " for (let i = 0; i < this.particleNum; i++) {", + " const particle = this.particles[i];", + " particle.update();", + " }", + " }", + " for (let i = 0; i < this.particleNum; i++) {", + " const particle = this.particles[i];", + " if (particle.died && (!(particle instanceof TrailParticle) || particle.previous.length === 0)) {", + " this.particles[i] = this.particles[this.particleNum - 1];", + " this.particles[this.particleNum - 1] = particle;", + " this.particleNum--;", + " i--;", + " }", + " }", + " }", + " emit(delta, emissionState, emitterMatrix) {", + " if (emissionState.time > this.duration) {", + " if (this.looping) {", + " emissionState.time -= this.duration;", + " emissionState.burstIndex = 0;", + " this.behaviors.forEach((behavior) => {", + " behavior.reset();", + " });", + " }", + " else {", + " if (!this.emitEnded && !this.onlyUsedByOther) {", + " this.endEmit();", + " }", + " }", + " }", + " this.normalMatrix.getNormalMatrix(emitterMatrix);", + " const totalSpawn = Math.ceil(emissionState.waitEmiting);", + " this.spawn(totalSpawn, emissionState, emitterMatrix);", + " emissionState.waitEmiting -= totalSpawn;", + " while (emissionState.burstIndex < this.emissionBursts.length &&", + " this.emissionBursts[emissionState.burstIndex].time <= emissionState.time) {", + " if (Math.random() < this.emissionBursts[emissionState.burstIndex].probability) {", + " const count = this.emissionBursts[emissionState.burstIndex].count.genValue(this.time);", + " this.spawn(count, emissionState, emitterMatrix);", + " }", + " emissionState.burstIndex++;", + " }", + " if (!this.emitEnded) {", + " emissionState.waitEmiting += delta * this.emissionOverTime.genValue(emissionState.time / this.duration);", + " if (emissionState.previousWorldPos != undefined) {", + " this.temp.set(emitterMatrix.elements[12], emitterMatrix.elements[13], emitterMatrix.elements[14]);", + " emissionState.travelDistance += emissionState.previousWorldPos.distanceTo(this.temp);", + " const emitPerMeter = this.emissionOverDistance.genValue(emissionState.time / this.duration);", + " if (emissionState.travelDistance * emitPerMeter > 0) {", + " const count = Math.floor(emissionState.travelDistance * emitPerMeter);", + " emissionState.travelDistance -= count / emitPerMeter;", + " emissionState.waitEmiting += count;", + " }", + " }", + " }", + " if (emissionState.previousWorldPos === undefined)", + " emissionState.previousWorldPos = new THREE.Vector3();", + " emissionState.previousWorldPos.set(emitterMatrix.elements[12], emitterMatrix.elements[13], emitterMatrix.elements[14]);", + " emissionState.time += delta;", + " }", + " toJSON(meta, options = {}) {", + " const isRootObject = meta === undefined || typeof meta === 'string';", + " if (isRootObject) {", + " meta = {", + " geometries: {},", + " materials: {},", + " textures: {},", + " images: {},", + " shapes: {},", + " skeletons: {},", + " animations: {},", + " nodes: {},", + " };", + " }", + " meta.materials[this.rendererSettings.material.uuid] = this.rendererSettings.material.toJSON(meta);", + " if (options.useUrlForImage) {", + " if (this.texture.source !== undefined) {", + " const image = this.texture.source;", + " meta.images[image.uuid] = {", + " uuid: image.uuid,", + " url: this.texture.image.url,", + " };", + " }", + " }", + " let rendererSettingsJSON;", + " if (this.renderMode === RenderMode.Trail) {", + " rendererSettingsJSON = {", + " startLength: this.rendererEmitterSettings.startLength.toJSON(),", + " followLocalOrigin: this.rendererEmitterSettings.followLocalOrigin,", + " };", + " }", + " else if (this.renderMode === RenderMode.Mesh) {", + " rendererSettingsJSON = {};", + " }", + " else if (this.renderMode === RenderMode.StretchedBillBoard) {", + " rendererSettingsJSON = {", + " speedFactor: this.rendererEmitterSettings.speedFactor,", + " lengthFactor: this.rendererEmitterSettings.lengthFactor,", + " };", + " }", + " else {", + " rendererSettingsJSON = {};", + " }", + " const geometry = this.rendererSettings.instancingGeometry;", + " if (meta.geometries && !meta.geometries[geometry.uuid]) {", + " meta.geometries[geometry.uuid] = geometry.toJSON();", + " }", + " return {", + " version: '2.0',", + " autoDestroy: this.autoDestroy,", + " looping: this.looping,", + " prewarm: this.prewarm,", + " duration: this.duration,", + " shape: this.emitterShape.toJSON(),", + " startLife: this.startLife.toJSON(),", + " startSpeed: this.startSpeed.toJSON(),", + " startRotation: this.startRotation.toJSON(),", + " startSize: this.startSize.toJSON(),", + " startColor: this.startColor.toJSON(),", + " emissionOverTime: this.emissionOverTime.toJSON(),", + " emissionOverDistance: this.emissionOverDistance.toJSON(),", + " emissionBursts: this.emissionBursts.map((burst) => ({", + " time: burst.time,", + " count: burst.count.toJSON(),", + " probability: burst.probability,", + " interval: burst.interval,", + " cycle: burst.cycle,", + " })),", + " onlyUsedByOther: this.onlyUsedByOther,", + " instancingGeometry: this.rendererSettings.instancingGeometry.uuid,", + " renderOrder: this.renderOrder,", + " renderMode: this.renderMode,", + " rendererEmitterSettings: rendererSettingsJSON,", + " material: this.rendererSettings.material.uuid,", + " layers: this.layers.mask,", + " startTileIndex: this.startTileIndex.toJSON(),", + " uTileCount: this.uTileCount,", + " vTileCount: this.vTileCount,", + " behaviors: this.behaviors.map((behavior) => behavior.toJSON()),", + " worldSpace: this.worldSpace,", + " };", + " }", + " static fromJSON(json, meta, dependencies) {", + " var _a, _b;", + " const shape = EmitterFromJSON(json.shape, meta);", + " let rendererEmitterSettings;", + " if (json.renderMode === RenderMode.Trail) {", + " let trailSettings = json.rendererEmitterSettings;", + " rendererEmitterSettings = {", + " startLength: trailSettings.startLength != undefined", + " ? ValueGeneratorFromJSON(trailSettings.startLength)", + " : new ConstantValue(30),", + " followLocalOrigin: trailSettings.followLocalOrigin,", + " };", + " }", + " else if (json.renderMode === RenderMode.Mesh) {", + " rendererEmitterSettings = {};", + " }", + " else if (json.renderMode === RenderMode.StretchedBillBoard) {", + " rendererEmitterSettings = json.rendererEmitterSettings;", + " if (json.speedFactor != undefined) {", + " rendererEmitterSettings.speedFactor = json.speedFactor;", + " }", + " }", + " else {", + " rendererEmitterSettings = {};", + " }", + " const layers = new THREE.Layers();", + " if (json.layers) {", + " layers.mask = json.layers;", + " }", + " const ps = new ParticleSystem({", + " autoDestroy: json.autoDestroy,", + " looping: json.looping,", + " prewarm: json.prewarm,", + " duration: json.duration,", + " shape: shape,", + " startLife: ValueGeneratorFromJSON(json.startLife),", + " startSpeed: ValueGeneratorFromJSON(json.startSpeed),", + " startRotation: GeneratorFromJSON(json.startRotation),", + " startSize: ValueGeneratorFromJSON(json.startSize),", + " startColor: ColorGeneratorFromJSON(json.startColor),", + " emissionOverTime: ValueGeneratorFromJSON(json.emissionOverTime),", + " emissionOverDistance: ValueGeneratorFromJSON(json.emissionOverDistance),", + " emissionBursts: (_a = json.emissionBursts) === null || _a === void 0 ? void 0 : _a.map((burst) => ({", + " time: burst.time,", + " count: typeof burst.count === 'number'", + " ? new ConstantValue(burst.count)", + " : ValueGeneratorFromJSON(burst.count),", + " probability: burst.probability,", + " interval: burst.interval,", + " cycle: burst.cycle,", + " })),", + " onlyUsedByOther: json.onlyUsedByOther,", + " instancingGeometry: meta.geometries[json.instancingGeometry],", + " renderMode: json.renderMode,", + " rendererEmitterSettings: rendererEmitterSettings,", + " renderOrder: json.renderOrder,", + " layers: layers,", + " material: json.material", + " ? meta.materials[json.material]", + " : json.texture", + " ? new THREE.MeshBasicMaterial({", + " map: meta.textures[json.texture],", + " transparent: (_b = json.transparent) !== null && _b !== void 0 ? _b : true,", + " blending: json.blending,", + " side: THREE.DoubleSide,", + " })", + " : new THREE.MeshBasicMaterial({", + " color: 0xffffff,", + " transparent: true,", + " blending: THREE.AdditiveBlending,", + " side: THREE.DoubleSide,", + " }),", + " startTileIndex: typeof json.startTileIndex === 'number'", + " ? new ConstantValue(json.startTileIndex)", + " : ValueGeneratorFromJSON(json.startTileIndex),", + " uTileCount: json.uTileCount,", + " vTileCount: json.vTileCount,", + " behaviors: [],", + " worldSpace: json.worldSpace,", + " });", + " ps.behaviors = json.behaviors.map((behaviorJson) => {", + " const behavior = BehaviorFromJSON(behaviorJson, ps);", + " if (behavior.type === 'EmitSubParticleSystem') {", + " dependencies[behaviorJson.subParticleSystem] = behavior;", + " }", + " return behavior;", + " });", + " return ps;", + " }", + " addBehavior(behavior) {", + " this.behaviors.push(behavior);", + " }", + " getRendererSettings() {", + " return this.rendererSettings;", + " }", + " clone() {", + " const newEmissionBursts = [];", + " for (const emissionBurst of this.emissionBursts) {", + " const newEmissionBurst = {};", + " Object.assign(newEmissionBurst, emissionBurst);", + " newEmissionBursts.push(newEmissionBurst);", + " }", + " const newBehaviors = [];", + " for (const behavior of this.behaviors) {", + " newBehaviors.push(behavior.clone());", + " }", + " let rendererEmitterSettings;", + " if (this.renderMode === RenderMode.Trail) {", + " rendererEmitterSettings = {", + " startLength: this.rendererEmitterSettings.startLength.clone(),", + " followLocalOrigin: this.rendererEmitterSettings.followLocalOrigin,", + " };", + " }", + " else {", + " rendererEmitterSettings = {};", + " }", + " const layers = new THREE.Layers();", + " layers.mask = this.layers.mask;", + " return new ParticleSystem({", + " autoDestroy: this.autoDestroy,", + " looping: this.looping,", + " duration: this.duration,", + " shape: this.emitterShape.clone(),", + " startLife: this.startLife.clone(),", + " startSpeed: this.startSpeed.clone(),", + " startRotation: this.startRotation.clone(),", + " startSize: this.startSize.clone(),", + " startColor: this.startColor.clone(),", + " emissionOverTime: this.emissionOverTime.clone(),", + " emissionOverDistance: this.emissionOverDistance.clone(),", + " emissionBursts: newEmissionBursts,", + " onlyUsedByOther: this.onlyUsedByOther,", + " instancingGeometry: this.rendererSettings.instancingGeometry,", + " renderMode: this.renderMode,", + " renderOrder: this.renderOrder,", + " rendererEmitterSettings: rendererEmitterSettings,", + " material: this.rendererSettings.material,", + " startTileIndex: this.startTileIndex,", + " uTileCount: this.uTileCount,", + " vTileCount: this.vTileCount,", + " behaviors: newBehaviors,", + " worldSpace: this.worldSpace,", + " layers: layers,", + " });", + " }", + "}", + "", + "var particle_frag = `", + "", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "void main() {", + "", + " #include ", + " ", + " vec3 outgoingLight = vec3( 0.0 );", + " vec4 diffuseColor = vColor;", + " ", + " #include ", + " ", + " #ifdef USE_MAP", + " diffuseColor *= texture2D( map, vMapUv);", + " #endif", + " ", + " #include ", + "", + " outgoingLight = diffuseColor.rgb;", + " ", + " #ifdef USE_COLOR_AS_ALPHA", + " gl_FragColor = vec4( outgoingLight, diffuseColor.r );", + " #else", + " gl_FragColor = vec4( outgoingLight, diffuseColor.a );", + " #endif", + " ", + " ", + " #include ", + "", + "}", + "`;", + "", + "var particle_physics_frag = `", + "#define STANDARD", + "#ifdef PHYSICAL", + "#define IOR", + "#define SPECULAR", + "#endif", + "uniform vec3 diffuse;", + "uniform vec3 emissive;", + "uniform float roughness;", + "uniform float metalness;", + "uniform float opacity;", + "#ifdef IOR", + "uniform float ior;", + "#endif", + "#ifdef SPECULAR", + "uniform float specularIntensity;", + "uniform vec3 specularColor;", + "#ifdef USE_SPECULARINTENSITYMAP", + "uniform sampler2D specularIntensityMap;", + "#endif", + "#ifdef USE_SPECULARCOLORMAP", + "uniform sampler2D specularColorMap;", + "#endif", + "#endif", + "#ifdef USE_CLEARCOAT", + "uniform float clearcoat;", + "uniform float clearcoatRoughness;", + "#endif", + "#ifdef USE_IRIDESCENCE", + "uniform float iridescence;", + "uniform float iridescenceIOR;", + "uniform float iridescenceThicknessMinimum;", + "uniform float iridescenceThicknessMaximum;", + "#endif", + "#ifdef USE_SHEEN", + "uniform vec3 sheenColor;", + "uniform float sheenRoughness;", + "#ifdef USE_SHEENCOLORMAP", + "uniform sampler2D sheenColorMap;", + "#endif", + "#ifdef USE_SHEENROUGHNESSMAP", + "uniform sampler2D sheenRoughnessMap;", + "#endif", + "#endif", + "", + "varying vec3 vViewPosition;", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "void main() {", + " #include ", + " vec4 diffuseColor = vec4( diffuse, opacity );", + " ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );", + " vec3 totalEmissiveRadiance = emissive;", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " // accumulation", + " #include ", + " #include ", + " #include ", + " #include ", + " // modulation", + " #include ", + " vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;", + " vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;", + " #include ", + " vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;", + " #ifdef USE_SHEEN", + " // Sheen energy compensation approximation calculation can be found at the end of", + " // https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing", + " float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );", + " outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;", + " #endif", + " #ifdef USE_CLEARCOAT", + " float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );", + " vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );", + " outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;", + " #endif", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + "}`;", + "", + "var uv_vertex_tile = `", + "", + " #ifdef UV_TILE", + " float col = mod(uvTile, tileCount.x);", + " float row = (tileCount.y - floor(uvTile / tileCount.x) - 1.0);", + " ", + " mat3 tileTransform = mat3(", + " 1.0 / tileCount.x, 0.0, 0.0,", + " 0.0, 1.0 / tileCount.y, 0.0, ", + " col / tileCount.x, row / tileCount.y, 1.0);", + " #else", + " mat3 tileTransform = mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);", + " #endif", + "", + "#if defined( USE_UV ) || defined( USE_ANISOTROPY )", + "", + "vUv = (tileTransform *vec3( uv, 1 )).xy;", + "", + "#endif", + "#ifdef USE_MAP", + "", + "vMapUv = ( tileTransform * (mapTransform * vec3( MAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_ALPHAMAP", + "", + "vAlphaMapUv = ( tileTransform * (alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_LIGHTMAP", + "", + "vLightMapUv = ( tileTransform * (lightMapTransform * vec3( LIGHTMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_AOMAP", + "", + "vAoMapUv = ( tileTransform * (aoMapTransform * vec3( AOMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_BUMPMAP", + "", + "vBumpMapUv = ( tileTransform * (bumpMapTransform * vec3( BUMPMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_NORMALMAP", + "", + "vNormalMapUv = ( tileTransform * (normalMapTransform * vec3( NORMALMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_DISPLACEMENTMAP", + "", + "vDisplacementMapUv = ( tileTransform * (displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_EMISSIVEMAP", + "", + "vEmissiveMapUv = ( tileTransform * (emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_METALNESSMAP", + "", + "vMetalnessMapUv = ( tileTransform * (metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_ROUGHNESSMAP", + "", + "vRoughnessMapUv = ( tileTransform * (roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_ANISOTROPYMAP", + "", + "vAnisotropyMapUv = ( tileTransform * (anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_CLEARCOATMAP", + "", + "vClearcoatMapUv = ( tileTransform * (clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_CLEARCOAT_NORMALMAP", + "", + "vClearcoatNormalMapUv = ( tileTransform * (clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_CLEARCOAT_ROUGHNESSMAP", + "", + "vClearcoatRoughnessMapUv = ( tileTransform * (clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_IRIDESCENCEMAP", + "", + "vIridescenceMapUv = ( tileTransform * (iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_IRIDESCENCE_THICKNESSMAP", + "", + "vIridescenceThicknessMapUv = ( tileTransform * (iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_SHEEN_COLORMAP", + "", + "vSheenColorMapUv = ( tileTransform * (sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_SHEEN_ROUGHNESSMAP", + "", + "vSheenRoughnessMapUv = ( tileTransform * (sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_SPECULARMAP", + "", + "vSpecularMapUv = ( tileTransform * (specularMapTransform * vec3( SPECULARMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_SPECULAR_COLORMAP", + "", + "vSpecularColorMapUv = ( tileTransform * (specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_SPECULAR_INTENSITYMAP", + "", + "vSpecularIntensityMapUv = ( tileTransform * (specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_TRANSMISSIONMAP", + "", + "vTransmissionMapUv = ( tileTransform * transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_THICKNESSMAP", + "", + "vThicknessMapUv = ( tileTransform * thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "`;", + "", + "var particle_vert = `", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "attribute vec3 offset;", + "attribute float rotation;", + "attribute float size;", + "attribute float uvTile;", + "", + "#ifdef UV_TILE", + "uniform vec2 tileCount;", + "#endif", + "", + "void main() {", + "", + " ${uv_vertex_tile}", + "\t", + " vec2 alignedPosition = ( position.xy ) * size;", + " ", + " vec2 rotatedPosition;", + " rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", + " rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", + "#ifdef HORIZONTAL", + " vec4 mvPosition = modelMatrix * vec4( offset, 1.0 );", + " mvPosition.x += rotatedPosition.x;", + " mvPosition.z -= rotatedPosition.y;", + " mvPosition = viewMatrix * mvPosition;", + "#elif defined(VERTICAL)", + " vec4 mvPosition = modelMatrix * vec4( offset, 1.0 );", + " mvPosition.y += rotatedPosition.y;", + " mvPosition = viewMatrix * mvPosition;", + " mvPosition.x += rotatedPosition.x;", + "#else", + " vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );", + " mvPosition.xy += rotatedPosition;", + "#endif", + "", + "\tvColor = color;", + "", + "\tgl_Position = projectionMatrix * mvPosition;", + "", + "\t#include ", + "\t#include ", + "", + "}", + "`;", + "", + "var local_particle_vert = `", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "attribute vec3 offset;", + "attribute vec4 rotation;", + "attribute float size;", + "// attribute vec4 color;", + "attribute float uvTile;", + "", + "#ifdef UV_TILE", + "uniform vec2 tileCount;", + "#endif", + "", + "void main() {", + "", + " ${uv_vertex_tile}", + " ", + " float x2 = rotation.x + rotation.x, y2 = rotation.y + rotation.y, z2 = rotation.z + rotation.z;", + " float xx = rotation.x * x2, xy = rotation.x * y2, xz = rotation.x * z2;", + " float yy = rotation.y * y2, yz = rotation.y * z2, zz = rotation.z * z2;", + " float wx = rotation.w * x2, wy = rotation.w * y2, wz = rotation.w * z2;", + " float sx = size, sy = size, sz = size;", + " ", + " mat4 matrix = mat4(( 1.0 - ( yy + zz ) ) * sx, ( xy + wz ) * sx, ( xz - wy ) * sx, 0.0, // 1. column", + " ( xy - wz ) * sy, ( 1.0 - ( xx + zz ) ) * sy, ( yz + wx ) * sy, 0.0, // 2. column", + " ( xz + wy ) * sz, ( yz - wx ) * sz, ( 1.0 - ( xx + yy ) ) * sz, 0.0, // 3. column", + " offset.x, offset.y, offset.z, 1.0);", + " ", + " vec4 mvPosition = modelViewMatrix * (matrix * vec4( position, 1.0 ));", + "", + "\tvColor = color;", + "", + "\tgl_Position = projectionMatrix * mvPosition;", + "", + "\t#include ", + "\t#include ", + "", + "}", + "`;", + "", + "var local_particle_physics_vert = `", + "#define STANDARD", + "varying vec3 vViewPosition;", + "#ifdef USE_TRANSMISSION", + "\tvarying vec3 vWorldPosition;", + "#endif", + "#include ", + "#include ", + "", + "attribute vec3 offset;", + "attribute vec4 rotation;", + "attribute float size;", + "attribute float uvTile;", + "", + "#ifdef UV_TILE", + "uniform vec2 tileCount;", + "#endif", + "", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "void main() {", + " ${uv_vertex_tile}", + "", + " float x2 = rotation.x + rotation.x, y2 = rotation.y + rotation.y, z2 = rotation.z + rotation.z;", + " float xx = rotation.x * x2, xy = rotation.x * y2, xz = rotation.x * z2;", + " float yy = rotation.y * y2, yz = rotation.y * z2, zz = rotation.z * z2;", + " float wx = rotation.w * x2, wy = rotation.w * y2, wz = rotation.w * z2;", + " float sx = size, sy = size, sz = size;", + "", + " mat4 particleMatrix = mat4(( 1.0 - ( yy + zz ) ) * sx, ( xy + wz ) * sx, ( xz - wy ) * sx, 0.0, // 1. column", + " ( xy - wz ) * sy, ( 1.0 - ( xx + zz ) ) * sy, ( yz + wx ) * sy, 0.0, // 2. column", + " ( xz + wy ) * sz, ( yz - wx ) * sz, ( 1.0 - ( xx + yy ) ) * sz, 0.0, // 3. column", + " offset.x, offset.y, offset.z, 1.0);", + "", + "\t#include ", + "\t#include ", + "\t#include ", + "\t#include ", + "\t#include ", + "\t#include ", + "", + "\t// replace defaultnormal_vertex", + "\tvec3 transformedNormal = objectNormal;", + " mat3 m = mat3( particleMatrix );", + " transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );", + " transformedNormal = m * transformedNormal;", + " transformedNormal = normalMatrix * transformedNormal;", + " #ifdef FLIP_SIDED", + " transformedNormal = - transformedNormal;", + " #endif", + " #ifdef USE_TANGENT", + " vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;", + " #ifdef FLIP_SIDED", + " transformedTangent = - transformedTangent;", + " #endif", + " #endif", + "", + "\t#include ", + "\t#include ", + "\t#include ", + "\t#include ", + "\t#include ", + "", + "\t// replace include ", + " vec4 mvPosition = vec4( transformed, 1.0 );", + " mvPosition = modelViewMatrix * (particleMatrix * mvPosition);", + "\tgl_Position = projectionMatrix * mvPosition;", + "", + "\t#include ", + "\t#include ", + "\t", + "\tvViewPosition = - mvPosition.xyz;", + "\t", + "\t#include ", + "\t#include ", + "\t#include ", + "#ifdef USE_TRANSMISSION", + "\tvWorldPosition = worldPosition.xyz;", + "#endif", + "}", + "`;", + "", + "var stretched_bb_particle_vert = `", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "attribute vec3 offset;", + "attribute float rotation;", + "attribute float size;", + "attribute vec4 velocity;", + "attribute float uvTile;", + "", + "#ifdef UV_TILE", + "uniform vec2 tileCount;", + "#endif", + "", + "uniform float speedFactor;", + "", + "void main() {", + "", + " ${uv_vertex_tile}", + " ", + " float lengthFactor = velocity.w;", + "#ifdef USE_SKEW", + " vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );", + " vec3 viewVelocity = normalMatrix * velocity.xyz;", + "", + " vec3 scaledPos = vec3(position.xy * size, position.z);", + " float vlength = length(viewVelocity);", + " vec3 projVelocity = dot(scaledPos, viewVelocity) * viewVelocity / vlength;", + " mvPosition.xyz += scaledPos + projVelocity * (speedFactor / size + lengthFactor / vlength);", + "#else", + " vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );", + " vec3 viewVelocity = normalMatrix * velocity.xyz;", + " float vlength = length(viewVelocity); ", + " mvPosition.xyz += position.y * normalize(cross(mvPosition.xyz, viewVelocity)) * size; // switch the cross to match unity implementation", + " mvPosition.xyz -= (position.x + 0.5) * viewVelocity * (1.0 + lengthFactor / vlength) * size; // minus position.x to match unity implementation", + "#endif", + "\tvColor = color;", + "\tgl_Position = projectionMatrix * mvPosition;", + "\t#include ", + "\t#include ", + "}", + "`;", + "", + "function getMaterialUVChannelName(value) {", + " if (value === 0)", + " return 'uv';", + " return `uv${value}`;", + "}", + "", + "new THREE.Vector3(0, 0, 1);", + "class SpriteBatch extends VFXBatch {", + " constructor(settings) {", + " super(settings);", + " this.vector_ = new THREE.Vector3();", + " this.vector2_ = new THREE.Vector3();", + " this.vector3_ = new THREE.Vector3();", + " this.quaternion_ = new THREE.Quaternion();", + " this.quaternion2_ = new THREE.Quaternion();", + " this.quaternion3_ = new THREE.Quaternion();", + " this.rotationMat_ = new THREE.Matrix3();", + " this.rotationMat2_ = new THREE.Matrix3();", + " this.maxParticles = 1000;", + " this.setupBuffers();", + " this.rebuildMaterial();", + " }", + " buildExpandableBuffers() {", + " this.offsetBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 3), 3);", + " this.offsetBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('offset', this.offsetBuffer);", + " this.colorBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 4), 4);", + " this.colorBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('color', this.colorBuffer);", + " if (this.settings.renderMode === RenderMode.Mesh) {", + " this.rotationBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 4), 4);", + " this.rotationBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('rotation', this.rotationBuffer);", + " }", + " else if (this.settings.renderMode === RenderMode.BillBoard ||", + " this.settings.renderMode === RenderMode.HorizontalBillBoard ||", + " this.settings.renderMode === RenderMode.VerticalBillBoard ||", + " this.settings.renderMode === RenderMode.StretchedBillBoard) {", + " this.rotationBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles), 1);", + " this.rotationBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('rotation', this.rotationBuffer);", + " }", + " this.sizeBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles), 1);", + " this.sizeBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('size', this.sizeBuffer);", + " this.uvTileBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles), 1);", + " this.uvTileBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('uvTile', this.uvTileBuffer);", + " if (this.settings.renderMode === RenderMode.StretchedBillBoard) {", + " this.velocityBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 4), 4);", + " this.velocityBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('velocity', this.velocityBuffer);", + " }", + " }", + " setupBuffers() {", + " if (this.geometry)", + " this.geometry.dispose();", + " this.geometry = new THREE.InstancedBufferGeometry();", + " this.geometry.setIndex(this.settings.instancingGeometry.getIndex());", + " if (this.settings.instancingGeometry.hasAttribute('normal')) {", + " this.geometry.setAttribute('normal', this.settings.instancingGeometry.getAttribute('normal'));", + " }", + " this.geometry.setAttribute('position', this.settings.instancingGeometry.getAttribute('position'));", + " this.geometry.setAttribute('uv', this.settings.instancingGeometry.getAttribute('uv'));", + " this.buildExpandableBuffers();", + " }", + " expandBuffers(target) {", + " while (target >= this.maxParticles) {", + " this.maxParticles *= 2;", + " }", + " this.setupBuffers();", + " }", + " rebuildMaterial() {", + " this.layers.mask = this.settings.layers.mask;", + " let uniforms;", + " const defines = {};", + " if (this.settings.material.type === 'MeshStandardMaterial' ||", + " this.settings.material.type === 'MeshPhysicalMaterial') {", + " const mat = this.settings.material;", + " uniforms = THREE.UniformsUtils.merge([", + " THREE.UniformsLib.common,", + " THREE.UniformsLib.envmap,", + " THREE.UniformsLib.aomap,", + " THREE.UniformsLib.lightmap,", + " THREE.UniformsLib.emissivemap,", + " THREE.UniformsLib.bumpmap,", + " THREE.UniformsLib.normalmap,", + " THREE.UniformsLib.displacementmap,", + " THREE.UniformsLib.roughnessmap,", + " THREE.UniformsLib.metalnessmap,", + " THREE.UniformsLib.fog,", + " THREE.UniformsLib.lights,", + " {", + " emissive: { value: new THREE.Color(0x000000) },", + " roughness: { value: 1.0 },", + " metalness: { value: 0.0 },", + " envMapIntensity: { value: 1 },", + " },", + " ]);", + " uniforms['diffuse'].value = mat.color;", + " uniforms['opacity'].value = mat.opacity;", + " uniforms['emissive'].value = mat.emissive;", + " uniforms['roughness'].value = mat.roughness;", + " uniforms['metalness'].value = mat.metalness;", + " if (mat.envMap) {", + " uniforms['envMap'].value = mat.envMap;", + " uniforms['envMapIntensity'].value = mat.envMapIntensity;", + " }", + " if (mat.normalMap) {", + " uniforms['normalMap'].value = mat.normalMap;", + " uniforms['normalScale'].value = mat.normalScale;", + " }", + " if (mat.roughnessMap) {", + " uniforms['roughnessMap'].value = mat.roughnessMap;", + " }", + " if (mat.metalnessMap) {", + " uniforms['metalnessMap'].value = mat.metalnessMap;", + " }", + " if (mat.map) {", + " uniforms['map'] = new THREE.Uniform(mat.map);", + " }", + " }", + " else {", + " uniforms = {};", + " uniforms['map'] = new THREE.Uniform(this.settings.material.map);", + " }", + " if (this.settings.material.alphaTest) {", + " defines['USE_ALPHATEST'] = '';", + " uniforms['alphaTest'] = new THREE.Uniform(this.settings.material.alphaTest);", + " }", + " defines['USE_UV'] = '';", + " const uTileCount = this.settings.uTileCount;", + " const vTileCount = this.settings.vTileCount;", + " if (uTileCount > 1 || vTileCount > 1) {", + " defines['UV_TILE'] = '';", + " uniforms['tileCount'] = new THREE.Uniform(new THREE.Vector2(uTileCount, vTileCount));", + " }", + " if (this.settings.material.defines &&", + " this.settings.material.defines['USE_COLOR_AS_ALPHA'] !== undefined) {", + " defines['USE_COLOR_AS_ALPHA'] = '';", + " }", + " if (this.settings.material.normalMap) {", + " defines['USE_NORMALMAP'] = '';", + " defines['NORMALMAP_UV'] = getMaterialUVChannelName(this.settings.material.normalMap.channel);", + " uniforms['normalMapTransform'] = new THREE.Uniform(new THREE.Matrix3().copy(this.settings.material.normalMap.matrix));", + " }", + " if (this.settings.material.map) {", + " defines['USE_MAP'] = '';", + " defines['MAP_UV'] = getMaterialUVChannelName(this.settings.material.map.channel);", + " uniforms['mapTransform'] = new THREE.Uniform(new THREE.Matrix3().copy(this.settings.material.map.matrix));", + " }", + " defines['USE_COLOR_ALPHA'] = '';", + " let needLights = false;", + " if (this.settings.renderMode === RenderMode.BillBoard ||", + " this.settings.renderMode === RenderMode.VerticalBillBoard ||", + " this.settings.renderMode === RenderMode.HorizontalBillBoard ||", + " this.settings.renderMode === RenderMode.Mesh) {", + " let vertexShader;", + " let fragmentShader;", + " if (this.settings.renderMode === RenderMode.Mesh) {", + " if (this.settings.material.type === 'MeshStandardMaterial' ||", + " this.settings.material.type === 'MeshPhysicalMaterial') {", + " defines['USE_COLOR'] = '';", + " vertexShader = local_particle_physics_vert;", + " fragmentShader = particle_physics_frag;", + " needLights = true;", + " }", + " else {", + " vertexShader = local_particle_vert;", + " fragmentShader = particle_frag;", + " }", + " }", + " else {", + " vertexShader = particle_vert;", + " fragmentShader = particle_frag;", + " }", + " if (this.settings.renderMode === RenderMode.VerticalBillBoard) {", + " defines['VERTICAL'] = '';", + " }", + " else if (this.settings.renderMode === RenderMode.HorizontalBillBoard) {", + " defines['HORIZONTAL'] = '';", + " }", + " this.material = new THREE.ShaderMaterial({", + " uniforms: uniforms,", + " defines: defines,", + " vertexShader: vertexShader,", + " fragmentShader: fragmentShader,", + " transparent: this.settings.material.transparent,", + " depthWrite: !this.settings.material.transparent,", + " blending: this.settings.material.blending,", + " side: this.settings.material.side,", + " alphaTest: this.settings.material.alphaTest,", + " lights: needLights,", + " });", + " }", + " else if (this.settings.renderMode === RenderMode.StretchedBillBoard) {", + " uniforms['speedFactor'] = new THREE.Uniform(1.0);", + " this.material = new THREE.ShaderMaterial({", + " uniforms: uniforms,", + " defines: defines,", + " vertexShader: stretched_bb_particle_vert,", + " fragmentShader: particle_frag,", + " transparent: this.settings.material.transparent,", + " depthWrite: !this.settings.material.transparent,", + " blending: this.settings.material.blending,", + " side: this.settings.material.side,", + " alphaTest: this.settings.material.alphaTest,", + " });", + " }", + " else {", + " throw new Error('render mode unavailable');", + " }", + " }", + " update() {", + " let index = 0;", + " let particleCount = 0;", + " this.systems.forEach((system) => {", + " particleCount += system.particleNum;", + " });", + " if (particleCount > this.maxParticles) {", + " this.expandBuffers(particleCount);", + " }", + " this.systems.forEach((system) => {", + " const particles = system.particles;", + " const particleNum = system.particleNum;", + " const rotation = this.quaternion2_;", + " const translation = this.vector2_;", + " const scale = this.vector3_;", + " system.emitter.matrixWorld.decompose(translation, rotation, scale);", + " this.rotationMat_.setFromMatrix4(system.emitter.matrixWorld);", + " for (let j = 0; j < particleNum; j++ , index++) {", + " const particle = particles[j];", + " if (this.settings.renderMode === RenderMode.Mesh) {", + " let q;", + " if (system.worldSpace) {", + " q = particle.rotation;", + " }", + " else {", + " let parentQ;", + " if (particle.parentMatrix) {", + " parentQ = this.quaternion3_.setFromRotationMatrix(particle.parentMatrix);", + " }", + " else {", + " parentQ = rotation;", + " }", + " q = this.quaternion_;", + " q.copy(particle.rotation).multiply(parentQ);", + " }", + " this.rotationBuffer.setXYZW(index, q.x, q.y, q.z, q.w);", + " }", + " else if (this.settings.renderMode === RenderMode.StretchedBillBoard ||", + " this.settings.renderMode === RenderMode.VerticalBillBoard ||", + " this.settings.renderMode === RenderMode.HorizontalBillBoard ||", + " this.settings.renderMode === RenderMode.BillBoard) {", + " this.rotationBuffer.setX(index, particle.rotation);", + " }", + " let vec;", + " if (system.worldSpace) {", + " vec = particle.position;", + " }", + " else {", + " vec = this.vector_;", + " if (particle.parentMatrix) {", + " vec.copy(particle.position).applyMatrix4(particle.parentMatrix);", + " }", + " else {", + " vec.copy(particle.position).applyMatrix4(system.emitter.matrixWorld);", + " }", + " }", + " this.offsetBuffer.setXYZ(index, vec.x, vec.y, vec.z);", + " this.colorBuffer.setXYZW(index, particle.color.x, particle.color.y, particle.color.z, particle.color.w);", + " if (system.worldSpace) {", + " this.sizeBuffer.setX(index, particle.size);", + " }", + " else {", + " if (particle.parentMatrix) {", + " this.sizeBuffer.setX(index, particle.size);", + " }", + " else {", + " this.sizeBuffer.setX(index, (particle.size * (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z))) / 3);", + " }", + " }", + " this.uvTileBuffer.setX(index, particle.uvTile);", + " if (this.settings.renderMode === RenderMode.StretchedBillBoard && this.velocityBuffer) {", + " let speedFactor = system.rendererEmitterSettings.speedFactor;", + " if (speedFactor === 0)", + " speedFactor = 0.001;", + " const lengthFactor = system.rendererEmitterSettings.lengthFactor;", + " let vec;", + " if (system.worldSpace) {", + " vec = particle.velocity;", + " }", + " else {", + " vec = this.vector_;", + " if (particle.parentMatrix) {", + " this.rotationMat2_.setFromMatrix4(particle.parentMatrix);", + " vec.copy(particle.velocity).applyMatrix3(this.rotationMat2_);", + " }", + " else {", + " vec.copy(particle.velocity).applyMatrix3(this.rotationMat_);", + " }", + " }", + " this.velocityBuffer.setXYZW(index, vec.x * speedFactor, vec.y * speedFactor, vec.z * speedFactor, lengthFactor);", + " }", + " }", + " });", + " this.geometry.instanceCount = index;", + " if (index > 0) {", + " this.offsetBuffer.updateRange.count = index * 3;", + " this.offsetBuffer.needsUpdate = true;", + " this.sizeBuffer.updateRange.count = index;", + " this.sizeBuffer.needsUpdate = true;", + " this.colorBuffer.updateRange.count = index * 4;", + " this.colorBuffer.needsUpdate = true;", + " this.uvTileBuffer.updateRange.count = index;", + " this.uvTileBuffer.needsUpdate = true;", + " if (this.settings.renderMode === RenderMode.StretchedBillBoard && this.velocityBuffer) {", + " this.velocityBuffer.updateRange.count = index * 4;", + " this.velocityBuffer.needsUpdate = true;", + " }", + " if (this.settings.renderMode === RenderMode.Mesh) {", + " this.rotationBuffer.updateRange.count = index * 4;", + " this.rotationBuffer.needsUpdate = true;", + " }", + " else if (this.settings.renderMode === RenderMode.StretchedBillBoard ||", + " this.settings.renderMode === RenderMode.HorizontalBillBoard ||", + " this.settings.renderMode === RenderMode.VerticalBillBoard ||", + " this.settings.renderMode === RenderMode.BillBoard) {", + " this.rotationBuffer.updateRange.count = index;", + " this.rotationBuffer.needsUpdate = true;", + " }", + " }", + " }", + " dispose() {", + " this.geometry.dispose();", + " }", + "}", + "", + "var trail_frag = `", + "", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "uniform sampler2D alphaMap;", + "uniform float useAlphaMap;", + "uniform float visibility;", + "uniform float alphaTest;", + "uniform vec2 repeat;", + "", + "varying vec4 vColor;", + " ", + "void main() {", + " #include ", + " #include ", + "", + " vec4 c = vColor;", + " ", + " #ifdef USE_MAP", + " #ifdef USE_COLOR_AS_ALPHA", + " vec4 tex = texture2D( map, vUv * repeat );", + " c *= vec4(tex.rgb, tex.r);", + " #else", + " c *= texture2D( map, vUv * repeat );", + " #endif", + " #endif", + " if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUv * repeat ).a;", + " if( c.a < alphaTest ) discard;", + " gl_FragColor = c;", + "", + " #include ", + " #include ", + "}`;", + "", + "var trail_vert = `", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "attribute vec3 previous;", + "attribute vec3 next;", + "attribute float side;", + "attribute float width;", + "", + "uniform vec2 resolution;", + "uniform float lineWidth;", + "uniform float sizeAttenuation;", + " ", + "vec2 fix(vec4 i, float aspect) {", + " vec2 res = i.xy / i.w;", + " res.x *= aspect;", + " return res;", + "}", + " ", + "void main() {", + "", + " ${uv_vertex_tile}", + " ", + " float aspect = resolution.x / resolution.y;", + "", + " vColor = color;", + "", + " mat4 m = projectionMatrix * modelViewMatrix;", + " vec4 finalPosition = m * vec4( position, 1.0 );", + " vec4 prevPos = m * vec4( previous, 1.0 );", + " vec4 nextPos = m * vec4( next, 1.0 );", + "", + " vec2 currentP = fix( finalPosition, aspect );", + " vec2 prevP = fix( prevPos, aspect );", + " vec2 nextP = fix( nextPos, aspect );", + "", + " float w = lineWidth * width;", + "", + " vec2 dir;", + " if( nextP == currentP ) dir = normalize( currentP - prevP );", + " else if( prevP == currentP ) dir = normalize( nextP - currentP );", + " else {", + " vec2 dir1 = normalize( currentP - prevP );", + " vec2 dir2 = normalize( nextP - currentP );", + " dir = normalize( dir1 + dir2 );", + "", + " vec2 perp = vec2( -dir1.y, dir1.x );", + " vec2 miter = vec2( -dir.y, dir.x );", + " //w = clamp( w / dot( miter, perp ), 0., 4., * lineWidth * width );", + "", + " }", + "", + " //vec2 normal = ( cross( vec3( dir, 0. ) vec3( 0., 0., 1. ) ) ).xy;", + " vec4 normal = vec4( -dir.y, dir.x, 0., 1. );", + " normal.xy *= .5 * w;", + " normal *= projectionMatrix;", + " if( sizeAttenuation == 0. ) {", + " normal.xy *= finalPosition.w;", + " normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;", + " }", + "", + " finalPosition.xy += normal.xy * side;", + "", + " gl_Position = finalPosition;", + "", + "\t#include ", + "\t#include ", + "\t", + " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", + " ", + "\t#include ", + "}`;", + "", + "new THREE.Vector3(0, 0, 1);", + "class TrailBatch extends VFXBatch {", + " constructor(settings) {", + " super(settings);", + " this.vector_ = new THREE.Vector3();", + " this.vector2_ = new THREE.Vector3();", + " this.vector3_ = new THREE.Vector3();", + " this.quaternion_ = new THREE.Quaternion();", + " this.maxParticles = 10000;", + " this.setupBuffers();", + " this.rebuildMaterial();", + " }", + " setupBuffers() {", + " if (this.geometry)", + " this.geometry.dispose();", + " this.geometry = new THREE.BufferGeometry();", + " this.indexBuffer = new THREE.BufferAttribute(new Uint32Array(this.maxParticles * 6), 1);", + " this.indexBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setIndex(this.indexBuffer);", + " this.positionBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 6), 3);", + " this.positionBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('position', this.positionBuffer);", + " this.previousBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 6), 3);", + " this.previousBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('previous', this.previousBuffer);", + " this.nextBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 6), 3);", + " this.nextBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('next', this.nextBuffer);", + " this.widthBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 2), 1);", + " this.widthBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('width', this.widthBuffer);", + " this.sideBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 2), 1);", + " this.sideBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('side', this.sideBuffer);", + " this.uvBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 4), 2);", + " this.uvBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('uv', this.uvBuffer);", + " this.colorBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 8), 4);", + " this.colorBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('color', this.colorBuffer);", + " }", + " expandBuffers(target) {", + " while (target >= this.maxParticles) {", + " this.maxParticles *= 2;", + " }", + " this.setupBuffers();", + " }", + " rebuildMaterial() {", + " this.layers.mask = this.settings.layers.mask;", + " const uniforms = {", + " lineWidth: { value: 1 },", + " map: { value: null },", + " useMap: { value: 0 },", + " alphaMap: { value: null },", + " useAlphaMap: { value: 0 },", + " resolution: { value: new THREE.Vector2(1, 1) },", + " sizeAttenuation: { value: 1 },", + " visibility: { value: 1 },", + " alphaTest: { value: 0 },", + " repeat: { value: new THREE.Vector2(1, 1) },", + " };", + " const defines = {};", + " defines['USE_UV'] = '';", + " defines['USE_COLOR_ALPHA'] = '';", + " if (this.settings.material.map) {", + " defines['USE_MAP'] = '';", + " defines['MAP_UV'] = getMaterialUVChannelName(this.settings.material.map.channel);", + " uniforms['map'] = new THREE.Uniform(this.settings.material.map);", + " uniforms['mapTransform'] = new THREE.Uniform(new THREE.Matrix3().copy(this.settings.material.map.matrix));", + " }", + " if (this.settings.material.defines &&", + " this.settings.material.defines['USE_COLOR_AS_ALPHA'] !== undefined) {", + " defines['USE_COLOR_AS_ALPHA'] = '';", + " }", + " if (this.settings.renderMode === RenderMode.Trail) {", + " this.material = new THREE.ShaderMaterial({", + " uniforms: uniforms,", + " defines: defines,", + " vertexShader: trail_vert,", + " fragmentShader: trail_frag,", + " transparent: this.settings.material.transparent,", + " depthWrite: !this.settings.material.transparent,", + " side: this.settings.material.side,", + " blending: this.settings.material.blending || THREE.AdditiveBlending,", + " });", + " }", + " else {", + " throw new Error('render mode unavailable');", + " }", + " }", + " update() {", + " let index = 0;", + " let triangles = 0;", + " let particleCount = 0;", + " this.systems.forEach((system) => {", + " for (let j = 0; j < system.particleNum; j++) {", + " particleCount += system.particles[j].previous.length * 2;", + " }", + " });", + " if (particleCount > this.maxParticles) {", + " this.expandBuffers(particleCount);", + " }", + " this.systems.forEach((system) => {", + " const rotation = this.quaternion_;", + " const translation = this.vector2_;", + " const scale = this.vector3_;", + " system.emitter.matrixWorld.decompose(translation, rotation, scale);", + " const particles = system.particles;", + " const particleNum = system.particleNum;", + " const uTileCount = this.settings.uTileCount;", + " const vTileCount = this.settings.vTileCount;", + " const tileWidth = 1 / uTileCount;", + " const tileHeight = 1 / vTileCount;", + " for (let j = 0; j < particleNum; j++) {", + " const particle = particles[j];", + " const col = particle.uvTile % vTileCount;", + " const row = Math.floor(particle.uvTile / vTileCount + 0.001);", + " const iter = particle.previous.values();", + " let curIter = iter.next();", + " let previous = curIter.value;", + " let current = previous;", + " if (!curIter.done)", + " curIter = iter.next();", + " let next;", + " if (curIter.value !== undefined) {", + " next = curIter.value;", + " }", + " else {", + " next = current;", + " }", + " for (let i = 0; i < particle.previous.length; i++ , index += 2) {", + " this.positionBuffer.setXYZ(index, current.position.x, current.position.y, current.position.z);", + " this.positionBuffer.setXYZ(index + 1, current.position.x, current.position.y, current.position.z);", + " if (system.worldSpace) {", + " this.positionBuffer.setXYZ(index, current.position.x, current.position.y, current.position.z);", + " this.positionBuffer.setXYZ(index + 1, current.position.x, current.position.y, current.position.z);", + " }", + " else {", + " if (particle.parentMatrix) {", + " this.vector_.copy(current.position).applyMatrix4(particle.parentMatrix);", + " }", + " else {", + " this.vector_.copy(current.position).applyMatrix4(system.emitter.matrixWorld);", + " }", + " this.positionBuffer.setXYZ(index, this.vector_.x, this.vector_.y, this.vector_.z);", + " this.positionBuffer.setXYZ(index + 1, this.vector_.x, this.vector_.y, this.vector_.z);", + " }", + " if (system.worldSpace) {", + " this.previousBuffer.setXYZ(index, previous.position.x, previous.position.y, previous.position.z);", + " this.previousBuffer.setXYZ(index + 1, previous.position.x, previous.position.y, previous.position.z);", + " }", + " else {", + " if (particle.parentMatrix) {", + " this.vector_.copy(previous.position).applyMatrix4(particle.parentMatrix);", + " }", + " else {", + " this.vector_.copy(previous.position).applyMatrix4(system.emitter.matrixWorld);", + " }", + " this.previousBuffer.setXYZ(index, this.vector_.x, this.vector_.y, this.vector_.z);", + " this.previousBuffer.setXYZ(index + 1, this.vector_.x, this.vector_.y, this.vector_.z);", + " }", + " if (system.worldSpace) {", + " this.nextBuffer.setXYZ(index, next.position.x, next.position.y, next.position.z);", + " this.nextBuffer.setXYZ(index + 1, next.position.x, next.position.y, next.position.z);", + " }", + " else {", + " if (particle.parentMatrix) {", + " this.vector_.copy(next.position).applyMatrix4(particle.parentMatrix);", + " }", + " else {", + " this.vector_.copy(next.position).applyMatrix4(system.emitter.matrixWorld);", + " }", + " this.nextBuffer.setXYZ(index, this.vector_.x, this.vector_.y, this.vector_.z);", + " this.nextBuffer.setXYZ(index + 1, this.vector_.x, this.vector_.y, this.vector_.z);", + " }", + " this.sideBuffer.setX(index, -1);", + " this.sideBuffer.setX(index + 1, 1);", + " if (system.worldSpace) {", + " this.widthBuffer.setX(index, current.size);", + " this.widthBuffer.setX(index + 1, current.size);", + " }", + " else {", + " if (particle.parentMatrix) {", + " this.widthBuffer.setX(index, current.size);", + " this.widthBuffer.setX(index + 1, current.size);", + " }", + " else {", + " const objectScale = (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z)) / 3;", + " this.widthBuffer.setX(index, current.size * objectScale);", + " this.widthBuffer.setX(index + 1, current.size * objectScale);", + " }", + " }", + " this.uvBuffer.setXY(index, (i / particle.previous.length + col) * tileWidth, (vTileCount - row - 1) * tileHeight);", + " this.uvBuffer.setXY(index + 1, (i / particle.previous.length + col) * tileWidth, (vTileCount - row) * tileHeight);", + " this.colorBuffer.setXYZW(index, current.color.x, current.color.y, current.color.z, current.color.w);", + " this.colorBuffer.setXYZW(index + 1, current.color.x, current.color.y, current.color.z, current.color.w);", + " if (i + 1 < particle.previous.length) {", + " this.indexBuffer.setX(triangles * 3, index);", + " this.indexBuffer.setX(triangles * 3 + 1, index + 1);", + " this.indexBuffer.setX(triangles * 3 + 2, index + 2);", + " triangles++;", + " this.indexBuffer.setX(triangles * 3, index + 2);", + " this.indexBuffer.setX(triangles * 3 + 1, index + 1);", + " this.indexBuffer.setX(triangles * 3 + 2, index + 3);", + " triangles++;", + " }", + " previous = current;", + " current = next;", + " if (!curIter.done) {", + " curIter = iter.next();", + " if (curIter.value !== undefined) {", + " next = curIter.value;", + " }", + " }", + " }", + " }", + " });", + " this.positionBuffer.updateRange.count = index * 3;", + " this.positionBuffer.needsUpdate = true;", + " this.previousBuffer.updateRange.count = index * 3;", + " this.previousBuffer.needsUpdate = true;", + " this.nextBuffer.updateRange.count = index * 3;", + " this.nextBuffer.needsUpdate = true;", + " this.sideBuffer.updateRange.count = index;", + " this.sideBuffer.needsUpdate = true;", + " this.widthBuffer.updateRange.count = index;", + " this.widthBuffer.needsUpdate = true;", + " this.uvBuffer.updateRange.count = index * 2;", + " this.uvBuffer.needsUpdate = true;", + " this.colorBuffer.updateRange.count = index * 4;", + " this.colorBuffer.needsUpdate = true;", + " this.indexBuffer.updateRange.count = triangles * 3;", + " this.indexBuffer.needsUpdate = true;", + " this.geometry.setDrawRange(0, triangles * 3);", + " }", + " dispose() {", + " this.geometry.dispose();", + " }", + "}", + "", + "class BatchedRenderer extends THREE.Object3D {", + " constructor() {", + " super();", + " this.batches = [];", + " this.systemToBatchIndex = new Map();", + " this.type = 'BatchedRenderer';", + " }", + " static equals(a, b) {", + " return (a.material.side === b.material.side &&", + " a.material.blending === b.material.blending &&", + " a.material.transparent === b.material.transparent &&", + " a.material.type === b.material.type &&", + " a.material.alphaTest === b.material.alphaTest &&", + " a.material.map === b.material.map &&", + " a.renderMode === b.renderMode &&", + " a.uTileCount === b.uTileCount &&", + " a.vTileCount === b.vTileCount &&", + " a.instancingGeometry === b.instancingGeometry &&", + " a.renderOrder === b.renderOrder &&", + " a.layers.mask === b.layers.mask);", + " }", + " addSystem(system) {", + " system._renderer = this;", + " const settings = system.getRendererSettings();", + " for (let i = 0; i < this.batches.length; i++) {", + " if (BatchedRenderer.equals(this.batches[i].settings, settings)) {", + " this.batches[i].addSystem(system);", + " this.systemToBatchIndex.set(system, i);", + " return;", + " }", + " }", + " let batch;", + " switch (settings.renderMode) {", + " case RenderMode.Trail:", + " batch = new TrailBatch(settings);", + " break;", + " case RenderMode.Mesh:", + " case RenderMode.BillBoard:", + " case RenderMode.VerticalBillBoard:", + " case RenderMode.HorizontalBillBoard:", + " case RenderMode.StretchedBillBoard:", + " batch = new SpriteBatch(settings);", + " break;", + " }", + " batch.addSystem(system);", + " this.batches.push(batch);", + " this.systemToBatchIndex.set(system, this.batches.length - 1);", + " this.add(batch);", + " }", + " deleteSystem(system) {", + " const batchIndex = this.systemToBatchIndex.get(system);", + " if (batchIndex != undefined) {", + " this.batches[batchIndex].removeSystem(system);", + " this.systemToBatchIndex.delete(system);", + " }", + " }", + " updateSystem(system) {", + " this.deleteSystem(system);", + " this.addSystem(system);", + " }", + " update(delta) {", + " this.systemToBatchIndex.forEach((value, ps) => {", + " ps.update(delta);", + " });", + " for (let i = 0; i < this.batches.length; i++) {", + " this.batches[i].update();", + " }", + " }", + "}", + "", + "const BatchedParticleRenderer = BatchedRenderer;", + "", + "class QuarksLoader extends THREE.ObjectLoader {", + " constructor(manager) {", + " super(manager);", + " }", + " linkReference(object) {", + " const objectsMap = {};", + " object.traverse(function (child) {", + " objectsMap[child.uuid] = child;", + " });", + " object.traverse(function (child) {", + " if (child.type === 'ParticleEmitter') {", + " const system = child.system;", + " system.emitterShape;", + " for (let i = 0; i < system.behaviors.length; i++) {", + " if (system.behaviors[i] instanceof EmitSubParticleSystem) {", + " system.behaviors[i].subParticleSystem = objectsMap[system.behaviors[i].subParticleSystem];", + " }", + " }", + " }", + " });", + " }", + " parse(json, onLoad) {", + " const object = super.parse(json, onLoad);", + " this.linkReference(object);", + " return object;", + " }", + " parseObject(data, geometries, materials, textures, animations) {", + " let object;", + " function getGeometry(name) {", + " if (geometries[name] === undefined) {", + " console.warn('THREE.ObjectLoader: Undefined geometry', name);", + " }", + " return geometries[name];", + " }", + " function getMaterial(name) {", + " if (name === undefined)", + " return undefined;", + " if (Array.isArray(name)) {", + " const array = [];", + " for (let i = 0, l = name.length; i < l; i++) {", + " const uuid = name[i];", + " if (materials[uuid] === undefined) {", + " console.warn('THREE.ObjectLoader: Undefined material', uuid);", + " }", + " array.push(materials[uuid]);", + " }", + " return array;", + " }", + " if (materials[name] === undefined) {", + " console.warn('THREE.ObjectLoader: Undefined material', name);", + " }", + " return materials[name];", + " }", + " function getTexture(uuid) {", + " if (textures[uuid] === undefined) {", + " console.warn('THREE.ObjectLoader: Undefined texture', uuid);", + " }", + " return textures[uuid];", + " }", + " let geometry, material;", + " const meta = {", + " textures: textures,", + " geometries: geometries,", + " materials: materials,", + " };", + " const dependencies = {};", + " switch (data.type) {", + " case 'ParticleEmitter':", + " object = ParticleSystem.fromJSON(data.ps, meta, dependencies).emitter;", + " break;", + " case 'Scene':", + " object = new THREE.Scene();", + " if (data.background !== undefined) {", + " if (Number.isInteger(data.background)) {", + " object.background = new THREE.Color(data.background);", + " }", + " else {", + " object.background = getTexture(data.background);", + " }", + " }", + " if (data.environment !== undefined) {", + " object.environment = getTexture(data.environment);", + " }", + " if (data.fog !== undefined) {", + " if (data.fog.type === 'Fog') {", + " object.fog = new THREE.Fog(data.fog.color, data.fog.near, data.fog.far);", + " }", + " else if (data.fog.type === 'FogExp2') {", + " object.fog = new THREE.FogExp2(data.fog.color, data.fog.density);", + " }", + " }", + " if (data.backgroundBlurriness !== undefined)", + " object.backgroundBlurriness = data.backgroundBlurriness;", + " break;", + " case 'PerspectiveCamera':", + " object = new THREE.PerspectiveCamera(data.fov, data.aspect, data.near, data.far);", + " if (data.focus !== undefined)", + " object.focus = data.focus;", + " if (data.zoom !== undefined)", + " object.zoom = data.zoom;", + " if (data.filmGauge !== undefined)", + " object.filmGauge = data.filmGauge;", + " if (data.filmOffset !== undefined)", + " object.filmOffset = data.filmOffset;", + " if (data.view !== undefined)", + " object.view = Object.assign({}, data.view);", + " break;", + " case 'OrthographicCamera':", + " object = new THREE.OrthographicCamera(data.left, data.right, data.top, data.bottom, data.near, data.far);", + " if (data.zoom !== undefined)", + " object.zoom = data.zoom;", + " if (data.view !== undefined)", + " object.view = Object.assign({}, data.view);", + " break;", + " case 'AmbientLight':", + " object = new THREE.AmbientLight(data.color, data.intensity);", + " break;", + " case 'DirectionalLight':", + " object = new THREE.DirectionalLight(data.color, data.intensity);", + " break;", + " case 'PointLight':", + " object = new THREE.PointLight(data.color, data.intensity, data.distance, data.decay);", + " break;", + " case 'RectAreaLight':", + " object = new THREE.RectAreaLight(data.color, data.intensity, data.width, data.height);", + " break;", + " case 'SpotLight':", + " object = new THREE.SpotLight(data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay);", + " break;", + " case 'HemisphereLight':", + " object = new THREE.HemisphereLight(data.color, data.groundColor, data.intensity);", + " break;", + " case 'LightProbe':", + " object = new THREE.LightProbe().fromJSON(data);", + " break;", + " case 'SkinnedMesh':", + " geometry = getGeometry(data.geometry);", + " material = getMaterial(data.material);", + " object = new THREE.SkinnedMesh(geometry, material);", + " if (data.bindMode !== undefined)", + " object.bindMode = data.bindMode;", + " if (data.bindMatrix !== undefined)", + " object.bindMatrix.fromArray(data.bindMatrix);", + " if (data.skeleton !== undefined)", + " object.skeleton = data.skeleton;", + " break;", + " case 'Mesh':", + " geometry = getGeometry(data.geometry);", + " material = getMaterial(data.material);", + " object = new THREE.Mesh(geometry, material);", + " break;", + " case 'InstancedMesh': {", + " geometry = getGeometry(data.geometry);", + " material = getMaterial(data.material);", + " const count = data.count;", + " const instanceMatrix = data.instanceMatrix;", + " const instanceColor = data.instanceColor;", + " object = new THREE.InstancedMesh(geometry, material, count);", + " object.instanceMatrix = new THREE.InstancedBufferAttribute(new Float32Array(instanceMatrix.array), 16);", + " if (instanceColor !== undefined)", + " object.instanceColor = new THREE.InstancedBufferAttribute(new Float32Array(instanceColor.array), instanceColor.itemSize);", + " break;", + " }", + " case 'LOD':", + " object = new THREE.LOD();", + " break;", + " case 'Line':", + " object = new THREE.Line(getGeometry(data.geometry), getMaterial(data.material));", + " break;", + " case 'LineLoop':", + " object = new THREE.LineLoop(getGeometry(data.geometry), getMaterial(data.material));", + " break;", + " case 'LineSegments':", + " object = new THREE.LineSegments(getGeometry(data.geometry), getMaterial(data.material));", + " break;", + " case 'PointCloud':", + " case 'Points':", + " object = new THREE.Points(getGeometry(data.geometry), getMaterial(data.material));", + " break;", + " case 'Sprite':", + " object = new THREE.Sprite(getMaterial(data.material));", + " break;", + " case 'Group':", + " object = new THREE.Group();", + " break;", + " case 'Bone':", + " object = new THREE.Bone();", + " break;", + " default:", + " object = new THREE.Object3D();", + " }", + " object.uuid = data.uuid;", + " if (data.name !== undefined)", + " object.name = data.name;", + " if (data.matrix !== undefined) {", + " object.matrix.fromArray(data.matrix);", + " if (data.matrixAutoUpdate !== undefined)", + " object.matrixAutoUpdate = data.matrixAutoUpdate;", + " if (object.matrixAutoUpdate)", + " object.matrix.decompose(object.position, object.quaternion, object.scale);", + " }", + " else {", + " if (data.position !== undefined)", + " object.position.fromArray(data.position);", + " if (data.rotation !== undefined)", + " object.rotation.fromArray(data.rotation);", + " if (data.quaternion !== undefined)", + " object.quaternion.fromArray(data.quaternion);", + " if (data.scale !== undefined)", + " object.scale.fromArray(data.scale);", + " }", + " if (data.castShadow !== undefined)", + " object.castShadow = data.castShadow;", + " if (data.receiveShadow !== undefined)", + " object.receiveShadow = data.receiveShadow;", + " if (data.shadow) {", + " if (data.shadow.bias !== undefined)", + " object.shadow.bias = data.shadow.bias;", + " if (data.shadow.normalBias !== undefined)", + " object.normalBias = data.shadow.normalBias;", + " if (data.shadow.radius !== undefined)", + " object.radius = data.shadow.radius;", + " if (data.shadow.mapSize !== undefined)", + " object.mapSize.fromArray(data.shadow.mapSize);", + " if (data.shadow.camera !== undefined) {", + " object.camera = this.parseObject(data.shadow.camera);", + " }", + " }", + " if (data.visible !== undefined)", + " object.visible = data.visible;", + " if (data.frustumCulled !== undefined)", + " object.frustumCulled = data.frustumCulled;", + " if (data.renderOrder !== undefined)", + " object.renderOrder = data.renderOrder;", + " if (data.userData !== undefined)", + " object.userData = data.userData;", + " if (data.layers !== undefined)", + " object.layers.mask = data.layers;", + " if (data.children !== undefined) {", + " const children = data.children;", + " for (let i = 0; i < children.length; i++) {", + " object.add(this.parseObject(children[i], geometries, materials, textures, animations));", + " }", + " }", + " if (data.animations !== undefined) {", + " const objectAnimations = data.animations;", + " for (let i = 0; i < objectAnimations.length; i++) {", + " const uuid = objectAnimations[i];", + " object.animations.push(animations[uuid]);", + " }", + " }", + " if (data.type === 'LOD') {", + " if (data.autoUpdate !== undefined)", + " object.autoUpdate = data.autoUpdate;", + " const levels = data.levels;", + " for (let l = 0; l < levels.length; l++) {", + " const level = levels[l];", + " const child = object.getObjectByProperty('uuid', level.object);", + " if (child !== undefined) {", + " object.addLevel(child, level.distance);", + " }", + " }", + " }", + " return object;", + " }", + "}", + "", + "const Plugins = [];", + "function loadPlugin(plugin) {", + " const existing = Plugins.find((item) => item.id === plugin.id);", + " if (!existing) {", + " plugin.initialize();", + " for (const emitterShape of plugin.emitterShapes) {", + " if (!EmitterShapes[emitterShape.type]) {", + " EmitterShapes[emitterShape.type] = emitterShape;", + " }", + " }", + " for (const behavior of plugin.behaviors) {", + " if (!BehaviorTypes[behavior.type]) {", + " BehaviorTypes[behavior.type] = behavior;", + " }", + " }", + " }", + "}", + "function unloadPlugin(pluginId) {", + " const plugin = Plugins.find((item) => item.id === pluginId);", + " if (plugin) {", + " for (const emitterShape of plugin.emitterShapes) {", + " if (EmitterShapes[emitterShape.type]) {", + " delete EmitterShapes[emitterShape.type];", + " }", + " }", + " for (const behavior of plugin.behaviors) {", + " if (BehaviorTypes[behavior.type]) {", + " delete BehaviorTypes[behavior.type];", + " }", + " }", + " }", + "}", + "", + "let NodeValueType = void 0;", + "(function (NodeValueType) {", + " NodeValueType[NodeValueType[\"Number\"] = 0] = \"Number\";", + " NodeValueType[NodeValueType[\"Vec2\"] = 1] = \"Vec2\";", + " NodeValueType[NodeValueType[\"Vec3\"] = 2] = \"Vec3\";", + " NodeValueType[NodeValueType[\"Vec4\"] = 3] = \"Vec4\";", + " NodeValueType[NodeValueType[\"Boolean\"] = 4] = \"Boolean\";", + " NodeValueType[NodeValueType[\"AnyType\"] = 5] = \"AnyType\";", + " NodeValueType[NodeValueType[\"NullableAnyType\"] = 6] = \"NullableAnyType\";", + " NodeValueType[NodeValueType[\"EventStream\"] = 7] = \"EventStream\";", + "})(NodeValueType || (NodeValueType = {}));", + "const genDefaultForNodeValueType = (type) => {", + " switch (type) {", + " case NodeValueType.Boolean:", + " return false;", + " case NodeValueType.Number:", + " return 0;", + " case NodeValueType.Vec2:", + " return new THREE.Vector2();", + " case NodeValueType.Vec3:", + " return new THREE.Vector3();", + " case NodeValueType.Vec4:", + " return new THREE.Vector4();", + " case NodeValueType.AnyType:", + " return 0;", + " case NodeValueType.NullableAnyType:", + " return undefined;", + " }", + "};", + "", + "class Node {", + " constructor(type, signatureIndex = -1, data = {}) {", + " this.inputs = [];", + " this.outputs = [];", + " this.signatureIndex = -1;", + " this.position = new THREE.Vector2();", + " this.outputValues = [];", + " this.id = '' + Math.round(Math.random() * 100000);", + " this.type = type;", + " this.signatureIndex = signatureIndex;", + " this.data = data;", + " const realIndex = signatureIndex === -1 ? 0 : signatureIndex;", + " for (let i = 0; i < type.nodeTypeSignatures[realIndex].inputTypes.length; i++) {", + " this.inputs.push(undefined);", + " }", + " for (let i = 0; i < type.nodeTypeSignatures[realIndex].outputTypes.length; i++) {", + " this.outputs.push([]);", + " this.outputValues.push(genDefaultForNodeValueType(type.nodeTypeSignatures[realIndex].outputTypes[i]));", + " }", + " }", + " get inputTypes() {", + " const signatureIndex = this.signatureIndex === -1 ? 0 : this.signatureIndex;", + " return this.type.nodeTypeSignatures[signatureIndex].inputTypes;", + " }", + " get outputTypes() {", + " const signatureIndex = this.signatureIndex === -1 ? 0 : this.signatureIndex;", + " return this.type.nodeTypeSignatures[signatureIndex].outputTypes;", + " }", + " func(context, inputs, outputs) {", + " const signatureIndex = this.signatureIndex === -1 ? 0 : this.signatureIndex;", + " this.type.nodeTypeSignatures[signatureIndex].func(context, this.data, inputs, outputs);", + " }", + "}", + "class Wire {", + " constructor(input, inputIndex, output, outputIndex) {", + " this.input = input;", + " this.inputIndex = inputIndex;", + " this.input.outputs[inputIndex].push(this);", + " this.output = output;", + " this.outputIndex = outputIndex;", + " this.output.inputs[outputIndex] = this;", + " }", + "}", + "", + "class BaseCompiler {", + " constructor() {", + " this.visited = new Set();", + " BaseCompiler.Instance = this;", + " }", + " buildExecutionOrder(graph, context) {", + " graph.nodesInOrder.length = 0;", + " this.visited.clear();", + " for (let i = 0; i < graph.outputNodes.length; i++) {", + " const node = graph.outputNodes[i];", + " if (node.inputs[0] !== undefined) {", + " this._traverse(node, graph, context);", + " }", + " }", + " graph.compiled = true;", + " }", + " _traverse(node, graph, context) {", + " this.visited.add(node.id);", + " for (let i = 0; i < node.inputs.length; i++) {", + " if (node.inputs[i] instanceof Wire) {", + " const inputNode = node.inputs[i].input;", + " if (!this.visited.has(inputNode.id)) {", + " this._traverse(inputNode, graph, context);", + " }", + " }", + " else if (node.inputs[i] !== undefined);", + " else;", + " }", + " graph.nodesInOrder.push(node);", + " }", + "}", + "", + "class Interpreter extends BaseCompiler {", + " constructor() {", + " super();", + " }", + " executeCompiledGraph(graph, context) {", + " const nodes = graph.nodesInOrder;", + " for (let i = 0; i < nodes.length; i++) {", + " const inputValues = [];", + " const node = nodes[i];", + " for (let j = 0; j < node.inputs.length; j++) {", + " if (node.inputs[j] instanceof Wire) {", + " inputValues.push(node.inputs[j].input.outputValues[node.inputs[j].inputIndex]);", + " }", + " else if (node.inputs[j] !== undefined) {", + " inputValues.push(node.inputs[j].getValue(context));", + " }", + " else {", + " inputValues.push(undefined);", + " }", + " }", + " node.func(context, inputValues, node.outputValues);", + " }", + " }", + " run(graph, context) {", + " if (!graph.compiled) {", + " this.buildExecutionOrder(graph, context);", + " }", + " this.executeCompiledGraph(graph, context);", + " }", + "}", + "", + "class NodeType {", + " constructor(name) {", + " this.nodeTypeSignatures = [];", + " this.name = name;", + " }", + " addSignature(inputTypes, outputTypes, func) {", + " this.nodeTypeSignatures.push({", + " inputTypes: inputTypes,", + " outputTypes: outputTypes,", + " func: func,", + " });", + " }", + "}", + "class GraphNodeType extends NodeType {", + " constructor(nodeGraph) {", + " const inputTypes = [];", + " for (let i = 0; i < nodeGraph.inputNodes.length; i++) {", + " if (nodeGraph.inputNodes[i].type.name === 'input') {", + " inputTypes.push(nodeGraph.inputNodes[i].data.type);", + " }", + " }", + " const outputTypes = [];", + " for (let i = 0; i < nodeGraph.outputNodes.length; i++) {", + " if (nodeGraph.outputNodes[i].type.name === 'output') {", + " outputTypes.push(nodeGraph.outputNodes[i].data.type);", + " }", + " }", + " super(nodeGraph.name);", + " this.addSignature(inputTypes, outputTypes, (context, data, inputs, outputs) => {", + " context.inputs = inputs;", + " context.outputs = outputs;", + " Interpreter.Instance.run(nodeGraph, context);", + " });", + " this.nodeGraph = nodeGraph;", + " }", + "}", + "", + "const NodeTypes = {};", + "const addNode = new NodeType('add');", + "addNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] + inputs[1];", + "});", + "addNode.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].addVectors(inputs[0], inputs[1]);", + "});", + "addNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].addVectors(inputs[0], inputs[1]);", + "});", + "addNode.addSignature([NodeValueType.Vec4, NodeValueType.Vec4], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].addVectors(inputs[0], inputs[1]);", + "});", + "NodeTypes['add'] = addNode;", + "const subNode = new NodeType('sub');", + "subNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] - inputs[1];", + "});", + "subNode.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].subVectors(inputs[0], inputs[1]);", + "});", + "subNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].subVectors(inputs[0], inputs[1]);", + "});", + "subNode.addSignature([NodeValueType.Vec4, NodeValueType.Vec4], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].subVectors(inputs[0], inputs[1]);", + "});", + "NodeTypes['sub'] = subNode;", + "const mulNode = new NodeType('mul');", + "mulNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] * inputs[1];", + "});", + "mulNode.addSignature([NodeValueType.Vec2, NodeValueType.Number], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).multiplyScalar(inputs[1]);", + "});", + "mulNode.addSignature([NodeValueType.Vec3, NodeValueType.Number], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).multiplyScalar(inputs[1]);", + "});", + "mulNode.addSignature([NodeValueType.Vec4, NodeValueType.Number], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).multiplyScalar(inputs[1]);", + "});", + "NodeTypes['mul'] = mulNode;", + "const divNode = new NodeType('div');", + "divNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] / inputs[1];", + "});", + "divNode.addSignature([NodeValueType.Vec2, NodeValueType.Number], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).divideScalar(inputs[1]);", + "});", + "divNode.addSignature([NodeValueType.Vec3, NodeValueType.Number], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).divideScalar(inputs[1]);", + "});", + "divNode.addSignature([NodeValueType.Vec4, NodeValueType.Number], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).divideScalar(inputs[1]);", + "});", + "NodeTypes['div'] = divNode;", + "const sinNode = new NodeType('sin');", + "sinNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.sin(inputs[0]);", + "});", + "NodeTypes['sin'] = sinNode;", + "const cosNode = new NodeType('cos');", + "cosNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.cos(inputs[0]);", + "});", + "NodeTypes['cos'] = cosNode;", + "const tanNode = new NodeType('tan');", + "tanNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.tan(inputs[0]);", + "});", + "NodeTypes['tan'] = tanNode;", + "const absNode = new NodeType('abs');", + "absNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.abs(inputs[0]);", + "});", + "NodeTypes['abs'] = absNode;", + "const minNode = new NodeType('min');", + "minNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.min(inputs[0], inputs[1]);", + "});", + "NodeTypes['min'] = minNode;", + "const maxNode = new NodeType('max');", + "maxNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.max(inputs[0], inputs[1]);", + "});", + "NodeTypes['max'] = maxNode;", + "const dot = new NodeType('dot');", + "dot.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].dot(inputs[1]);", + "});", + "dot.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].dot(inputs[1]);", + "});", + "dot.addSignature([NodeValueType.Vec4, NodeValueType.Vec4], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].dot(inputs[1]);", + "});", + "NodeTypes['dot'] = dot;", + "const cross = new NodeType('cross');", + "cross.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].crossVectors(inputs[0], inputs[1]);", + "});", + "NodeTypes['cross'] = cross;", + "const length = new NodeType('length');", + "length.addSignature([NodeValueType.Vec2], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].length();", + "});", + "length.addSignature([NodeValueType.Vec3], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].length();", + "});", + "length.addSignature([NodeValueType.Vec4], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].length();", + "});", + "NodeTypes['length'] = length;", + "const lengthSq = new NodeType('lengthSq');", + "lengthSq.addSignature([NodeValueType.Vec2], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].lengthSq();", + "});", + "lengthSq.addSignature([NodeValueType.Vec3], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].lengthSq();", + "});", + "lengthSq.addSignature([NodeValueType.Vec4], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].lengthSq();", + "});", + "NodeTypes['lengthSq'] = lengthSq;", + "const normalize = new NodeType('normalize');", + "normalize.addSignature([NodeValueType.Vec2], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).normalize();", + "});", + "normalize.addSignature([NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).normalize();", + "});", + "normalize.addSignature([NodeValueType.Vec4], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).normalize();", + "});", + "NodeTypes['normalize'] = normalize;", + "const distance = new NodeType('distance');", + "distance.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].distanceTo(inputs[1]);", + "});", + "distance.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].distanceTo(inputs[1]);", + "});", + "NodeTypes['distance'] = distance;", + "const andNode = new NodeType('and');", + "andNode.addSignature([NodeValueType.Boolean, NodeValueType.Boolean], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] && inputs[1];", + "});", + "NodeTypes['and'] = andNode;", + "const orNode = new NodeType('or');", + "orNode.addSignature([NodeValueType.Boolean, NodeValueType.Boolean], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] || inputs[1];", + "});", + "NodeTypes['or'] = orNode;", + "const notNode = new NodeType('not');", + "notNode.addSignature([NodeValueType.Boolean], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = !inputs[0];", + "});", + "NodeTypes['not'] = notNode;", + "const equalNode = new NodeType('equal');", + "equalNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] === inputs[1];", + "});", + "equalNode.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].equals(inputs[1]);", + "});", + "equalNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].equals(inputs[1]);", + "});", + "equalNode.addSignature([NodeValueType.Vec4, NodeValueType.Vec4], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].equals(inputs[1]);", + "});", + "NodeTypes['equal'] = equalNode;", + "const lessThanNode = new NodeType('lessThan');", + "lessThanNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] < inputs[1];", + "});", + "NodeTypes['lessThan'] = lessThanNode;", + "const greaterThanNode = new NodeType('greaterThan');", + "greaterThanNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] > inputs[1];", + "});", + "NodeTypes['greaterThan'] = greaterThanNode;", + "const lessThanOrEqualNode = new NodeType('lessThanOrEqual');", + "lessThanOrEqualNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] <= inputs[1];", + "});", + "NodeTypes['lessThanOrEqual'] = lessThanOrEqualNode;", + "const greaterThanOrEqualNode = new NodeType('greaterThanOrEqual');", + "greaterThanOrEqualNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] >= inputs[1];", + "});", + "NodeTypes['greaterThanOrEqual'] = greaterThanOrEqualNode;", + "const ifNode = new NodeType('if');", + "ifNode.addSignature([NodeValueType.Boolean, NodeValueType.AnyType, NodeValueType.AnyType], [NodeValueType.AnyType], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] ? inputs[1] : inputs[2];", + "});", + "NodeTypes['if'] = ifNode;", + "const numberNode = new NodeType('number');", + "numberNode.addSignature([], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = data.value;", + "});", + "NodeTypes['number'] = numberNode;", + "const vec2Node = new NodeType('vec2');", + "vec2Node.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].x = inputs[0];", + " outputs[0].y = inputs[1];", + "});", + "NodeTypes['vec2'] = vec2Node;", + "const vec3Node = new NodeType('vec3');", + "vec3Node.addSignature([NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].x = inputs[0];", + " outputs[0].y = inputs[1];", + " outputs[0].z = inputs[2];", + "});", + "NodeTypes['vec3'] = vec3Node;", + "const vec4Node = new NodeType('vec4');", + "vec4Node.addSignature([NodeValueType.Number, NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].x = inputs[0];", + " outputs[0].y = inputs[1];", + " outputs[0].z = inputs[2];", + " outputs[0].w = inputs[3];", + "});", + "NodeTypes['vec4'] = vec4Node;", + "const splitVec2Node = new NodeType('splitVec2');", + "splitVec2Node.addSignature([NodeValueType.Vec2], [NodeValueType.Number, NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].x;", + " outputs[1] = inputs[0].y;", + "});", + "NodeTypes['splitVec2'] = splitVec2Node;", + "const splitVec3Node = new NodeType('splitVec3');", + "splitVec3Node.addSignature([NodeValueType.Vec3], [NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].x;", + " outputs[1] = inputs[0].y;", + " outputs[2] = inputs[0].z;", + "});", + "NodeTypes['splitVec3'] = splitVec3Node;", + "const splitVec4Node = new NodeType('splitVec4');", + "splitVec4Node.addSignature([NodeValueType.Vec4], [NodeValueType.Number, NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].x;", + " outputs[1] = inputs[0].y;", + " outputs[2] = inputs[0].z;", + " outputs[3] = inputs[0].w;", + "});", + "NodeTypes['splitVec4'] = splitVec4Node;", + "const boolNode = new NodeType('bool');", + "boolNode.addSignature([], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = data.value;", + "});", + "NodeTypes['bool'] = boolNode;", + "const particlePropertyNode = new NodeType('particleProperty');", + "particlePropertyNode.addSignature([NodeValueType.NullableAnyType], [NodeValueType.NullableAnyType], (context, data, inputs, outputs) => {", + " if (inputs[0] !== undefined) {", + " if (typeof inputs[0] === 'object') {", + " context.particle[data.property].copy(inputs[0]);", + " }", + " else {", + " context.particle[data.property] = inputs[0];", + " }", + " }", + " if (context.particle[data.property] !== undefined) {", + " if (typeof outputs[0] === 'object') {", + " outputs[0].copy(context.particle[data.property]);", + " }", + " else {", + " outputs[0] = context.particle[data.property];", + " }", + " }", + "});", + "NodeTypes['particleProperty'] = particlePropertyNode;", + "const emitNode = new NodeType('emit');", + "emitNode.addSignature([NodeValueType.EventStream], [], (context, data, inputs, outputs) => {", + " const arr = inputs[0];", + " for (let i = 0; i < arr.length; i++) {", + " context.signal(i, arr[i]);", + " }", + "});", + "NodeTypes['emit'] = emitNode;", + "const graphPropertyNode = new NodeType('graphProperty');", + "graphPropertyNode.addSignature([NodeValueType.NullableAnyType], [NodeValueType.NullableAnyType], (context, data, inputs, outputs) => {", + " if (inputs[0] !== undefined) {", + " if (typeof inputs[0] === 'object') {", + " context.graph[data.property].copy(inputs[0]);", + " }", + " else {", + " context.graph[data.property] = inputs[0];", + " }", + " }", + " if (context.graph[data.property] !== undefined) {", + " if (typeof outputs[0] === 'object') {", + " outputs[0].copy(context.graph[data.property]);", + " }", + " else {", + " outputs[0] = context.graph[data.property];", + " }", + " }", + "});", + "NodeTypes['graphProperty'] = graphPropertyNode;", + "const startEventNode = new NodeType('startEvent');", + "startEventNode.addSignature([], [NodeValueType.EventStream], (context, data, inputs, outputs) => {", + " outputs[0] = [{ type: 'start' }];", + "});", + "NodeTypes['startEvent'] = startEventNode;", + "const repeaterNode = new NodeType('repeater');", + "repeaterNode.addSignature([NodeValueType.EventStream, NodeValueType.Number], [NodeValueType.EventStream], (context, data, inputs, outputs) => {", + " const arr = inputs[0];", + " const count = inputs[1];", + " const result = [];", + " for (let j = 0; j < arr.length; j++) {", + " for (let i = 0; i < count; i++) {", + " result.push(arr[j]);", + " }", + " }", + " outputs[0] = result;", + "});", + "NodeTypes['repeater'] = repeaterNode;", + "const timeNode = new NodeType('time');", + "timeNode.addSignature([], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = context.emissionState.time;", + "});", + "NodeTypes['time'] = timeNode;", + "const deltaNode = new NodeType('delta');", + "deltaNode.addSignature([], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = context.delta;", + "});", + "NodeTypes['delta'] = deltaNode;", + "const outputNode = new NodeType('output');", + "outputNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0];", + "});", + "outputNode.addSignature([NodeValueType.Vec2], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0];", + "});", + "outputNode.addSignature([NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0];", + "});", + "outputNode.addSignature([NodeValueType.Vec4], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0];", + "});", + "outputNode.addSignature([NodeValueType.Boolean], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0];", + "});", + "NodeTypes['output'] = outputNode;", + "const lerpNode = new NodeType('lerp');", + "lerpNode.addSignature([NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] =", + " inputs[0] * (1 - inputs[2]) + inputs[1] * inputs[2];", + "});", + "lerpNode.addSignature([NodeValueType.Vec2, NodeValueType.Vec2, NodeValueType.Number], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].lerpVectors(inputs[0], inputs[1], inputs[2]);", + "});", + "lerpNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3, NodeValueType.Number], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].lerpVectors(inputs[0], inputs[1], inputs[2]);", + "});", + "lerpNode.addSignature([NodeValueType.Vec4, NodeValueType.Vec4, NodeValueType.Number], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].lerpVectors(inputs[0], inputs[1], inputs[2]);", + "});", + "NodeTypes['lerp'] = lerpNode;", + "const normalD = (x) => {", + " return (1 / Math.sqrt(2 * Math.PI)) * Math.exp(x * x * -0.5);", + "};", + "const normalDistributionNode = new NodeType('normDistrib');", + "normalDistributionNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = normalD(inputs[0]);", + "});", + "NodeTypes['normDistrib'] = normalDistributionNode;", + "const normcdfNode = new NodeType('normcdf');", + "normcdfNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " let x = inputs[0];", + " const a1 = 0.254829592;", + " const a2 = -0.284496736;", + " const a3 = 1.421413741;", + " const a4 = -1.453152027;", + " const a5 = 1.061405429;", + " const p = 0.3275911;", + " let sign = 1;", + " if (x < 0)", + " sign = -1;", + " x = Math.abs(x) / Math.sqrt(2.0);", + " const t = 1.0 / (1.0 + p * x);", + " const y = 1.0 - ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t * Math.exp(-x * x);", + " outputs[0] = 0.5 * (1.0 + sign * y);", + "});", + "NodeTypes['normcdf'] = normcdfNode;", + "const normcdfInvNode = new NodeType('normcdfInv');", + "const rationalApproximation = (t) => {", + " const c = [2.515517, 0.802853, 0.010328];", + " const d = [1.432788, 0.189269, 0.001308];", + " return t - ((c[2] * t + c[1]) * t + c[0]) / (((d[2] * t + d[1]) * t + d[0]) * t + 1.0);", + "};", + "const normcdfInv = (p) => {", + " if (p < 0.5) {", + " return -rationalApproximation(Math.sqrt(-2.0 * Math.log(p)));", + " }", + " else {", + " return rationalApproximation(Math.sqrt(-2.0 * Math.log(1 - p)));", + " }", + "};", + "normcdfInvNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = normcdfInv(inputs[0]);", + "});", + "NodeTypes['normcdfInv'] = normcdfInvNode;", + "const clampNode = new NodeType('clamp');", + "clampNode.addSignature([NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.max(Math.min(inputs[0], inputs[2]), inputs[1]);", + "});", + "NodeTypes['clamp'] = clampNode;", + "const smoothstepNode = new NodeType('smoothstep');", + "smoothstepNode.addSignature([NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " const x = Math.max(Math.min(inputs[0], inputs[2]), inputs[1]);", + " outputs[0] = x * x * (3 - 2 * x);", + "});", + "NodeTypes['smoothstep'] = smoothstepNode;", + "const randomNode = new NodeType('random');", + "randomNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.random() * (inputs[1] - inputs[0]) + inputs[0];", + "});", + "randomNode.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " let random = Math.random();", + " outputs[0].lerpVectors(inputs[0], inputs[1], random);", + "});", + "randomNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " let random = Math.random();", + " outputs[0].lerpVectors(inputs[0], inputs[1], random);", + "});", + "randomNode.addSignature([NodeValueType.Vec4, NodeValueType.Vec4], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " let random = Math.random();", + " outputs[0].lerpVectors(inputs[0], inputs[1], random);", + "});", + "NodeTypes['random'] = randomNode;", + "const vrandNode = new NodeType('vrand');", + "vrandNode.addSignature([], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " let x = normcdfInv(Math.random());", + " let y = normcdfInv(Math.random());", + " const mag = Math.sqrt(x * x + y * y);", + " outputs[0].set(x / mag, y / mag);", + "});", + "vrandNode.addSignature([], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " let x = normcdfInv(Math.random());", + " let y = normcdfInv(Math.random());", + " let z = normcdfInv(Math.random());", + " const mag = Math.sqrt(x * x + y * y + z * z);", + " outputs[0].set(x / mag, y / mag, z / mag);", + "});", + "vrandNode.addSignature([], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " let x = normcdfInv(Math.random());", + " let y = normcdfInv(Math.random());", + " let z = normcdfInv(Math.random());", + " let w = normcdfInv(Math.random());", + " const mag = Math.sqrt(x * x + y * y + z * z + w * w);", + " outputs[0].set(x / mag, y / mag, z / mag, w / mag);", + "});", + "NodeTypes['vrand'] = vrandNode;", + "const bsdfNode = new NodeType('bsdf');", + "bsdfNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3, NodeValueType.Vec3, NodeValueType.Number], [], (context, data, inputs, outputs) => { });", + "NodeTypes['bsdf'] = bsdfNode;", + "const OutputNodeTypeNames = new Set(['output', 'particleProperty', 'graphProperty', 'emit']);", + "", + "class NodeGraph {", + " constructor(name) {", + " this.inputNodes = [];", + " this.outputNodes = [];", + " this.allNodes = new Map();", + " this.wires = [];", + " this.compiled = false;", + " this.nodesInOrder = [];", + " this.version = '1.0';", + " this.uuid = THREE.MathUtils.generateUUID();", + " this.name = name;", + " this.revision = 0;", + " }", + " addWire(wire) {", + " this.wires.push(wire);", + " this.revision++;", + " }", + " addNode(node) {", + " this.allNodes.set(node.id, node);", + " if (node.type === NodeTypes['input']) {", + " this.inputNodes.push(node);", + " }", + " else if (OutputNodeTypeNames.has(node.type.name)) {", + " this.outputNodes.push(node);", + " }", + " this.revision++;", + " }", + " getNode(id) {", + " return this.allNodes.get(id);", + " }", + " deleteNode(node) {", + " this.allNodes.delete(node.id);", + " this.revision++;", + " }", + " deleteWire(wire) {", + " let index = wire.input.outputs[wire.inputIndex].indexOf(wire);", + " if (index !== -1) {", + " wire.input.outputs[wire.inputIndex].splice(index, 1);", + " }", + " wire.output.inputs[wire.outputIndex] = undefined;", + " index = this.wires.indexOf(wire);", + " if (index != -1) {", + " this.wires[index] = this.wires[this.wires.length - 1];", + " this.wires.pop();", + " }", + " this.revision++;", + " }", + " toJSON() {", + " throw new Error('not implemented');", + " }", + " clone() {", + " throw new Error('not implemented');", + " }", + "}", + "", + "new THREE.Vector3(0, 0, 1);", + "const tempQ = new THREE.Quaternion();", + "const tempV = new THREE.Vector3();", + "const tempV2 = new THREE.Vector3();", + "const PREWARM_FPS = 60;", + "const DEFAULT_GEOMETRY = new THREE.PlaneGeometry(1, 1, 1, 1);", + "class NodeVFX {", + " set time(time) {", + " this.emissionState.time = time;", + " }", + " get time() {", + " return this.emissionState.time;", + " }", + " get layers() {", + " return this.rendererSettings.layers;", + " }", + " get texture() {", + " return this.rendererSettings.material.map;", + " }", + " set texture(texture) {", + " this.rendererSettings.material.map = texture;", + " this.neededToUpdateRender = true;", + " }", + " get material() {", + " return this.rendererSettings.material;", + " }", + " set material(material) {", + " this.rendererSettings.material = material;", + " this.neededToUpdateRender = true;", + " }", + " get instancingGeometry() {", + " return this.rendererSettings.instancingGeometry;", + " }", + " set instancingGeometry(geometry) {", + " this.restart();", + " this.particles.length = 0;", + " this.rendererSettings.instancingGeometry = geometry;", + " this.neededToUpdateRender = true;", + " }", + " get renderMode() {", + " return this.rendererSettings.renderMode;", + " }", + " set renderMode(renderMode) {", + " if ((this.rendererSettings.renderMode != RenderMode.Trail && renderMode === RenderMode.Trail) ||", + " (this.rendererSettings.renderMode == RenderMode.Trail && renderMode !== RenderMode.Trail)) {", + " this.restart();", + " this.particles.length = 0;", + " }", + " if (this.rendererSettings.renderMode !== renderMode) {", + " switch (renderMode) {", + " case RenderMode.Trail:", + " this.rendererEmitterSettings = {", + " startLength: 30,", + " followLocalOrigin: false,", + " };", + " break;", + " case RenderMode.Mesh:", + " this.rendererEmitterSettings = {", + " geometry: new THREE.PlaneGeometry(1, 1),", + " };", + " break;", + " case RenderMode.BillBoard:", + " case RenderMode.VerticalBillBoard:", + " case RenderMode.HorizontalBillBoard:", + " case RenderMode.StretchedBillBoard:", + " this.rendererEmitterSettings = {};", + " break;", + " }", + " }", + " this.rendererSettings.renderMode = renderMode;", + " this.neededToUpdateRender = true;", + " }", + " get renderOrder() {", + " return this.rendererSettings.renderOrder;", + " }", + " set renderOrder(renderOrder) {", + " this.rendererSettings.renderOrder = renderOrder;", + " this.neededToUpdateRender = true;", + " }", + " get blending() {", + " return this.rendererSettings.material.blending;", + " }", + " set blending(blending) {", + " this.rendererSettings.material.blending = blending;", + " this.neededToUpdateRender = true;", + " }", + " constructor(parameters) {", + " var _a, _b, _c, _d, _e, _f, _g;", + " this.temp = new THREE.Vector3();", + " this.travelDistance = 0;", + " this.normalMatrix = new THREE.Matrix3();", + " this.speedFactor = 0;", + " this.autoDestroy = parameters.autoDestroy === undefined ? false : parameters.autoDestroy;", + " this.duration = (_a = parameters.duration) !== null && _a !== void 0 ? _a : 1;", + " this.looping = parameters.looping === undefined ? true : parameters.looping;", + " this.prewarm = parameters.prewarm === undefined ? false : parameters.prewarm;", + " this.worldSpace = (_b = parameters.worldSpace) !== null && _b !== void 0 ? _b : false;", + " this.rendererEmitterSettings = (_c = parameters.rendererEmitterSettings) !== null && _c !== void 0 ? _c : {};", + " this.emissionGraph = parameters.emissionGraph;", + " this.updateGraph = parameters.updateGraph;", + " this.interpreter = new Interpreter();", + " this.rendererSettings = {", + " instancingGeometry: (_d = parameters.instancingGeometry) !== null && _d !== void 0 ? _d : DEFAULT_GEOMETRY,", + " renderMode: (_e = parameters.renderMode) !== null && _e !== void 0 ? _e : RenderMode.BillBoard,", + " renderOrder: (_f = parameters.renderOrder) !== null && _f !== void 0 ? _f : 0,", + " material: parameters.material,", + " layers: (_g = parameters.layers) !== null && _g !== void 0 ? _g : new THREE.Layers(),", + " uTileCount: 1,", + " vTileCount: 1,", + " };", + " this.neededToUpdateRender = true;", + " this.particles = new Array();", + " this.emitter = new ParticleEmitter(this);", + " this.paused = false;", + " this.particleNum = 0;", + " this.emissionState = {", + " time: 0,", + " };", + " this.emitEnded = false;", + " this.markForDestroy = false;", + " this.prewarmed = false;", + " }", + " pause() {", + " this.paused = true;", + " }", + " play() {", + " this.paused = false;", + " }", + " spawn(emissionState, matrix) {", + " tempQ.setFromRotationMatrix(matrix);", + " const translation = tempV;", + " const quaternion = tempQ;", + " const scale = tempV2;", + " matrix.decompose(translation, quaternion, scale);", + " this.particleNum++;", + " while (this.particles.length < this.particleNum) {", + " this.particles.push(new NodeParticle());", + " }", + " const particle = this.particles[this.particleNum - 1];", + " particle.reset();", + " this.interpreter.run(this.updateGraph, { particle: particle, emissionState: this.emissionState });", + " if (this.rendererSettings.renderMode === RenderMode.Trail &&", + " this.rendererEmitterSettings.followLocalOrigin) {", + " const trail = particle;", + " trail.localPosition = new THREE.Vector3().copy(trail.position);", + " }", + " if (this.worldSpace) {", + " particle.position.applyMatrix4(matrix);", + " particle.size *= (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z)) / 3;", + " particle.velocity.multiply(scale).applyMatrix3(this.normalMatrix);", + " if (particle.rotation && particle.rotation instanceof THREE.Quaternion) {", + " particle.rotation.multiplyQuaternions(tempQ, particle.rotation);", + " }", + " }", + " }", + " endEmit() {", + " this.emitEnded = true;", + " if (this.autoDestroy) {", + " this.markForDestroy = true;", + " }", + " }", + " dispose() {", + " if (this._renderer)", + " this._renderer.deleteSystem(this);", + " this.emitter.dispose();", + " if (this.emitter.parent)", + " this.emitter.parent.remove(this.emitter);", + " }", + " restart() {", + " this.paused = false;", + " this.particleNum = 0;", + " this.emissionState.time = 0;", + " this.emitEnded = false;", + " this.markForDestroy = false;", + " this.prewarmed = false;", + " }", + " update(delta) {", + " if (this.paused)", + " return;", + " let currentParent = this.emitter;", + " while (currentParent.parent) {", + " currentParent = currentParent.parent;", + " }", + " if (currentParent.type !== 'Scene') {", + " this.dispose();", + " return;", + " }", + " if (this.emitEnded && this.particleNum === 0) {", + " if (this.markForDestroy && this.emitter.parent)", + " this.dispose();", + " return;", + " }", + " if (this.looping && this.prewarm && !this.prewarmed) {", + " this.prewarmed = true;", + " for (let i = 0; i < this.duration * PREWARM_FPS; i++) {", + " this.update(1.0 / PREWARM_FPS);", + " }", + " }", + " if (delta > 0.1) {", + " delta = 0.1;", + " }", + " if (this.neededToUpdateRender) {", + " if (this._renderer)", + " this._renderer.updateSystem(this);", + " this.neededToUpdateRender = false;", + " }", + " this.emit(delta, this.emissionState, this.emitter.matrixWorld);", + " const context = { particle: undefined, emissionState: this.emissionState, delta };", + " for (let i = 0; i < this.particleNum; i++) {", + " context.particle = this.particles[i];", + " this.interpreter.run(this.updateGraph, context);", + " }", + " for (let i = 0; i < this.particleNum; i++) {", + " if (this.rendererEmitterSettings.followLocalOrigin &&", + " this.particles[i].localPosition) {", + " this.particles[i].position.copy(this.particles[i].localPosition);", + " if (this.particles[i].parentMatrix) {", + " this.particles[i].position.applyMatrix4(this.particles[i].parentMatrix);", + " }", + " else {", + " this.particles[i].position.applyMatrix4(this.emitter.matrixWorld);", + " }", + " }", + " else {", + " this.particles[i].position.addScaledVector(this.particles[i].velocity, delta);", + " }", + " this.particles[i].age += delta;", + " }", + " if (this.rendererSettings.renderMode === RenderMode.Trail) {", + " for (let i = 0; i < this.particleNum; i++) {", + " const particle = this.particles[i];", + " particle.update();", + " }", + " }", + " for (let i = 0; i < this.particleNum; i++) {", + " const particle = this.particles[i];", + " if (particle.died && (!(particle instanceof TrailParticle) || particle.previous.length === 0)) {", + " this.particles[i] = this.particles[this.particleNum - 1];", + " this.particles[this.particleNum - 1] = particle;", + " this.particleNum--;", + " i--;", + " }", + " }", + " }", + " emit(delta, emissionState, emitterMatrix) {", + " if (emissionState.time > this.duration) {", + " if (this.looping) {", + " emissionState.time -= this.duration;", + " }", + " else {", + " if (!this.emitEnded) {", + " this.endEmit();", + " }", + " }", + " }", + " this.normalMatrix.getNormalMatrix(emitterMatrix);", + " const context = {", + " signal: () => {", + " this.spawn(emissionState, emitterMatrix);", + " },", + " emissionState,", + " delta,", + " };", + " if (!this.emitEnded) {", + " this.interpreter.run(this.emissionGraph, context);", + " }", + " if (this.previousWorldPos === undefined)", + " this.previousWorldPos = new THREE.Vector3();", + " this.emitter.getWorldPosition(this.previousWorldPos);", + " emissionState.time += delta;", + " }", + " toJSON(meta, options = {}) {", + " return {};", + " }", + " getRendererSettings() {", + " return this.rendererSettings;", + " }", + " clone() {", + " return this;", + " }", + "}", + "", + "gdjs.__particleEmmiter3DExtension = {", + " ParticleEmitter3DRenderer,", + " ParticleEmitterAdapter,", + "", + " ApplyCollision,", + " ApplyForce,", + " ApplySequences,", + " AxisAngleGenerator,", + " BatchedParticleRenderer,", + " BatchedRenderer,", + " BehaviorFromJSON,", + " BehaviorTypes,", + " Bezier,", + " ChangeEmitDirection,", + " ColorGeneratorFromJSON,", + " ColorOverLife,", + " ColorRange,", + " ConeEmitter,", + " ConstantColor,", + " ConstantValue,", + " DonutEmitter,", + " EmitSubParticleSystem,", + " EmitterFromJSON,", + " EmitterMode,", + " EmitterShapes,", + " EulerGenerator,", + " ForceOverLife,", + " FrameOverLife,", + " GeneratorFromJSON,", + " Gradient,", + " GraphNodeType,", + " GravityForce,", + " GridEmitter,", + " Interpreter,", + " IntervalValue,", + " MeshSurfaceEmitter,", + " Node,", + " NodeGraph,", + " NodeType,", + " NodeTypes,", + " NodeValueType,", + " Noise,", + " OrbitOverLife,", + " ParticleEmitter,", + " ParticleSystem,", + " PiecewiseBezier,", + " PiecewiseFunction,", + " Plugins,", + " PointEmitter,", + " QuarksLoader,", + " RandomColor,", + " RandomColorBetweenGradient,", + " RandomQuatGenerator,", + " RecordState,", + " RenderMode,", + " Rotation3DOverLife,", + " RotationGeneratorFromJSON,", + " RotationOverLife,", + " SequencerFromJSON,", + " SizeOverLife,", + " SpeedOverLife,", + " SphereEmitter,", + " SpriteBatch,", + " SpriteParticle,", + " SubParticleEmitMode,", + " TextureSequencer,", + " TrailBatch,", + " TrailParticle,", + " TurbulenceField,", + " VFXBatch,", + " ValueGeneratorFromJSON,", + " WidthOverLength,", + " Wire,", + " genDefaultForNodeValueType,", + " getPhysicsResolver,", + " loadPlugin,", + " setPhysicsResolver,", + " unloadPlugin,", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onScenePreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "// See doStepPostEvents\r", + "runtimeScene.__particleEmmiter3DExtension = runtimeScene.__particleEmmiter3DExtension || {};\r", + "runtimeScene.__particleEmmiter3DExtension.emittersStepped = 0;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [ + { + "areaMaxX": 64, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "defaultName": "ParticleEmitter", + "description": "Display a large number of particles to create visual effects.", + "fullName": "3D particle emitter", + "is3D": true, + "name": "ParticleEmitter3D", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const BatchedRenderer = gdjs.__particleEmmiter3DExtension.BatchedRenderer;", + "const ParticleSystem = gdjs.__particleEmmiter3DExtension.ParticleSystem;", + "const TextureLoader = gdjs.__particleEmmiter3DExtension.TextureLoader;", + "const IntervalValue = gdjs.__particleEmmiter3DExtension.IntervalValue;", + "const ConstantValue = gdjs.__particleEmmiter3DExtension.ConstantValue;", + "const ConstantColor = gdjs.__particleEmmiter3DExtension.ConstantColor;", + "const ColorOverLife = gdjs.__particleEmmiter3DExtension.ColorOverLife;", + "const SizeOverLife = gdjs.__particleEmmiter3DExtension.SizeOverLife;", + "const ApplyForce = gdjs.__particleEmmiter3DExtension.ApplyForce;", + "const Gradient = gdjs.__particleEmmiter3DExtension.Gradient;", + "const PiecewiseBezier = gdjs.__particleEmmiter3DExtension.PiecewiseBezier;", + "const Bezier = gdjs.__particleEmmiter3DExtension.Bezier;", + "const PointEmitter = gdjs.__particleEmmiter3DExtension.PointEmitter;", + "const ConeEmitter = gdjs.__particleEmmiter3DExtension.ConeEmitter;", + "const RenderMode = gdjs.__particleEmmiter3DExtension.RenderMode;", + "", + "const { ParticleEmitterAdapter, ParticleEmitter3DRenderer } = gdjs.__particleEmmiter3DExtension;", + "", + "/** @type {gdjs.CustomRuntimeObject} */", + "const object = objects[0];", + "", + "// Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.", + "const gameScene = object.getRuntimeScene();", + "", + "/** @type {SpriteObjectDataType} */", + "const particleSpriteData = object._instanceContainer._objects.get(\"Particle\");", + "const resourceName = particleSpriteData.animations[0].directions[0].sprites[0].image;", + "const texture = object", + " .getInstanceContainer()", + " .getGame()", + " .getImageManager().getThreeTexture(resourceName);", + "", + "// Set the blending here because changes are not applied after the emitter creation.", + "const blendingString = object._getBlending();", + "const blending =", + " blendingString === \"Additive\" ? THREE.AdditiveBlending :", + " blendingString === \"Normal\" ? THREE.NormalBlending :", + " blendingString === \"Subtractive\" ? THREE.SubtractiveBlending :", + " blendingString === \"Multiply\" ? THREE.MultiplyBlending :", + " blendingString === \"None\" ? THREE.NoBlending :", + " THREE.AdditiveBlending;", + "", + "", + "// Build a configuration with the right kind of objects.", + "// These values are not important as they are overrided by the object properties values.", + "const muzzle = {", + " duration: 10,", + " looping: false,", + " startLife: new IntervalValue(1, 2),", + " startSpeed: new IntervalValue(100, 200),", + " startSize: new IntervalValue(20, 50),", + " startColor: new ConstantColor(new THREE.Vector4(1, 1, 1, 1)),", + " worldSpace: true,", + "", + " maxParticle: 5,", + " emissionOverTime: new ConstantValue(50),", + " emissionBursts: [{", + " time: 0,", + " count: new ConstantValue(1),", + " cycle: 1,", + " interval: 0.01,", + " probability: 1,", + " }],", + "", + " shape: new PointEmitter(),", + " material: new THREE.MeshBasicMaterial({", + " map: texture,", + " blending: blending,", + " transparent: true,", + " side: THREE.DoubleSide", + " }),", + " startTileIndex: 0,", + " uTileCount: 1,", + " vTileCount: 1,", + " renderOrder: 2,", + " renderMode: RenderMode.BillBoard", + "};", + "const particleSystem = new ParticleSystem(muzzle);", + "", + "const colorOverLife = new ColorOverLife(", + " new Gradient(", + " [", + " [new THREE.Vector3(1, 0, 0), 0],", + " [new THREE.Vector3(1, 0, 0), 1],", + " ],", + " [", + " [1, 0],", + " [1, 1],", + " ]", + " ));", + "particleSystem.addBehavior(colorOverLife);", + "const sizeOverLife = new SizeOverLife(new PiecewiseBezier([[new Bezier(1, 2 / 3, 1 / 3, 0), 0]]));", + "particleSystem.addBehavior(sizeOverLife);", + "const applyForce = new ApplyForce(new THREE.Vector3(0, 0, -1), new ConstantValue(0));", + "particleSystem.addBehavior(applyForce);", + "", + "particleSystem.emitter.name = object.getName() + object.getNameId();", + "", + "object.__particleEmitterAdapter = new ParticleEmitterAdapter(particleSystem, colorOverLife, sizeOverLife, applyForce);", + "object.__particleSystem = particleSystem;", + "", + "// This is a hack that may break in future releases.", + "// Replace the group that would hold children objects by the emmiter.", + "const layer = gameScene.getLayer(object.getLayer());", + "const group = object.getRenderer()._threeGroup;", + "layer.getRenderer().remove3DRendererObject(group);", + "particleSystem.emitter.position.copy(group.position);", + "particleSystem.emitter.rotation.order = 'ZYX';", + "particleSystem.emitter.rotation.copy(group.rotation);", + "", + "const particleEmitter3DRenderer = new ParticleEmitter3DRenderer(object, object._instanceContainer, object.getInstanceContainer());", + "object._renderer = particleEmitter3DRenderer;", + "particleEmitter3DRenderer._threeGroup = particleSystem.emitter;", + "layer.getRenderer().add3DRendererObject(particleSystem.emitter);", + "", + "particleSystem.emitter.updateMatrixWorld(true);", + "", + "", + "// See doStepPostEvents", + "gameScene.__particleEmmiter3DExtension = gameScene.__particleEmmiter3DExtension || {};", + "gameScene.__particleEmmiter3DExtension.emittersCount = gameScene.__particleEmmiter3DExtension.emittersCount || 0;", + "gameScene.__particleEmmiter3DExtension.emittersCount++;", + "", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::UpdateFromProperties" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetRotationCenter" + }, + "parameters": [ + "Object", + "0", + "0", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDestroy", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.CustomRuntimeObject} */", + "const object = objects[0];", + "// Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.", + "const gameScene = object.getRuntimeScene();", + "", + "object.__particleSystem.dispose();", + "", + "// See doStepPostEvents", + "gameScene.__particleEmmiter3DExtension.emittersCount--;", + "", + "if (gameScene.__particleEmmiter3DExtension.emittersCount === 0) {", + " // Update batch system now because doStepPostEvents won't be called.", + " gameScene.__particleEmmiter3DExtension.layerNames = gameScene.__particleEmmiter3DExtension.layerNames || [];", + " const layerNames = gameScene.__particleEmmiter3DExtension.layerNames;", + " gameScene.getAllLayerNames(layerNames);", + " for (const layerName of layerNames) {", + " const layer = gameScene.getLayer(layerName);", + " if (layer.__particleEmmiter3DExtension) {", + " layer.__particleEmmiter3DExtension.batchSystem.update(object.getElapsedTime() / 1000);", + " }", + " }", + "}" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::UpdateFromProperties" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Update from properties.", + "fullName": "Update from properties", + "functionType": "Action", + "name": "UpdateFromProperties", + "private": true, + "sentence": "Update from properties of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetZ" + }, + "parameters": [ + "Object", + "=", + "Object.Z()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetRotationX" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyRotationX()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetRotationY" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyRotationY()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartColor" + }, + "parameters": [ + "Object", + "=", + "Object.StartColor()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetEndColor" + }, + "parameters": [ + "Object", + "=", + "Object.EndColor()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartOpacity" + }, + "parameters": [ + "Object", + "=", + "Object.StartOpacity()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetEndOpacity" + }, + "parameters": [ + "Object", + "=", + "Object.EndOpacity()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetFlow" + }, + "parameters": [ + "Object", + "=", + "Object.Flow()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSizeMin" + }, + "parameters": [ + "Object", + "=", + "Object.StartSizeMin()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSizeMax" + }, + "parameters": [ + "Object", + "=", + "Object.StartSizeMax()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetEndScale" + }, + "parameters": [ + "Object", + "=", + "Object.EndScale()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSpeedMin" + }, + "parameters": [ + "Object", + "=", + "Object.StartSpeedMin()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSpeedMax" + }, + "parameters": [ + "Object", + "=", + "Object.StartSpeedMax()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetLifespanMin" + }, + "parameters": [ + "Object", + "=", + "Object.LifespanMin()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetLifespanMax" + }, + "parameters": [ + "Object", + "=", + "Object.LifespanMax()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetDuration" + }, + "parameters": [ + "Object", + "=", + "Object.Duration()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetSpayConeAngle" + }, + "parameters": [ + "Object", + "=", + "Object.SpayConeAngle()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetGravity" + }, + "parameters": [ + "Object", + "=", + "Object.Gravity()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetGravityTop" + }, + "parameters": [ + "Object", + "=", + "Object.GravityTop()", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ParticleEmitter3D::ParticleEmitter3D::PropertyAreParticlesRelative" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetAreParticlesRelative" + }, + "parameters": [ + "Object", + "no", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::PropertyAreParticlesRelative" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetAreParticlesRelative" + }, + "parameters": [ + "Object", + "yes", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "TODO: Blending can't be changed." + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetBlending" + }, + "parameters": [ + "Object", + "=", + "Object.Blending()", + "" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::HasEnded" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::Delete" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ParticleEmitter3D::ParticleEmitter3D::HasEnded" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::RegisterInLayer" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.CustomRuntimeObject3D} */", + "const object = objects[0];", + "// Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.", + "const gameScene = object.getRuntimeScene();", + "", + "// Update batch system after having moved every emitter.", + "// See onScenePreEvents", + "gameScene.__particleEmmiter3DExtension.emittersStepped++;", + "if (gameScene.__particleEmmiter3DExtension.emittersStepped === gameScene.__particleEmmiter3DExtension.emittersCount) {", + " gameScene.__particleEmmiter3DExtension.layerNames = gameScene.__particleEmmiter3DExtension.layerNames || [];", + " const layerNames = gameScene.__particleEmmiter3DExtension.layerNames;", + " gameScene.getAllLayerNames(layerNames);", + " for (const layerName of layerNames) {", + " const layer = gameScene.getLayer(layerName);", + " if (layer.__particleEmmiter3DExtension) {", + " layer.__particleEmmiter3DExtension.batchSystem.update(object.getElapsedTime() / 1000);", + " }", + " }", + "}" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "Register in layer", + "functionType": "Action", + "name": "RegisterInLayer", + "private": true, + "sentence": "Register _PARAM0_ in layer", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.CustomRuntimeObject} */", + "const object = objects[0];", + "", + "// TODO Handle layer changes?", + "if (object.__emitterLayerName === undefined) {", + " // Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.", + " const gameScene = object.getRuntimeScene();", + "", + " const layer = gameScene.getLayer(object.getLayer());", + " layer.__particleEmmiter3DExtension = layer.__particleEmmiter3DExtension || {};", + " if (!layer.__particleEmmiter3DExtension.batchSystem) {", + " const batchSystem = new gdjs.__particleEmmiter3DExtension.BatchedRenderer();", + " const threeScene = layer.getRenderer().getThreeScene();", + " if (threeScene) {", + " threeScene.add(batchSystem);", + " }", + " layer.__particleEmmiter3DExtension.batchSystem = batchSystem;", + " }", + " layer.__particleEmmiter3DExtension.batchSystem.addSystem(object.__particleSystem);", + " object.__emitterLayerName = layer.getName();", + "}" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Delete itself", + "fullName": "Delete itself", + "functionType": "Action", + "name": "Delete", + "private": true, + "sentence": "Delete _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "", + "object.deleteFromScene(object.getParent());", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check that emission has ended and no particle is alive anymore.", + "fullName": "Emission has ended", + "functionType": "Condition", + "name": "HasEnded", + "sentence": "Emission from _PARAM0_ has ended", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "\r", + "eventsFunctionContext.returnValue =\r", + " object._getShouldAutodestruct()\r", + " && object.__particleSystem.emitEnded\r", + " && object.__particleSystem.particleNum === 0;\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Restart particule emission from the beginning.", + "fullName": "Restart", + "functionType": "Action", + "name": "Restart", + "sentence": "Restart particule emission from _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.CustomRuntimeObject} */\r", + "const object = objects[0];\r", + "\r", + "object.__particleSystem.restart();\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the Z position of the emitter.", + "fullName": "Z elevaltion (deprecated)", + "functionType": "ExpressionAndCondition", + "group": "Position", + "name": "Z", + "private": true, + "sentence": "the Z position", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyZ()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Z", + "name": "SetZ", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyZ" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the rotation on X axis of the emitter.", + "fullName": "Rotation on X axis (deprecated)", + "functionType": "ExpressionAndCondition", + "group": "Angle", + "name": "RotationX", + "private": true, + "sentence": "the rotation on X axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyRotationX()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "RotationX", + "name": "SetRotationX", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyRotationX" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "\r", + "object.__particleSystem.emitter.rotation.x = eventsFunctionContext.getArgument(\"Value\") * Math.PI / 180;" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the rotation on Y axis of the emitter.", + "fullName": "Rotation on Y axis (deprecated)", + "functionType": "ExpressionAndCondition", + "group": "Angle", + "name": "RotationY", + "private": true, + "sentence": "the rotation on Y axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyRotationY()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "RotationY", + "name": "SetRotationY", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyRotationY" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "\r", + "object.__particleSystem.emitter.rotation.y = (90 + eventsFunctionContext.getArgument(\"Value\")) * Math.PI / 180;" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the start color of the object.", + "fullName": "Start color", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter color configuration", + "name": "StartColor", + "sentence": "the start color", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.PropertyStartColor()" + ] + } + ] + } + ], + "expressionType": { + "type": "color" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StartColor", + "name": "SetStartColor", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyStartColor" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsString(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const startColor = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setStartColor(startColor);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the end color of the object.", + "fullName": "End color", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter color configuration", + "name": "EndColor", + "sentence": "the end color", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.PropertyEndColor()" + ] + } + ] + } + ], + "expressionType": { + "type": "color" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "EndColor", + "name": "SetEndColor", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyEndColor" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsString(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const endColor = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setEndColor(endColor);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the start opacity of the object.", + "fullName": "Start opacity", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter color configuration", + "name": "StartOpacity", + "sentence": "the start opacity", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyStartOpacity()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StartOpacity", + "name": "SetStartOpacity", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyStartOpacity" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const startOpacity = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setStartOpacity(startOpacity);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the end opacity of the object.", + "fullName": "End opacity", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter color configuration", + "name": "EndOpacity", + "sentence": "the end opacity", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyEndOpacity()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "EndOpacity", + "name": "SetEndOpacity", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyEndOpacity" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const endOpacity = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setEndOpacity(endOpacity);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the flow of particles of the object (particles per second).", + "fullName": "Flow of particles", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "Flow", + "sentence": "the flow of particles", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyFlow()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Flow", + "name": "SetFlow", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyFlow" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const flow = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setFlow(flow);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the start min size of the object.", + "fullName": "Start min size", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "StartSizeMin", + "sentence": "the start min size", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyStartSizeMin()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StartSizeMin", + "name": "SetStartSizeMin", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyStartSizeMin" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const startMinSize = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setStartMinSize(startMinSize);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the start max size of the object.", + "fullName": "Start max size", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "StartSizeMax", + "sentence": "the start max size", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyStartSizeMax()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StartSizeMax", + "name": "SetStartSizeMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyStartSizeMax" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const startMaxSize = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setStartMaxSize(startMaxSize);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the end scale of the object.", + "fullName": "End scale", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "EndScale", + "sentence": "the end scale", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyEndScale()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "EndScale", + "name": "SetEndScale", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyEndScale" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const endScale = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setEndScale(endScale);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the min start speed of the object.", + "fullName": "Min start speed", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter speed configuration", + "name": "StartSpeedMin", + "sentence": "the min start speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyStartSpeedMin()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StartSpeedMin", + "name": "SetStartSpeedMin", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyStartSpeedMin" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const startSpeedMin = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setStartSpeedMin(startSpeedMin);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the max start speed of the object.", + "fullName": "Max start speed", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter speed configuration", + "name": "StartSpeedMax", + "sentence": "the max start speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyStartSpeedMax()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StartSpeedMax", + "name": "SetStartSpeedMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyStartSpeedMax" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const startSpeedMax = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setStartSpeedMax(startSpeedMax);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the min lifespan of the object.", + "fullName": "Min lifespan", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "LifespanMin", + "sentence": "the min lifespan", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyLifespanMin()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "LifespanMin", + "name": "SetLifespanMin", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyLifespanMin" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const lifespanMin = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setLifespanMin(lifespanMin);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the max lifespan of the object.", + "fullName": "Max lifespan", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "LifespanMax", + "sentence": "the max lifespan", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyLifespanMax()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "LifespanMax", + "name": "SetLifespanMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyLifespanMax" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const lifespanMax = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setLifespanMax(lifespanMax);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the emission duration of the object.", + "fullName": "Emission duration", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "Duration", + "sentence": "the emission duration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyDuration()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Duration", + "name": "SetDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyDuration" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const duration = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setDuration(duration);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if particles move with the emitter.", + "fullName": "Particles move with the emitter", + "functionType": "Condition", + "group": "3D particle emitter speed configuration", + "name": "AreParticlesRelative", + "sentence": "_PARAM0_ particles move with the emitter", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::PropertyAreParticlesRelative" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Change if particles move with the emitter.", + "fullName": "Particles move with the emitter", + "functionType": "Action", + "group": "3D particle emitter speed configuration", + "name": "SetAreParticlesRelative", + "sentence": "_PARAM0_ particles move with the emitter: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyAreParticlesRelative" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyAreParticlesRelative" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const areParticlesRelative = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setParticlesRelative(areParticlesRelative);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + }, + { + "defaultValue": "yes", + "description": "AreParticlesRelative", + "name": "Value", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "the spay cone angle of the object.", + "fullName": "Spay cone angle", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "SpayConeAngle", + "sentence": "the spay cone angle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertySpayConeAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "SpayConeAngle", + "name": "SetSpayConeAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertySpayConeAngle" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const sprayConeAngle = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setSprayConeAngle(sprayConeAngle);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the blending of the object.", + "fullName": "Blending", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter color configuration", + "name": "Blending", + "sentence": "the blending", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.PropertyBlending()" + ] + } + ] + } + ], + "expressionType": { + "supplementaryInformation": "[\"Normal\",\"Additive\",\"Substractive\",\"Multiply\",\"None\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Blending", + "name": "SetBlending", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyBlending" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsString(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const blending = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setBlending(blending);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the gravity top of the object.", + "fullName": "Gravity top", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter speed configuration", + "name": "GravityTop", + "sentence": "the gravity top", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.PropertyGravityTop()" + ] + } + ] + } + ], + "expressionType": { + "supplementaryInformation": "[\"Y-\",\"Z+\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "GravityTop", + "name": "SetGravityTop", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyGravityTop" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsString(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const gravityTop = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setGravityTop(gravityTop);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the gravity of the object.", + "fullName": "Gravity", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter speed configuration", + "name": "Gravity", + "sentence": "the gravity", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyGravity()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Gravity", + "name": "SetGravity", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyGravity" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const gravity = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setGravity(gravity);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if delete when emission ends.", + "fullName": "Delete when emission ends", + "functionType": "Condition", + "group": "3D particle emitter configuration", + "name": "ShouldAutodestruct", + "sentence": "_PARAM0_ delete when emission ends", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::PropertyShouldAutodestruct" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Change if delete when emission ends.", + "fullName": "Delete when emission ends", + "functionType": "Action", + "group": "3D particle emitter configuration", + "name": "SetShouldAutodestruct", + "sentence": "_PARAM0_ delete when emission ends: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyShouldAutodestruct" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyShouldAutodestruct" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + }, + { + "defaultValue": "yes", + "description": "ShouldAutodestruct", + "name": "Value", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "255;0;0", + "type": "Color", + "label": "Start color", + "description": "", + "group": "Color", + "extraInformation": [], + "name": "StartColor" + }, + { + "value": "255;255;0", + "type": "Color", + "label": "End color", + "description": "", + "group": "Color", + "extraInformation": [], + "name": "EndColor" + }, + { + "value": "255", + "type": "Number", + "unit": "Dimensionless", + "label": "Start opacity", + "description": "", + "group": "Color", + "extraInformation": [], + "name": "StartOpacity" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "End opacity", + "description": "", + "group": "Color", + "extraInformation": [], + "name": "EndOpacity" + }, + { + "value": "50", + "type": "Number", + "label": "Flow of particles (particles per second)", + "description": "", + "group": "", + "extraInformation": [], + "name": "Flow" + }, + { + "value": "10", + "type": "Number", + "unit": "Pixel", + "label": "Start min size", + "description": "", + "group": "Size", + "extraInformation": [], + "name": "StartSizeMin" + }, + { + "value": "20", + "type": "Number", + "unit": "Pixel", + "label": "Start max size", + "description": "", + "group": "Size", + "extraInformation": [], + "name": "StartSizeMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "End scale", + "description": "", + "group": "Size", + "extraInformation": [], + "name": "EndScale" + }, + { + "value": "100", + "type": "Number", + "unit": "PixelSpeed", + "label": "Start min speed", + "description": "", + "group": "Speed", + "extraInformation": [], + "name": "StartSpeedMin" + }, + { + "value": "100", + "type": "Number", + "unit": "PixelSpeed", + "label": "Start max speed", + "description": "", + "group": "Speed", + "extraInformation": [], + "name": "StartSpeedMax" + }, + { + "value": "1", + "type": "Number", + "unit": "Second", + "label": "Min lifespan", + "description": "", + "group": "", + "extraInformation": [], + "name": "LifespanMin" + }, + { + "value": "2", + "type": "Number", + "unit": "Second", + "label": "Max lifespan", + "description": "", + "group": "", + "extraInformation": [], + "name": "LifespanMax" + }, + { + "value": "5", + "type": "Number", + "unit": "Second", + "label": "Emission duration", + "description": "", + "group": "", + "extraInformation": [], + "name": "Duration" + }, + { + "value": "", + "type": "Boolean", + "label": "Particles move with the emitter", + "description": "", + "group": "Speed", + "extraInformation": [], + "name": "AreParticlesRelative" + }, + { + "value": "30", + "type": "Number", + "unit": "DegreeAngle", + "label": "Spay cone angle", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "SpayConeAngle" + }, + { + "value": "Additive", + "type": "Choice", + "label": "Blending", + "description": "", + "group": "Color", + "extraInformation": [ + "Normal", + "Additive", + "Subtractive", + "Multiply", + "None" + ], + "name": "Blending" + }, + { + "value": "Y-", + "type": "Choice", + "label": "Gravity top", + "description": "", + "group": "Speed", + "extraInformation": [ + "Y-", + "Z+" + ], + "name": "GravityTop" + }, + { + "value": "0", + "type": "Number", + "unit": "PixelAcceleration", + "label": "Gravity", + "description": "", + "group": "Speed", + "extraInformation": [], + "name": "Gravity" + }, + { + "value": "true", + "type": "Boolean", + "label": "Delete when emission ends", + "description": "", + "group": "", + "extraInformation": [], + "name": "ShouldAutodestruct" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ParentOrigin" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z (elevation)", + "description": "Deprecated", + "group": "Position", + "extraInformation": [], + "hidden": true, + "name": "Z" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation on X axis", + "description": "", + "group": "Position", + "extraInformation": [], + "hidden": true, + "name": "RotationX" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation on Y axis", + "description": "", + "group": "Position", + "extraInformation": [], + "hidden": true, + "name": "RotationY" + } + ], + "objects": [ + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Particle", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "Image", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Particle" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [] + } + ] + }, + { + "author": "", + "category": "Camera", + "extensionNamespace": "", + "fullName": "Smooth Camera", + "helpPath": "/tutorials/follow-player-with-camera/", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwO30NCjwvc3R5bGU+DQo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjQsMTNoLTZjLTEuMSwwLTItMC45LTItMlY1YzAtMS4xLDAuOS0yLDItMmg2YzEuMSwwLDIsMC45LDIsMnY2QzI2LDEyLjEsMjUuMSwxMywyNCwxM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yNiw4djEwYzAsMS4xLTAuOSwyLTIsMkg4Yy0xLjEsMC0yLTAuOS0yLTJWOGMwLTEuMSwwLjktMiwyLTJoOCIvPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMjEiIGN5PSI4IiByPSIyIi8+DQo8Y2lyY2xlIGNsYXNzPSJzdDAiIGN4PSIxMSIgY3k9IjE2IiByPSIxIi8+DQo8cmVjdCB4PSI5IiB5PSI5IiBjbGFzcz0ic3QwIiB3aWR0aD0iNCIgaGVpZ2h0PSIzIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIyMSwyOSAyMSwyOSAxMSwyOSAxMSwyOSAiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjE4LDIwIDE4LDI5IDE0LDI5IDE0LDIwICIvPg0KPHJlY3QgeD0iNyIgeT0iMyIgY2xhc3M9InN0MCIgd2lkdGg9IjQiIGhlaWdodD0iMyIvPg0KPC9zdmc+DQo=", + "name": "SmoothCamera", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Computers and Hardware/Computers and Hardware_camcoder_gopro_go_pro_camera.svg", + "shortDescription": "Smoothly scroll to follow an object.", + "version": "0.3.1", + "description": [ + "The camera follows an object according to:", + "- a frame rate independent catch-up speed to make the scrolling from smooth to strong", + "- a maximum speed to do linear following ([open the project online](https://editor.gdevelop.io/?project=example://platformer-with-tilemap)) or slow down the camera when teleporting the object", + "- a follow-free zone to avoid scrolling on small movements", + "- an offset to see further in one direction", + "- an extra delay and catch-up speed to give an impression of speed (useful for dash)", + "- position forecasting and delay to simulate a cameraman response time", + "", + "A platformer dedicated behavior allows to switch of settings when the character is in air or on the floor. This can be used to stabilize the camera when jumping." + ], + "origin": { + "identifier": "SmoothCamera", + "name": "gdevelop-extension-store" + }, + "tags": [ + "camera", + "scrolling", + "follow", + "smooth", + "platformer", + "platform" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Smoothly scroll to follow an object.", + "fullName": "Smooth Camera", + "name": "SmoothCamera", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Update private properties through setters to check their values and initialize state." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetLeftwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyLeftwardSpeed()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetRightwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyRightwardSpeed()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetUpwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyUpwardSpeed()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetDownwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyDownwardSpeed()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetLeftwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyLeftwardSpeedMax()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetRightwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyRightwardSpeedMax()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetUpwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyUpwardSpeedMax()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetDownwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyDownwardSpeedMax()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaLeft" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFollowFreeAreaLeft()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaRight" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFollowFreeAreaRight()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaTop" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFollowFreeAreaTop()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaBottom" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFollowFreeAreaBottom()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraDelay" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyCameraDelay()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SmoothCamera::SmoothCamera::PropertyIsCalledManually" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::DoMoveCameraCloser" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera closer to the object. This action must be called after the object has moved for the frame.", + "fullName": "Move the camera closer", + "functionType": "Action", + "name": "MoveCameraCloser", + "sentence": "Move the camera closer to _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The camera following is called with an action, the call from doStepPreEvents must be disabled to avoid to do it twice." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIsCalledManually" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::DoMoveCameraCloser" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera closer to the object.", + "fullName": "Do move the camera closer", + "functionType": "Action", + "name": "DoMoveCameraCloser", + "private": true, + "sentence": "Do move the camera closer _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Delaying and forecasting can be used at the same time.\nForecasting only use the positions that are older than the one used for delaying.\nThe behavior uses a position history that is split in 2 arrays:\n- one for delaying the position (from TimeFromStart to TimeFromStart - CamearDelay)\n- one for forecasting the position (from TimeFromStart - CamearDelay to TimeFromStart - CamearDelay - ForecastHistoryDuration" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::UpdateDelayedPosition" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::UpdateForecastedPosition" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "At each frame, the camera must catchup the target by a given ratio (speed)\ncameraX(t) - targetX = (cameraX(t - 1) - targetX) * speed\n\nThe frame rate must not impact on the catch-up speed, we don't want a speed in ratio per frame but a speed ratio per second, like this:\ncameraX(t) - targetX = (cameraX(t - 1s) - targetX) * speed\n\nOk, but we still need to process each frame, we can use a exponent for this:\ncameraX(t) - targetX = (cameraX(t - timeDelta) - targetX) * speed^timeDelta\ncameraX(t) = targetX + (cameraX(t - timeDelta) - targetX) * exp(timeDelta * ln(speed))\n\npow is probably more efficient than precalculated log if the speed is changed continuously but this might be rare enough." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyFollowOnX" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyOldX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "CameraX(Object.Layer(), 0)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraX" + }, + "parameters": [ + "", + ">", + "Object.Behavior::FreeAreaRight()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraX" + }, + "parameters": [ + "", + "=", + "Object.Behavior::FreeAreaRight()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaRight())\n* exp(TimeDelta() * Object.Behavior::PropertyLogLeftwardSpeed())", + "Object.Layer()", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraX" + }, + "parameters": [ + "", + "<", + "Object.Behavior::PropertyOldX() - Object.Behavior::PropertyLeftwardSpeedMax() * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraX" + }, + "parameters": [ + "", + "=", + "Object.Behavior::PropertyOldX() - Object.Behavior::PropertyLeftwardSpeedMax() * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraX" + }, + "parameters": [ + "", + "<", + "Object.Behavior::FreeAreaLeft()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraX" + }, + "parameters": [ + "", + "=", + "Object.Behavior::FreeAreaLeft()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaLeft())\n* exp(TimeDelta() * Object.Behavior::PropertyLogRightwardSpeed())", + "Object.Layer()", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraX" + }, + "parameters": [ + "", + ">", + "Object.Behavior::PropertyOldX() + Object.Behavior::PropertyRightwardSpeedMax() * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraX" + }, + "parameters": [ + "", + "=", + "Object.Behavior::PropertyOldX() + Object.Behavior::PropertyRightwardSpeedMax() * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyFollowOnY" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyOldY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "CameraY(Object.Layer(), 0)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraY" + }, + "parameters": [ + "", + ">", + "Object.Behavior::FreeAreaBottom()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraY" + }, + "parameters": [ + "", + "=", + "Object.Behavior::FreeAreaBottom()\n+ (CameraY(Object.Layer(), 0) - Object.Behavior::FreeAreaBottom())\n* exp(TimeDelta() * Object.Behavior::PropertyLogUpwardSpeed())", + "Object.Layer()", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraY" + }, + "parameters": [ + "", + "<", + "Object.Behavior::PropertyOldY() - Object.Behavior::PropertyUpwardSpeedMax() * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraY" + }, + "parameters": [ + "", + "=", + "Object.Behavior::PropertyOldY() - Object.Behavior::PropertyUpwardSpeedMax() * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraY" + }, + "parameters": [ + "", + "<", + "Object.Behavior::FreeAreaTop()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraY" + }, + "parameters": [ + "", + "=", + "Object.Behavior::FreeAreaTop()\n+ (CameraY(Object.Layer(), 0) - Object.Behavior::FreeAreaTop())\n* exp(TimeDelta() * Object.Behavior::PropertyLogDownwardSpeed())", + "Object.Layer()", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraY" + }, + "parameters": [ + "", + ">", + "Object.Behavior::PropertyOldY() + Object.Behavior::PropertyDownwardSpeedMax() * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraY" + }, + "parameters": [ + "", + "=", + "Object.Behavior::PropertyOldY() + Object.Behavior::PropertyDownwardSpeedMax() * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Delay the camera according to a maximum speed and catch up the delay.", + "fullName": "Wait and catch up", + "functionType": "Action", + "name": "WaitAndCatchUp", + "sentence": "Delay the camera of _PARAM0_ during: _PARAM2_ seconds according to the maximum speed _PARAM3_;_PARAM4_ seconds and catch up in _PARAM5_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Maybe the catch-up show be done in constant pixel speed instead of constant time speed." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyWaitingEnd" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "TimeFromStart() + GetArgumentAsNumber(\"WaitingDuration\")" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyWaitingSpeedXMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"WaitingSpeedXMax\")" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyWaitingSpeedYMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"WaitingSpeedYMax\")" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraDelayCatchUpDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"CatchUpDuration\")" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Wait and catch up\"", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Waiting duration (in seconds)", + "name": "WaitingDuration", + "type": "expression" + }, + { + "description": "Waiting maximum camera target speed X", + "name": "WaitingSpeedXMax", + "type": "expression" + }, + { + "description": "Waiting maximum camera target speed Y", + "name": "WaitingSpeedYMax", + "type": "expression" + }, + { + "description": "Catch up duration (in seconds)", + "name": "CatchUpDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Draw the targeted and actual camera position.", + "fullName": "Draw debug", + "functionType": "Action", + "name": "DrawDebug", + "sentence": "Draw targeted and actual camera position for _PARAM0_ on _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::FillOpacity" + }, + "parameters": [ + "ShapePainter", + "=", + "0" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Path used by the forecasting", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime)", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::OutlineColor" + }, + "parameters": [ + "ShapePainter", + "\"245;166;35\"" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::BeginFillPath" + }, + "parameters": [ + "ShapePainter", + "Object.Variable(__SmoothCamera.ForecastHistoryX[0])", + "Object.Variable(__SmoothCamera.ForecastHistoryY[0])" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "Object.VariableChildCount(__SmoothCamera.ForecastHistoryX)", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::PathLineTo" + }, + "parameters": [ + "ShapePainter", + "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()])", + "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()])" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::EndFillPath" + }, + "parameters": [ + "ShapePainter" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Follow-free area.", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyFollowFreeAreaLeft" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyFollowFreeAreaRight" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyFollowFreeAreaTop" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyFollowFreeAreaBottom" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::OutlineColor" + }, + "parameters": [ + "ShapePainter", + "\"126;211;33\"" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::Rectangle" + }, + "parameters": [ + "ShapePainter", + "Object.Behavior::FreeAreaLeft() - 1", + "Object.Behavior::FreeAreaTop() - 1", + "Object.Behavior::FreeAreaRight() + 1", + "Object.Behavior::FreeAreaBottom() + 1" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Linear regression vector used by the forecasting.", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::OutlineColor" + }, + "parameters": [ + "ShapePainter", + "\"208;2;27\"" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::LineV2" + }, + "parameters": [ + "ShapePainter", + "Object.Behavior::PropertyProjectedOldestX()", + "Object.Behavior::PropertyProjectedOldestY()", + "Object.Behavior::PropertyProjectedNewestX()", + "Object.Behavior::PropertyProjectedNewestY()", + "1" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Targeted and actual camera position", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::Circle" + }, + "parameters": [ + "ShapePainter", + "Object.Behavior::PropertyForecastedX()", + "Object.Behavior::PropertyForecastedY()", + "3" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::LineV2" + }, + "parameters": [ + "ShapePainter", + "CameraX(Object.Layer(), 0)", + "CameraY(Object.Layer(), 0) - 4", + "CameraX(Object.Layer(), 0)", + "CameraY(Object.Layer(), 0) + 4", + "1" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::LineV2" + }, + "parameters": [ + "ShapePainter", + "CameraX(Object.Layer(), 0) - 4", + "CameraY(Object.Layer(), 0)", + "CameraX(Object.Layer(), 0) + 4", + "CameraY(Object.Layer(), 0)", + "1" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Shape painter", + "name": "ShapePainter", + "supplementaryInformation": "PrimitiveDrawing::Drawer", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Enable or disable the following on X axis.", + "fullName": "Follow on X", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetFollowOnX", + "sentence": "The camera follows _PARAM0_ on X axis: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowOnX" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"FollowOnX\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowOnX" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Follow on X axis", + "name": "FollowOnX", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Enable or disable the following on Y axis.", + "fullName": "Follow on Y", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetFollowOnY", + "sentence": "The camera follows _PARAM0_ on Y axis: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowOnY" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"FollowOnY\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowOnY" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Follow on Y axis", + "name": "FollowOnY", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera follow free area right border.", + "fullName": "Follow free area right border", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetFollowFreeAreaRight", + "sentence": "Change the camera follow free area right border of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowFreeAreaTop" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaRight\"))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Follow free area right border", + "name": "SetFollowFreeAreaRight", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera follow free area left border.", + "fullName": "Follow free area left border", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetFollowFreeAreaLeft", + "sentence": "Change the camera follow free area left border of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowFreeAreaTop" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaLeft\"))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Follow free area left border", + "name": "SetFollowFreeAreaLeft", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera follow free area top border.", + "fullName": "Follow free area top border", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetFollowFreeAreaTop", + "sentence": "Change the camera follow free area top border of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowFreeAreaTop" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, GetArgumentAsNumber(\"FollowFreeAreaTop\"))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Follow free area top border", + "name": "FollowFreeAreaTop", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera follow free area bottom border.", + "fullName": "Follow free area bottom border", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetFollowFreeAreaBottom", + "sentence": "Change the camera follow free area bottom border of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowFreeAreaBottom" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaBottom\"))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Follow free area bottom border", + "name": "SetFollowFreeAreaBottom", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera leftward maximum speed (in pixels per second).", + "fullName": "Leftward maximum speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetLeftwardSpeedMax", + "sentence": "Change the camera leftward maximum speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyLeftwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, GetArgumentAsNumber(\"Speed\"))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Leftward maximum speed (in ratio per second)", + "name": "Speed", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera rightward maximum speed (in pixels per second).", + "fullName": "Rightward maximum speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetRightwardSpeedMax", + "sentence": "Change the camera rightward maximum speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyLeftwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, GetArgumentAsNumber(\"Speed\"))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Rightward maximum speed (in pixels per second)", + "name": "Speed", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera upward maximum speed (in pixels per second).", + "fullName": "Upward maximum speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetUpwardSpeedMax", + "sentence": "Change the camera upward maximum speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyUpwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, GetArgumentAsNumber(\"Speed\"))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Upward maximum speed (in pixels per second)", + "name": "Speed", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera downward maximum speed (in pixels per second).", + "fullName": "Downward maximum speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetDownwardSpeedMax", + "sentence": "Change the camera downward maximum speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDownwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, GetArgumentAsNumber(\"Speed\"))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Downward maximum speed (in pixels per second)", + "name": "Speed", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera leftward catch-up speed (in ratio per second).", + "fullName": "Leftward catch-up speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetLeftwardSpeed", + "sentence": "Change the camera leftward catch-up speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyLeftwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(0, 1, GetArgumentAsNumber(\"LeftwardSpeed\"))" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyLogLeftwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "log(1 - Object.Behavior::PropertyLeftwardSpeed())" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Leftward catch-up speed (in ratio per second)", + "name": "LeftwardSpeed", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera rightward catch-up speed (in ratio per second).", + "fullName": "Rightward catch-up speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetRightwardSpeed", + "sentence": "Change the camera rightward catch-up speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyRightwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(0, 1, GetArgumentAsNumber(\"RightwardSpeed\"))" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyLogRightwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "log(1 - Object.Behavior::PropertyRightwardSpeed())" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Rightward catch-up speed (in ratio per second)", + "name": "RightwardSpeed", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera downward catch-up speed (in ratio per second).", + "fullName": "Downward catch-up speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetDownwardSpeed", + "sentence": "Change the camera downward catch-up speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDownwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(0, 1, GetArgumentAsNumber(\"DownwardSpeed\"))" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyLogDownwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "log(1 - Object.Behavior::PropertyDownwardSpeed())" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Downward catch-up speed (in ratio per second)", + "name": "DownwardSpeed", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera upward catch-up speed (in ratio per second).", + "fullName": "Upward catch-up speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetUpwardSpeed", + "sentence": "Change the camera upward catch-up speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyUpwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(0, 1, GetArgumentAsNumber(\"UpwardSpeed\"))" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyLogUpwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "log(1 - Object.Behavior::PropertyUpwardSpeed())" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Upward catch-up speed (in ratio per second)", + "name": "UpwardSpeed", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the camera offset on X axis of the object. This is not the current difference between the object and the camera position.", + "fullName": "Camera offset X", + "functionType": "ExpressionAndCondition", + "group": "Camera configuration", + "name": "OffsetX", + "sentence": "the camera offset on X axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyCameraOffsetX()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "OffsetX", + "name": "SetOffsetXOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraOffsetX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera offset on X axis of an object.", + "fullName": "Camera Offset X", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetOffsetX", + "private": true, + "sentence": "Change the camera offset on X axis of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Deprecated use SetOffsetXOp instead." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetOffsetXOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"CameraOffsetX\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Camera offset X", + "name": "CameraOffsetX", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the camera offset on Y axis of the object. This is not the current difference between the object and the camera position.", + "fullName": "Camera offset Y", + "functionType": "ExpressionAndCondition", + "group": "Camera configuration", + "name": "OffsetY", + "sentence": "the camera offset on Y axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyCameraOffsetY()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "OffsetY", + "name": "SetOffsetYOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Deprecated use SetOffsetYOp instead." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraOffsetY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera offset on Y axis of an object.", + "fullName": "Camera Offset Y", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetOffsetY", + "private": true, + "sentence": "Change the camera offset on Y axis of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetOffsetYOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"CameraOffsetY\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Camera offset Y", + "name": "CameraOffsetY", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera forecast time (in seconds).", + "fullName": "Forecast time", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetForecastTime", + "sentence": "Change the camera forecast time of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(0, GetArgumentAsNumber(\"ForecastTime\"))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Forecast time", + "name": "ForecastTime", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera delay (in seconds).", + "fullName": "Camera delay", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetCameraDelay", + "sentence": "Change the camera delay of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraDelay" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(0, GetArgumentAsNumber(\"CameraDelay\"))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Camera delay", + "name": "CameraDelay", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return follow free area left border X.", + "fullName": "Free area left", + "functionType": "Expression", + "group": "Private", + "name": "FreeAreaLeft", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyForecastedX() + Object.Behavior::PropertyCameraOffsetX() - Object.Behavior::PropertyFollowFreeAreaLeft()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return follow free area right border X.", + "fullName": "Free area right", + "functionType": "Expression", + "group": "Private", + "name": "FreeAreaRight", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyForecastedX() + Object.Behavior::PropertyCameraOffsetX() + Object.Behavior::PropertyFollowFreeAreaRight()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return follow free area bottom border Y.", + "fullName": "Free area bottom", + "functionType": "Expression", + "group": "Private", + "name": "FreeAreaBottom", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyForecastedY() + Object.Behavior::PropertyCameraOffsetY() + Object.Behavior::PropertyFollowFreeAreaBottom()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return follow free area top border Y.", + "fullName": "Free area top", + "functionType": "Expression", + "group": "Private", + "name": "FreeAreaTop", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyForecastedY() + Object.Behavior::PropertyCameraOffsetY() - Object.Behavior::PropertyFollowFreeAreaTop()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Update delayed position and delayed history. This is called in doStepPreEvents.", + "fullName": "Update delayed position", + "functionType": "Action", + "group": "Private", + "name": "UpdateDelayedPosition", + "private": true, + "sentence": "Update delayed position and delayed history of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Add the previous position to have enough (2) positions to evaluate the extra delay for waiting mode." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::IsWaiting" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.VariableChildCount(__SmoothCamera.ObjectTime)", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectTime", + "TimeFromStart()" + ] + }, + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectX", + "Object.Behavior::PropertyDelayedCenterX()" + ] + }, + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectY", + "Object.Behavior::PropertyDelayedCenterY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Use the object center when no delay is asked." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.CenterX()" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.CenterY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SmoothCamera::SmoothCamera::IsDelayed" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::AddForecastHistoryPosition" + }, + "parameters": [ + "Object", + "Behavior", + "TimeFromStart()", + "Object.CenterX()", + "Object.CenterY()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::IsDelayed" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::IsWaiting" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectTime", + "TimeFromStart()" + ] + }, + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectX", + "Object.CenterX()" + ] + }, + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectY", + "Object.CenterY()" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Remove history entries that are too old to be useful for delaying and pass it to the history for forecasting." + }, + { + "infiniteLoopWarning": true, + "type": "BuiltinCommonInstructions::While", + "whileConditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.VariableChildCount(__SmoothCamera.ObjectTime)", + ">=", + "2" + ] + }, + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectTime[1]", + "<", + "TimeFromStart() - Object.Behavior::CurrentDelay()" + ] + } + ], + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::AddForecastHistoryPosition" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Variable(__SmoothCamera.ObjectTime[0])", + "Object.Variable(__SmoothCamera.ObjectX[0])", + "Object.Variable(__SmoothCamera.ObjectY[0])", + "" + ] + }, + { + "type": { + "value": "ObjectVariableRemoveAt" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectTime", + "0" + ] + }, + { + "type": { + "value": "ObjectVariableRemoveAt" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectX", + "0" + ] + }, + { + "type": { + "value": "ObjectVariableRemoveAt" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectY", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Don't move the camera if there is not enough history." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Variable(__SmoothCamera.ObjectX[0])" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Variable(__SmoothCamera.ObjectY[0])" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.VariableChildCount(__SmoothCamera.ObjectTime)", + ">=", + "2" + ] + }, + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectTime[0]", + "<", + "TimeFromStart() - Object.Behavior::CurrentDelay()" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Add the extra delay that could be needed to respect the speed limit in waiting mode.\n\nspeedRatio = min(speedMaxX / historySpeedX, speedMaxY / historySpeedY)\ndelay += min(0, timeDelta * (1 - speedRatio))" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::IsWaiting" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraExtraDelay" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "max(0, TimeDelta() * (1 - min(Object.Behavior::PropertyWaitingSpeedXMax() * abs(Object.Variable(__SmoothCamera.ObjectX[1]) - Object.Variable(__SmoothCamera.ObjectX[0])), Object.Behavior::PropertyWaitingSpeedYMax() * abs(Object.Variable(__SmoothCamera.ObjectY[1]) - Object.Variable(__SmoothCamera.ObjectY[0]))) / (Object.Variable(__SmoothCamera.ObjectTime[1]) - Object.Variable(__SmoothCamera.ObjectTime[0]))))" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Extra delay: \" + ToString(Object.Behavior::PropertyCameraExtraDelay())", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The time with delay is now between the first 2 indexes" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "lerp(Object.Variable(__SmoothCamera.ObjectX[1]), Object.Variable(__SmoothCamera.ObjectX[0]), ((TimeFromStart() - Object.Behavior::CurrentDelay()) - Object.Variable(__SmoothCamera.ObjectTime[1])) / (Object.Variable(__SmoothCamera.ObjectTime[0]) - Object.Variable(__SmoothCamera.ObjectTime[1])))" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "lerp(Object.Variable(__SmoothCamera.ObjectY[1]), Object.Variable(__SmoothCamera.ObjectY[0]), ((TimeFromStart() - Object.Behavior::CurrentDelay()) - Object.Variable(__SmoothCamera.ObjectTime[1])) / (Object.Variable(__SmoothCamera.ObjectTime[0]) - Object.Variable(__SmoothCamera.ObjectTime[1])))" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SmoothCamera::SmoothCamera::IsDelayed" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "SmoothCamera::SmoothCamera::IsWaiting" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ObjectVariableClearChildren" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectTime" + ] + }, + { + "type": { + "value": "ObjectVariableClearChildren" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectX" + ] + }, + { + "type": { + "value": "ObjectVariableClearChildren" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SmoothCamera::SmoothCamera::IsWaiting" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraDelayCatchUpSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyCameraExtraDelay() / Object.Behavior::PropertyCameraDelayCatchUpDuration()" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Start to catch up\"", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SmoothCamera::SmoothCamera::IsWaiting" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyCameraExtraDelay" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraExtraDelay" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, Object.Behavior::PropertyCameraExtraDelay() -Object.Behavior::PropertyCameraDelayCatchUpSpeed() * TimeDelta())" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Catching up delay: \" + ToString(Object.Behavior::PropertyCameraExtraDelay())", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the camera following target is delayed from the object.", + "fullName": "Camera is delayed", + "functionType": "Condition", + "name": "IsDelayed", + "private": true, + "sentence": "The camera of _PARAM0_ is delayed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.Behavior::CurrentDelay()", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the current camera delay.", + "fullName": "Current delay", + "functionType": "Expression", + "name": "CurrentDelay", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyCameraDelay() + Object.Behavior::PropertyCameraExtraDelay()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the camera following is waiting at a reduced speed.", + "fullName": "Camera is waiting", + "functionType": "Condition", + "name": "IsWaiting", + "private": true, + "sentence": "The camera of _PARAM0_ is waiting", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyWaitingEnd" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "TimeFromStart()" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Add a position to the history for forecasting. This is called 2 times in UpadteDelayedPosition.", + "fullName": "Add forecast history position", + "functionType": "Action", + "group": "Private", + "name": "AddForecastHistoryPosition", + "private": true, + "sentence": "Add the time:_PARAM2_ and position: _PARAM3_; _PARAM4_ to the forecast history of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyForecastHistoryDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyForecastTime" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ForecastHistoryTime", + "GetArgumentAsNumber(\"Time\")" + ] + }, + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ForecastHistoryX", + "GetArgumentAsNumber(\"ObjectX\")" + ] + }, + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ForecastHistoryY", + "GetArgumentAsNumber(\"ObjectY\")" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Remove history entries that are too old to be useful.\nKeep at least 2 positions because no forecast can be done with less positions." + }, + { + "infiniteLoopWarning": true, + "type": "BuiltinCommonInstructions::While", + "whileConditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime)", + ">=", + "3" + ] + }, + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__SmoothCamera.ForecastHistoryTime[0]", + "<", + "TimeFromStart() - Object.Behavior::PropertyCameraDelay() - Object.Behavior::PropertyCameraExtraDelay() - Object.Behavior::PropertyForecastHistoryDuration()" + ] + } + ], + "conditions": [], + "actions": [ + { + "type": { + "value": "ObjectVariableRemoveAt" + }, + "parameters": [ + "Object", + "__SmoothCamera.ForecastHistoryTime", + "0" + ] + }, + { + "type": { + "value": "ObjectVariableRemoveAt" + }, + "parameters": [ + "Object", + "__SmoothCamera.ForecastHistoryX", + "0" + ] + }, + { + "type": { + "value": "ObjectVariableRemoveAt" + }, + "parameters": [ + "Object", + "__SmoothCamera.ForecastHistoryY", + "0" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Time", + "name": "Time", + "type": "expression" + }, + { + "description": "Object X", + "name": "ObjectX", + "type": "expression" + }, + { + "description": "Object Y", + "name": "ObjectY", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Update forecasted position. This is called in doStepPreEvents.", + "fullName": "Update forecasted position", + "functionType": "Action", + "group": "Private", + "name": "UpdateForecastedPosition", + "private": true, + "sentence": "Update forecasted position of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyDelayedCenterX()" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyDelayedCenterY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Simple linear regression\ny = A * x + B\n\nA = Covariance / VarianceX\nB = MeanY - A * MeanX\n\nNote than we could use only one position every N positions to reduce the process time,\nbut if we really need efficient process JavaScript and circular queues are a must." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime)", + ">=", + "2" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyForecastHistoryDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyForecastTime" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ] + } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Mean X", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "Object.VariableChildCount(__SmoothCamera.ForecastHistoryX)", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanX" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()])" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanX" + }, + "parameters": [ + "Object", + "Behavior", + "/", + "Object.VariableChildCount(__SmoothCamera.ForecastHistoryX)" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Mean Y", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "Object.VariableChildCount(__SmoothCamera.ForecastHistoryY)", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanY" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()])" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanY" + }, + "parameters": [ + "Object", + "Behavior", + "/", + "Object.VariableChildCount(__SmoothCamera.ForecastHistoryY)" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Mean: \" + ToString(Object.Behavior::PropertyForecastHistoryMeanX()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryMeanY())", + "", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Variance and Covariance", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "VarianceX = sum((X[i] - MeanX)²)\nVarianceY = sum((Y[i] - MeanY)²)\nCovariance = sum((X[i] - MeanX) * (Y[i] - MeanY))" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryVarianceX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryVarianceY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryCovariance" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "Object.VariableChildCount(__SmoothCamera.ForecastHistoryX)", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryVarianceX" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "pow(Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanX(), 2)" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryVarianceY" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "pow(Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanY(), 2)" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryCovariance" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "(Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanX())\n*\n(Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanY())" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Variances: \" + ToString(Object.Behavior::PropertyForecastHistoryVarianceX()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryVarianceY()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryCovariance())", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "<", + "1" + ] + }, + { + "type": { + "value": "Egal" + }, + "parameters": [ + "abs(Object.Behavior::PropertyForecastHistoryVarianceY())", + "<", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyDelayedCenterX()" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyDelayedCenterY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + ">=", + "1" + ] + }, + { + "type": { + "value": "Egal" + }, + "parameters": [ + "abs(Object.Behavior::PropertyForecastHistoryVarianceY())", + ">=", + "1" + ] + } + ] + } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Linear function parameters", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "y = A * x + B\n\nA = Covariance / VarianceX\nB = MeanY - A * MeanX" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + ">=", + "abs(Object.Behavior::PropertyForecastHistoryVarianceY())" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryLinearA" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyForecastHistoryCovariance() / Object.Behavior::PropertyForecastHistoryVarianceX()" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryLinearB" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyForecastHistoryMeanY() - Object.Behavior::PropertyForecastHistoryLinearA() * Object.Behavior::PropertyForecastHistoryMeanX()" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Linear: \" + ToString(Object.Behavior::PropertyForecastHistoryLinearA()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryLinearB())", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Projection", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::ProjectHistoryEnds" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Variable(__SmoothCamera.ForecastHistoryX[0])", + "Object.Variable(__SmoothCamera.ForecastHistoryY[0])", + "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.VariableChildCount(__SmoothCamera.ForecastHistoryX) - 1])", + "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.VariableChildCount(__SmoothCamera.ForecastHistoryY) - 1])", + "" + ] + } + ] + } + ], + "parameters": [] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Axis permutation to avoid a ratio between 2 numbers near 0." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "<", + "abs(Object.Behavior::PropertyForecastHistoryVarianceY())" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryLinearA" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyForecastHistoryCovariance() / Object.Behavior::PropertyForecastHistoryVarianceY()" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryLinearB" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyForecastHistoryMeanX() - Object.Behavior::PropertyForecastHistoryLinearA() * Object.Behavior::PropertyForecastHistoryMeanY()" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Linear: \" + ToString(Object.Behavior::PropertyForecastHistoryLinearA()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryLinearB())", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Projection", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::ProjectHistoryEnds" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Variable(__SmoothCamera.ForecastHistoryY[0])", + "Object.Variable(__SmoothCamera.ForecastHistoryX[0])", + "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.VariableChildCount(__SmoothCamera.ForecastHistoryY) - 1])", + "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.VariableChildCount(__SmoothCamera.ForecastHistoryX) - 1])", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Permute back axis" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyProjectedOldestX()" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedOldestX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyProjectedOldestY()" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedOldestY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyIndex()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyProjectedNewestX()" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedNewestX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyProjectedNewestY()" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedNewestY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyIndex()" + ] + } + ] + } + ], + "parameters": [] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Oldest: \" + ToString(Object.Behavior::PropertyProjectedOldestX()) + \" \" + ToString(Object.Behavior::PropertyProjectedOldestY())", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Newest: \" + ToString(Object.Behavior::PropertyProjectedNewestX()) + \" \" + ToString(Object.Behavior::PropertyProjectedNewestY())", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Forecasted position", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyProjectedNewestX() + ( Object.Behavior::PropertyProjectedNewestX() - Object.Behavior::PropertyProjectedOldestX()) * Object.Behavior::ForecastTimeRatio()" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyProjectedNewestY() + ( Object.Behavior::PropertyProjectedNewestY() - Object.Behavior::PropertyProjectedOldestY()) * Object.Behavior::ForecastTimeRatio()" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Forecasted: \" + ToString(Object.Behavior::PropertyForecastedX()) + \" \" + ToString(Object.Behavior::PropertyForecastedY())", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Project history ends position to have the vector on the line from linear regression. This function is only called by UpdateForecastedPosition.", + "fullName": "Project history ends", + "functionType": "Action", + "group": "Private", + "name": "ProjectHistoryEnds", + "private": true, + "sentence": "Project history oldest: _PARAM2_;_PARAM3_ and newest position: _PARAM4_;_PARAM5_ of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Perpendicular line:\npA = -1/a; \npB = -pA * x + y\n\nIntersection:\n/ ProjectedY = a * ProjectedX + b\n\\ ProjectedY = pA * ProjectedX + b\n\nSolution that is cleaned out from indeterminism (like 0 / 0 or infinity / infinity):\nProjectedX= (x + (y - b) * a) / (a² + 1)\nProjectedY = y + (x * a - y + b) / (a² + 1)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedNewestX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "(GetArgumentAsNumber(\"NewestX\") + (GetArgumentAsNumber(\"NewestY\") - Object.Behavior::PropertyForecastHistoryLinearB()) * Object.Behavior::PropertyForecastHistoryLinearA()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedNewestY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"NewestY\") + (GetArgumentAsNumber(\"NewestX\") * Object.Behavior::PropertyForecastHistoryLinearA() - GetArgumentAsNumber(\"NewestY\") \n+ Object.Behavior::PropertyForecastHistoryLinearB()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedOldestX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "(GetArgumentAsNumber(\"OldestX\") + (GetArgumentAsNumber(\"OldestY\") - Object.Behavior::PropertyForecastHistoryLinearB()) * Object.Behavior::PropertyForecastHistoryLinearA()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedOldestY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"OldestY\") + (GetArgumentAsNumber(\"OldestX\") * Object.Behavior::PropertyForecastHistoryLinearA() - GetArgumentAsNumber(\"OldestY\") \n+ Object.Behavior::PropertyForecastHistoryLinearB()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "OldestX", + "name": "OldestX", + "type": "expression" + }, + { + "description": "OldestY", + "name": "OldestY", + "type": "expression" + }, + { + "description": "Newest X", + "name": "NewestX", + "type": "expression" + }, + { + "description": "Newest Y", + "name": "NewestY", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the ratio between forecast time and the duration of the history. This function is only called by UpdateForecastedPosition.", + "fullName": "Forecast time ratio", + "functionType": "Expression", + "group": "Private", + "name": "ForecastTimeRatio", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "- Object.Behavior::PropertyForecastTime() / (Object.Variable(__SmoothCamera.ForecastHistoryTime[0]) - Object.Variable(__SmoothCamera.ForecastHistoryTime[Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime) - 1]))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0.9", + "type": "Number", + "label": "Leftward catch-up speed (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "LeftwardSpeed" + }, + { + "value": "0.9", + "type": "Number", + "label": "Rightward catch-up speed (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "RightwardSpeed" + }, + { + "value": "0.9", + "type": "Number", + "label": "Upward catch-up speed (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "UpwardSpeed" + }, + { + "value": "0.9", + "type": "Number", + "label": "Downward catch-up speed (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "DownwardSpeed" + }, + { + "value": "true", + "type": "Boolean", + "label": "Follow on X axis", + "description": "", + "group": "", + "extraInformation": [], + "name": "FollowOnX" + }, + { + "value": "true", + "type": "Boolean", + "label": "Follow on Y axis", + "description": "", + "group": "", + "extraInformation": [], + "name": "FollowOnY" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area left border", + "description": "", + "group": "Position", + "extraInformation": [], + "advanced": true, + "name": "FollowFreeAreaLeft" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area right border", + "description": "", + "group": "Position", + "extraInformation": [], + "advanced": true, + "name": "FollowFreeAreaRight" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area top border", + "description": "", + "group": "Position", + "extraInformation": [], + "advanced": true, + "name": "FollowFreeAreaTop" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area bottom border", + "description": "", + "group": "Position", + "extraInformation": [], + "advanced": true, + "name": "FollowFreeAreaBottom" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Camera offset X", + "description": "", + "group": "Position", + "extraInformation": [], + "advanced": true, + "name": "CameraOffsetX" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Camera offset Y", + "description": "", + "group": "Position", + "extraInformation": [], + "advanced": true, + "name": "CameraOffsetY" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Camera delay", + "description": "", + "group": "Timing", + "extraInformation": [], + "deprecated": true, + "name": "CameraDelay" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Forecast time", + "description": "", + "group": "Timing", + "extraInformation": [], + "deprecated": true, + "name": "ForecastTime" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Forecast history duration", + "description": "", + "group": "Timing", + "extraInformation": [], + "deprecated": true, + "name": "ForecastHistoryDuration" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "LogLeftwardSpeed" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "LogRightwardSpeed" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "LogDownwardSpeed" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "LogUpwardSpeed" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "DelayedCenterX" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "DelayedCenterY" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastHistoryMeanX" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastHistoryMeanY" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastHistoryVarianceX" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastHistoryCovariance" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastHistoryLinearA" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastHistoryLinearB" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastedX" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastedY" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ProjectedNewestX" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ProjectedNewestY" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ProjectedOldestX" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ProjectedOldestY" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastHistoryVarianceY" + }, + { + "value": "", + "type": "Number", + "label": "Index (local variable)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Index" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CameraDelayCatchUpSpeed" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CameraExtraDelay" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "WaitingSpeedXMax" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "WaitingSpeedYMax" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "WaitingEnd" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CameraDelayCatchUpDuration" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Leftward maximum speed", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "advanced": true, + "name": "LeftwardSpeedMax" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Rightward maximum speed", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "advanced": true, + "name": "RightwardSpeedMax" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Upward maximum speed", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "advanced": true, + "name": "UpwardSpeedMax" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Downward maximum speed", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "advanced": true, + "name": "DownwardSpeedMax" + }, + { + "value": "", + "type": "Number", + "label": "OldX (local variable)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "OldX" + }, + { + "value": "", + "type": "Number", + "label": "OldY (local variable)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "OldY" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsCalledManually" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Smoothly scroll to follow a character and stabilize the camera when jumping.", + "fullName": "Smooth platformer camera", + "name": "SmoothPlatformerCamera", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PlatformBehavior::IsJumping" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + }, + { + "type": { + "inverted": true, + "value": "PlatformBehavior::IsFalling" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaBottom" + }, + "parameters": [ + "Object", + "SmoothCamera", + "Object.Behavior::PropertyFloorFollowFreeAreaTop()", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaTop" + }, + "parameters": [ + "Object", + "SmoothCamera", + "Object.Behavior::PropertyFloorFollowFreeAreaBottom()", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetUpwardSpeed" + }, + "parameters": [ + "Object", + "SmoothCamera", + "Object.Behavior::PropertyFloorUpwardSpeed()", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetDownwardSpeed" + }, + "parameters": [ + "Object", + "SmoothCamera", + "Object.Behavior::PropertyFloorDownwardSpeed()", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetUpwardSpeedMax" + }, + "parameters": [ + "Object", + "SmoothCamera", + "Object.Behavior::PropertyFloorUpwardSpeedMax()", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetDownwardSpeedMax" + }, + "parameters": [ + "Object", + "SmoothCamera", + "Object.Behavior::PropertyFloorDownwardSpeedMax()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "PlatformBehavior::IsJumping" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + }, + { + "type": { + "value": "PlatformBehavior::IsFalling" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaBottom" + }, + "parameters": [ + "Object", + "SmoothCamera", + "Object.Behavior::PropertyAirFollowFreeAreaTop()", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaTop" + }, + "parameters": [ + "Object", + "SmoothCamera", + "Object.Behavior::PropertyAirFollowFreeAreaBottom()", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetUpwardSpeed" + }, + "parameters": [ + "Object", + "SmoothCamera", + "Object.Behavior::PropertyAirUpwardSpeed()", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetDownwardSpeed" + }, + "parameters": [ + "Object", + "SmoothCamera", + "Object.Behavior::PropertyAirDownwardSpeed()", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetUpwardSpeedMax" + }, + "parameters": [ + "Object", + "SmoothCamera", + "Object.Behavior::PropertyAirUpwardSpeedMax()", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetDownwardSpeedMax" + }, + "parameters": [ + "Object", + "SmoothCamera", + "Object.Behavior::PropertyAirDownwardSpeedMax()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothPlatformerCamera", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Platformer character behavior", + "description": "", + "group": "", + "extraInformation": [ + "PlatformBehavior::PlatformerObjectBehavior" + ], + "name": "PlatformerCharacter" + }, + { + "value": "", + "type": "Behavior", + "label": "Smooth camera behavior", + "description": "", + "group": "", + "extraInformation": [ + "SmoothCamera::SmoothCamera" + ], + "name": "SmoothCamera" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "JumpOriginY" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area top in the air", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "AirFollowFreeAreaTop" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area bottom in the air", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "AirFollowFreeAreaBottom" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area top on the floor", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "FloorFollowFreeAreaTop" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area bottom on the floor", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "FloorFollowFreeAreaBottom" + }, + { + "value": "0.95", + "type": "Number", + "label": "Upward speed in the air (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "AirUpwardSpeed" + }, + { + "value": "0.95", + "type": "Number", + "label": "Downward speed in the air (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "AirDownwardSpeed" + }, + { + "value": "0.9", + "type": "Number", + "label": "Upward speed on the floor (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "FloorUpwardSpeed" + }, + { + "value": "0.9", + "type": "Number", + "label": "Downward speed on the floor (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "FloorDownwardSpeed" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Upward maximum speed in the air", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "name": "AirUpwardSpeedMax" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Downward maximum speed in the air", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "name": "AirDownwardSpeedMax" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Upward maximum speed on the floor", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "name": "FloorUpwardSpeedMax" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Downward maximum speed on the floor", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "name": "FloorDownwardSpeedMax" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Movement", + "extensionNamespace": "", + "fullName": "Boids movement", + "helpPath": "/extensions/boids-movement/details/", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8cGF0aCBkPSJNMjkuMywxMC4xYy0wLjQtMC4xLTAuOCwwLTEuMSwwLjNsLTMuMiw0Yy0xLjctMi01LjktNi40LTExLTYuNGMtMC4yLDAtMC4zLDAtMC41LDBjMS40LDIuNCwyLjEsNS4xLDIuMSw4DQoJCWMwLDIuOC0wLjcsNS42LTIuMSw4YzAuMiwwLDAuMywwLDAuNSwwYzUuMSwwLDkuMy00LjMsMTEtNi40bDMuMiw0YzAuMiwwLjIsMC41LDAuNCwwLjgsMC40YzAuMSwwLDAuMiwwLDAuMy0wLjENCgkJYzAuNC0wLjEsMC43LTAuNSwwLjctMC45VjExQzMwLDEwLjYsMjkuNywxMC4yLDI5LjMsMTAuMXoiLz4NCgk8cGF0aCBkPSJNMTEuNCw4LjRjLTUuMiwxLjUtOSw2LjgtOS4yLDdjLTAuMiwwLjMtMC4yLDAuOCwwLDEuMmMwLjIsMC4zLDQsNS42LDkuMiw3YzEuNS0yLjMsMi4yLTQuOSwyLjItNy42DQoJCUMxMy42LDEzLjMsMTIuOCwxMC42LDExLjQsOC40eiBNMTAsMTZjMCwwLjYtMC40LDEtMSwxcy0xLTAuNC0xLTF2LTJjMC0wLjYsMC40LTEsMS0xczEsMC40LDEsMVYxNnoiLz4NCjwvZz4NCjwvc3ZnPg0K", + "name": "BoidsMovement", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Glyphster Pack/Master/SVG/Restaurant/Restaurant_restaurant_seafood_animal_fish.svg", + "shortDescription": "Simulates flocks movement.", + "version": "0.3.0", + "description": [ + "Simulates swarms or flocks movement following the separation, alignment, cohesion principles. The flock can be attracted to a location or avoid some obstacles.", + "", + "The [Fish School example](https://editor.gdevelop.io/?project=example://fish-school) shows how properties impact on the movement." + ], + "origin": { + "identifier": "BoidsMovement", + "name": "gdevelop-extension-store" + }, + "tags": [ + "flock", + "swarm", + "boids", + "crowd", + "horde" + ], + "authorIds": [ + "rotBq28wITdtfsrE7McHQri4k2w2", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [ + { + "folded": true, + "name": "HasAlreadyRunThisFrame", + "type": "boolean", + "value": false + } + ], + "eventsFunctions": [ + { + "description": "Define helper classes JavaScript code.", + "fullName": "Define helper classes", + "functionType": "Action", + "name": "DefineHelperClasses", + "private": true, + "sentence": "Define helper classes JavaScript code", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (gdjs.__boidsExtension) {", + " return;", + "}", + "", + "/**", + " * A vector", + " */", + "class Vector {", + " /** @type {number} */", + " x;", + " /** @type {number} */", + " y;", + "", + " /**", + " * Create a vector.", + " * @param {number} x", + " * @param {number} y", + " */", + " constructor(x, y) {", + " this.x = x;", + " this.y = y;", + " }", + "", + " /**", + " * @param {number} x", + " * @param {number} y", + " * @returns {Vector} this object", + " */", + " set(x, y) {", + " this.x = x;", + " this.y = y;", + " return this;", + " }", + "", + " /**", + " * Adds a velocity to this vector", + " * @param {Vector} referenceVector gets the velocity to be added", + " * @returns {Vector} this object", + " */", + " add(referenceVector) {", + " this.x += referenceVector.x;", + " this.y += referenceVector.y;", + "", + " return this;", + " }", + "", + " /**", + " * Normalize the vector", + " * @returns {Vector}", + " */", + " normalize() {", + " const len = this.magnitude();", + " if (len !== 0) this.multiply(1 / len);", + " return this;", + " }", + "", + " /**", + " * Multiply vectors verticies", + " * @param {float} amount", + " * @returns {Vector}", + " */", + " multiply(amount) {", + " this.x *= amount;", + " this.y *= amount;", + " return this;", + " }", + "", + " /**", + " * Divide vectors verticies", + " * @param {float} amount", + " * @returns {Vector}", + " */", + " divide(amount) {", + " this.x /= amount;", + " this.y /= amount;", + "", + " return this;", + " }", + "", + " /**", + " * Subtracts vectors verticies from a reference vector", + " * @param {Vector} referenceVector", + " * @returns {Vector}", + " */", + " subtract(referenceVector) {", + " this.x -= referenceVector.x;", + " this.y -= referenceVector.y;", + "", + " return this;", + " }", + "", + " /**", + " * Limits Vectors speed", + " * @param {number} max", + " * @returns {Vector}", + " */", + " limit(max) {", + " const mSq = this.magnitudeSquare();", + " if (mSq > max * max) {", + " this.divide(Math.sqrt(mSq)).multiply(max);", + " }", + " return this;", + " }", + "", + " /**", + " * Calculate the vectors direction", + " * @returns {float}", + " */", + " heading() {", + " return Math.atan2(this.y, this.x);", + " }", + "", + " /**", + " * Calculate the vectors magnitude squared", + " * @returns {float}", + " */", + " magnitudeSquare() {", + " const x = this.x;", + " const y = this.y;", + " return x * x + y * y;", + " };", + "", + " /**", + " * Calculate the vectors magnitude", + " * @returns {float}", + " */", + " magnitude() {", + " return Math.sqrt(this.magnitudeSquare());", + " }", + "}", + "", + "/**", + " * A boid agent", + " * Methods for Separation, Cohesion, Alignment added", + " * Inspired from The Nature of Code - Daniel Shiffman", + " * http://natureofcode.com", + " * ", + " * Original source code:", + " * https://github.com/nature-of-code/noc-examples-processing/blob/master/chp06_agents/NOC_6_09_Flocking/Boid.pde", + " */", + "class Boid {", + " /** @type {gdjs.BehaviorRBushAABB} */", + " currentRBushAABB = null;", + " acceleration = new Vector(0, 0);", + " velocity = new Vector(gdjs.randomFloatInRange(-1, 1), gdjs.randomFloatInRange(-1, 1));", + " separationDirection = new Vector(0, 0);", + " alignmentDirection = new Vector(0, 0);", + " cohesionDirection = new Vector(0, 0);", + " customIntentsDirectionSum = new Vector(0, 0);", + " separateWorkingVector = new Vector(0, 0);", + "", + " /**", + " * Create a boid agent.", + " * @param {gdjs.RuntimeBehavior} behavior", + " */", + " constructor(behavior) {", + " /** @type {gdjs.RuntimeBehavior} */", + " this.behavior = behavior;", + " }", + "", + " /**", + " * Add a custom intent.", + " * @param {Boid} boid", + " * @param {number} directionX", + " * @param {number} directionY", + " * @param {number} weight", + " */", + " addIntent(directionX, directionY, weight) {", + "", + " if (directionX === 0 && directionY === 0) {", + " return;", + " }", + "", + " const length = Math.hypot(directionX, directionY);", + " const unitX = directionX / length;", + " const unitY = directionY / length;", + "", + " this.customIntentsDirectionSum.x += unitX * weight;", + " this.customIntentsDirectionSum.y += unitY * weight;", + " }", + "", + " /**", + " * Vector between 2 boids.", + " * @param {Boid} boid", + " * @param {Vector} vector the vector to return the result", + " * @returns {Vector} vector", + " */", + " getVectorTo(boid, vector) {", + " const object = this.behavior.owner;", + " const otherObject = boid.behavior.owner;", + " let x = otherObject.x - object.x;", + " let y = otherObject.y - object.y;", + " vector.set(x, y);", + " return vector;", + " }", + "", + " /**", + " * Applys the three rules of boids", + " */", + " flock() {", + " const separationDirection = this.separate();", + " const alignmentDirection = this.align();", + " const cohesionDirection = this.cohesion();", + "", + " separationDirection.multiply(this.behavior.SeparationWeight());", + " alignmentDirection.multiply(this.behavior.AlignmentWeight());", + " cohesionDirection.multiply(this.behavior.CohesionWeight());", + "", + " const direction = separationDirection.add(alignmentDirection).add(cohesionDirection).add(this.customIntentsDirectionSum);", + " this.acceleration.add(this.steer(direction));", + "", + " this.customIntentsDirectionSum.set(0, 0);", + " }", + "", + " /**", + " * Apply the acceleration from the steer force.", + " */", + " move() {", + " const object = this.behavior.owner;", + " const timeDelta = object.getElapsedTime(object.getInstanceContainer()) / 1000;", + " this.acceleration.multiply(timeDelta);", + "", + " const previousVelocityX = this.velocity.x;", + " const previousVelocityY = this.velocity.y;", + "", + " this.velocity.add(this.acceleration);", + " this.velocity.limit(this.behavior.MaxSpeed());", + " this.acceleration.set(0, 0);", + "", + " if (this.behavior.ShouldRotate()) {", + " let theta = this.velocity.heading() * 180 / Math.PI;", + " object.setAngle(theta);", + " }", + " // Verlet integration", + " object.setX(object.x + (previousVelocityX + this.velocity.x) / 2 * timeDelta);", + " object.setY(object.y + (previousVelocityY + this.velocity.y) / 2 * timeDelta);", + " }", + "", + " /**", + " * Calculates and applies steering force towards a direction", + " * @param {Vector} desiredDirection", + " * @return {Vector} alignment force", + " */", + " steer(desiredDirection) {", + " desiredDirection.normalize();", + " desiredDirection.multiply(this.behavior.MaxSpeed());", + " let steer = desiredDirection.subtract(this.velocity);", + " steer.limit(this.behavior.MaxAcceleration());", + " return steer;", + " }", + "", + " /**", + " * Separation: checks for nearby boids.", + " * @return {Vector} separation direction", + " */", + " separate() {", + " const runtimeScene = this.behavior.owner.getInstanceContainer();", + " /** @type {BoidsManager} */", + " const manager = runtimeScene.__boidsExtension.boidsManager;", + " const separationRadius = this.behavior.SeparationRadius();", + " this.separationDirection.set(0, 0);", + " let diff = this.separateWorkingVector;", + " const object = this.behavior.owner;", + "", + " const nearbyBoids = manager.getAllBoidsAround(this, separationRadius);", + " for (let i = 0; i < nearbyBoids.length; i++) {", + " const boid = nearbyBoids[i];", + " const otherObject = boid.behavior.owner;", + " const distance = object.getDistanceToObject(otherObject);", + " if (distance > 0) {", + " diff = boid.getVectorTo(this, diff);", + " diff.normalize();", + " diff.divide(distance);", + " this.separationDirection.add(diff);", + " }", + " }", + " if (this.separationDirection.magnitudeSquare() > 0) {", + " this.separationDirection.normalize();", + " }", + " return this.separationDirection;", + " }", + "", + " /**", + " * Alignment: calculate the average velocity for every nearby boid in the system", + " * @return {Vector} alignment direction", + " */", + " align() {", + " const runtimeScene = this.behavior.owner.getInstanceContainer();", + " /** @type {BoidsManager} */", + " const manager = runtimeScene.__boidsExtension.boidsManager;", + " const alignmentRadius = this.behavior.AlignmentRadius();", + " this.alignmentDirection.set(0, 0);", + " let count = 0;", + " const object = this.behavior.owner;", + "", + " const nearbyBoids = manager.getAllBoidsAround(this, alignmentRadius);", + " for (let i = 0; i < nearbyBoids.length; i++) {", + " const boid = nearbyBoids[i];", + " this.alignmentDirection.add(boid.velocity);", + " count++;", + " }", + " if (count > 0) {", + " this.alignmentDirection.normalize();", + " }", + " return this.alignmentDirection;", + " }", + "", + " /**", + " * Cohesion: calculate direction vector towards the average location of all nearby boids", + " * @return {Vector} cohesion direction", + " */", + " cohesion() {", + " const runtimeScene = this.behavior.owner.getInstanceContainer();", + " /** @type {BoidsManager} */", + " const manager = runtimeScene.__boidsExtension.boidsManager;", + " const cohesionRadius = this.behavior.CohesionRadius();", + " let count = 0;", + " let sumX = 0;", + " let sumY = 0;", + " const object = this.behavior.owner;", + "", + " const nearbyBoids = manager.getAllBoidsAround(this, cohesionRadius);", + " for (let i = 0; i < nearbyBoids.length; i++) {", + " const boid = nearbyBoids[i];", + " const otherObject = boid.behavior.owner;", + " sumX += otherObject.getCenterXInScene();", + " sumY += otherObject.getCenterYInScene();", + " count++;", + " }", + " if (count > 0) {", + " sumX /= count;", + " sumY /= count;", + "", + " // A vector pointing from the position to the target", + " this.cohesionDirection.set(", + " sumX - object.getCenterXInScene(),", + " sumY - object.getCenterYInScene()", + " )", + " }", + " return this.cohesionDirection.normalize();", + " }", + "}", + "", + "/**", + " * A boids manager", + " */", + "class BoidsManager {", + " static searchArea = {minX: 0, minY: 0, maxX: 0, maxY: 0};", + " /**", + " * @type {Array}", + " */", + " static foundBoids = [];", + "", + " /**", + " * Create a manager.", + " */", + " constructor() {", + " /**", + " * @type {Set}", + " */", + " this.boids = new Set();", + " this.boidsRBush = new rbush();", + " }", + "", + " /**", + " * Create and register a boid.", + " * @param {gdjs.RuntimeBehavior} behavior", + " * @returns {Boid} the created Boid", + " */", + " add(behavior) {", + " if (!behavior.__boidsExtension) {", + " behavior.__boidsExtension = {", + " boid: new Boid(behavior)", + " };", + " }", + " const boid = behavior.__boidsExtension.boid;", + " this.boids.add(boid);", + " this.addToRBush(boid);", + " return boid;", + " }", + "", + " /**", + " * Add a boid to the R-Tree.", + " * @param {Boid} boid", + " */", + " addToRBush(boid) {", + " if (boid.currentRBushAABB) {", + " boid.currentRBushAABB.updateAABBFromOwner();", + " }", + " else {", + " boid.currentRBushAABB = new gdjs.BehaviorRBushAABB(", + " boid.behavior", + " );", + " }", + " this.boidsRBush.insert(boid.currentRBushAABB);", + " }", + "", + " /**", + " * Unregister the boid.", + " * @param {gdjs.RuntimeBehavior} behavior", + " */", + " remove(behavior) {", + " const boid = behavior.__boidsExtension.boid;", + " this.boids.delete(boid);", + "", + " this.removeFromRBush(boid);", + " }", + "", + " /**", + " * Remove a boid from the R-Tree.", + " * @param {Boid} boid", + " */", + " removeFromRBush(boid) {", + " this.boidsRBush.remove(boid.currentRBushAABB);", + " }", + "", + " /**", + " * Move all instances.", + " */", + " moveAll() {", + " for (const boid of this.boids) {", + " boid.flock();", + " }", + " for (const boid of this.boids) {", + " boid.move();", + " this.removeFromRBush(boid);", + " this.addToRBush(boid);", + " }", + " }", + "", + " /**", + " * Returns all the boids around the specified boid.", + " * @param {Boid} boid", + " * @param {number} radius", + " * @return {Boid[]} An array with all boids near the object.", + " */", + " getAllBoidsAround(boid, radius) {", + " const object = boid.behavior.owner;", + "", + " const x = object.getCenterXInScene();", + " const y = object.getCenterYInScene();", + " const searchArea = BoidsManager.searchArea;", + " searchArea.minX = x - radius;", + " searchArea.minY = y - radius;", + " searchArea.maxX = x + radius;", + " searchArea.maxY = y + radius;", + " // TODO The R-Tree should not allocate an array.", + " /** @type {Array} */", + " const nearbys = this.boidsRBush.search(searchArea);", + "", + " const radiusSq = radius * radius;", + " const foundBoids = BoidsManager.foundBoids;", + " foundBoids.length = 0;", + " // Cap the number of boids between 20 and 40.", + " const step = Math.ceil(nearbys.length / 40);", + " for (let i = 0; i < nearbys.length; i += step) {", + " const behavior = nearbys[i].behavior;", + " const otherObject = behavior.owner;", + " if (object === otherObject) {", + " continue;", + " }", + " if (behavior._getCollisionLayer() !== behavior._getCollisionLayer()) {", + " continue;", + " }", + " const distanceSq = object.getSqDistanceToObject(otherObject);", + " if (distanceSq < radiusSq) {", + " foundBoids.push(behavior.__boidsExtension.boid);", + " }", + " }", + " return foundBoids;", + " }", + "}", + "", + "gdjs.__boidsExtension = {", + " BoidsManager,", + "};", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Move as part of a flock.", + "fullName": "Boids Movement", + "name": "BoidsMovement", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Initiate and attach properties as objects variables" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "BoidsMovement::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "runtimeScene.__boidsExtension = runtimeScene.__boidsExtension || {\r", + " boidsManager: new gdjs.__boidsExtension.BoidsManager(),\r", + "};\r", + "\r", + "const object = objects[0];\r", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", + "const behavior = object.getBehavior(behaviorName);\r", + "runtimeScene.__boidsExtension.boidsManager.add(behavior);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Update boids position every frame" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "HasAlreadyRunThisFrame", + "=", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HasAlreadyRunThisFrame", + "True", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "runtimeScene.__boidsExtension.boidsManager.moveAll();\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HasAlreadyRunThisFrame", + "False", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "runtimeScene.__boidsExtension.boidsManager.add(behavior);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "runtimeScene.__boidsExtension.boidsManager.remove(behavior);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDestroy", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const object = objects[0];\r", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", + "const behavior = object.getBehavior(behaviorName);\r", + "runtimeScene.__boidsExtension.boidsManager.remove(behavior);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Intend to move in a given direction.", + "fullName": "Move in a direction", + "functionType": "Action", + "name": "MoveInDirection", + "sentence": "_PARAM0_ intent to move in the direction _PARAM2_; _PARAM3_ (decision weight: _PARAM4_)", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "const directionX = eventsFunctionContext.getArgument(\"DirectionX\");", + "const directionY = eventsFunctionContext.getArgument(\"DirectionY\");", + "const decisionWeight = eventsFunctionContext.getArgument(\"DecisionWeight\");", + "", + "behavior.__boidsExtension.boid.addIntent(directionX, directionY, decisionWeight);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + }, + { + "description": "Direction X", + "name": "DirectionX", + "type": "expression" + }, + { + "description": "Direction Y", + "name": "DirectionY", + "type": "expression" + }, + { + "description": "Decision weight", + "name": "DecisionWeight", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Intend to move toward a position.", + "fullName": "Move toward a position", + "functionType": "Action", + "name": "MoveToPosition", + "sentence": "_PARAM0_ intend to move toward _PARAM2_; _PARAM3_ (decision weight: _PARAM4_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::MoveInDirection" + }, + "parameters": [ + "Object", + "Behavior", + "TargetX - Object.CenterX()", + "TargetY - Object.CenterY()", + "DecisionWeight", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + }, + { + "description": "Target X", + "name": "TargetX", + "type": "expression" + }, + { + "description": "Target Y", + "name": "TargetY", + "type": "expression" + }, + { + "description": "Decision weight", + "name": "DecisionWeight", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Intend to move toward an object.", + "fullName": "Move toward an object", + "functionType": "Action", + "name": "MoveToObject", + "sentence": "_PARAM0_ intend to move toward _PARAM2_ (decision weight: _PARAM3_)", + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "TargetedObject", + "conditions": [], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::MoveToPosition" + }, + "parameters": [ + "Object", + "Behavior", + "TargetedObject.CenterX()", + "TargetedObject.CenterY()", + "DecisionWeight", + "GetArgumentAsNumber(\"DecisionWeight\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + }, + { + "description": "Targeted object", + "name": "TargetedObject", + "type": "objectList" + }, + { + "description": "Decision weight", + "name": "DecisionWeight", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Intend to avoid an area with a given center and radius.", + "fullName": "Avoid a position", + "functionType": "Action", + "name": "AvoidPosition", + "sentence": "_PARAM0_ intend to avoid a radius of _PARAM4_ around _PARAM2_; _PARAM3_ (decision weight: _PARAM5_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Evaluate at which distance the object will go past a location if it were to continue in its current direction.\n\nspeedUnitX = velocityX / speed\nspeedUnitY = velocityY / speed\n\ndeltaX = centerX - object.CenterX\ndeltaY = centerY - object.CenterY\n\nnormalX = -deltaY;\nnormalY = deltaX;\n\ntrajectoryDistance = speedUnitX * normalX + speedUnitY * normalY" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TrajectoryDistance", + "=", + "(Object.Behavior::VelocityX() * (Object.CenterY() - CenterY) + Object.Behavior::VelocityY() * (CenterX - Object.CenterX())) / Object.Behavior::Speed()" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If this distance is smaller than the specified radius, the Boid must try turn in the right direction to avoid the area." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TrajectoryDistance", + ">", + "- Radius" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TrajectoryDistance", + "<", + "Radius" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "(normalX ; normalY)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TrajectoryDistance", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::MoveInDirection" + }, + "parameters": [ + "Object", + "Behavior", + "-(CenterY - Object.CenterY())", + "CenterX - Object.CenterX()", + "DecisionWeight", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "(-normalX ; -normalY)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TrajectoryDistance", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::MoveInDirection" + }, + "parameters": [ + "Object", + "Behavior", + "CenterY - Object.CenterY()", + "-(CenterX - Object.CenterX())", + "DecisionWeight", + "" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "folded": true, + "name": "TrajectoryDistance", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + }, + { + "description": "Center X", + "name": "CenterX", + "type": "expression" + }, + { + "description": "Center Y", + "name": "CenterY", + "type": "expression" + }, + { + "description": "Radius", + "name": "Radius", + "type": "expression" + }, + { + "description": "Decision weight", + "name": "DecisionWeight", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Intend to avoid an area from an object center and a given radius.", + "fullName": "Avoid an object", + "functionType": "Action", + "name": "AvoidObject", + "sentence": "_PARAM0_ intend to avoid a radius of _PARAM3_ around _PARAM2_ (decision weight: _PARAM4_)", + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "AvoidedObject", + "conditions": [], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::AvoidPosition" + }, + "parameters": [ + "Object", + "Behavior", + "AvoidedObject.CenterX()", + "AvoidedObject.CenterY()", + "Radius", + "DecisionWeight", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + }, + { + "description": "Avoided object", + "name": "AvoidedObject", + "type": "objectList" + }, + { + "description": "Radius", + "name": "Radius", + "type": "expression" + }, + { + "description": "Decision weight", + "name": "DecisionWeight", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the current speed.", + "fullName": "Speed", + "functionType": "Expression", + "name": "Speed", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "const directionX = eventsFunctionContext.getArgument(\"DirectionX\");", + "const directionY = eventsFunctionContext.getArgument(\"DirectionY\");", + "const decisionWeight = eventsFunctionContext.getArgument(\"DecisionWeight\");", + "", + "eventsFunctionContext.returnValue = behavior.__boidsExtension.boid.velocity.magnitude();" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the current horizontal speed.", + "fullName": "Velocity X", + "functionType": "Expression", + "name": "VelocityX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "const directionX = eventsFunctionContext.getArgument(\"DirectionX\");", + "const directionY = eventsFunctionContext.getArgument(\"DirectionY\");", + "const decisionWeight = eventsFunctionContext.getArgument(\"DecisionWeight\");", + "", + "eventsFunctionContext.returnValue = behavior.__boidsExtension.boid.velocity.x;" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the current vertical speed.", + "fullName": "Velocity Y", + "functionType": "Expression", + "name": "VelocityY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "const directionX = eventsFunctionContext.getArgument(\"DirectionX\");", + "const directionY = eventsFunctionContext.getArgument(\"DirectionY\");", + "const decisionWeight = eventsFunctionContext.getArgument(\"DecisionWeight\");", + "", + "eventsFunctionContext.returnValue = behavior.__boidsExtension.boid.velocity.y;" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the maximum speed of the object.", + "fullName": "Maximum speed", + "functionType": "Action", + "group": "Boids movement configuration", + "name": "SetMaxSpeed", + "sentence": "Change the maximum speed of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::SetPropertyMaxSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "MaxSpeed" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + }, + { + "description": "Max Speed", + "name": "MaxSpeed", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the maximum acceleration of the object.", + "fullName": "Maximum acceleration", + "functionType": "Action", + "group": "Boids movement configuration", + "name": "SetMaxAcceleration", + "sentence": "Change the maximum acceleration of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::SetPropertyMaxAcceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "SteeringForce" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + }, + { + "description": "Steering Force", + "name": "SteeringForce", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is rotated while moving on its path.", + "fullName": "Object Rotated", + "functionType": "Condition", + "group": "Boids movement configuration", + "name": "ShouldRotate", + "sentence": "_PARAM0_ is rotated when moving", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::PropertyShouldRotate" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the maximum speed.", + "fullName": "Maximum speed", + "functionType": "Expression", + "group": "Boids movement configuration", + "name": "MaxSpeed", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "MaxSpeed" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the maximum acceleration.", + "fullName": "Maximum acceleration", + "functionType": "Expression", + "group": "Boids movement configuration", + "name": "MaxAcceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "MaxAcceleration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the cohesion sight radius.", + "fullName": "Cohesion sight radius", + "functionType": "Expression", + "group": "Boids sight configuration", + "name": "CohesionRadius", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "CohesionRadius" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the cohesion sight radius.", + "fullName": "Cohesion sight radius", + "functionType": "Action", + "group": "Boids sight configuration", + "name": "SetCohesionRadius", + "sentence": "Change the cohesion sight radius of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::SetPropertyCohesionRadius" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the alignment sight radius.", + "fullName": "Alignment sight radius", + "functionType": "Expression", + "group": "Boids sight configuration", + "name": "AlignmentRadius", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "AlignmentRadius" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the alignment sight radius.", + "fullName": "Alignment sight radius", + "functionType": "Action", + "group": "Boids sight configuration", + "name": "SetAlignmentRadius", + "sentence": "Change the alignment sight radius of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::SetPropertyAlignmentRadius" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the separation sight radius.", + "fullName": "Separation sight radius", + "functionType": "Expression", + "group": "Boids sight configuration", + "name": "SeparationRadius", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "SeparationRadius" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the separation sight radius.", + "fullName": "Separation sight radius", + "functionType": "Action", + "group": "Boids sight configuration", + "name": "SetSeparationRadius", + "sentence": "Change the separation sight radius of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::SetPropertySeparationRadius" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return which weight the cohesion takes in the chosen direction.", + "fullName": "Cohesion weight", + "functionType": "Expression", + "group": "Boids decision configuration", + "name": "CohesionWeight", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "CohesionWeight" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the weight the cohesion takes in the chosen direction.", + "fullName": "Cohesion weight", + "functionType": "Action", + "group": "Boids decision configuration", + "name": "SetCohesionWeight", + "sentence": "Change the cohesion weight of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::SetPropertyCohesionWeight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return which weight the alignment takes in the chosen direction.", + "fullName": "Alignment weight", + "functionType": "Expression", + "group": "Boids decision configuration", + "name": "AlignmentWeight", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "AlignmentWeight" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the weight the alignment takes in the chosen direction.", + "fullName": "Alignment weight", + "functionType": "Action", + "group": "Boids decision configuration", + "name": "SetAlignmentWeight", + "sentence": "Change the alignment weight of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::SetPropertyAlignmentWeight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return which weight the separation takes in the chosen direction.", + "fullName": "Separation weight", + "functionType": "Expression", + "group": "Boids decision configuration", + "name": "SeparationWeight", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "SeparationWeight" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the weight the separation takes in the chosen direction.", + "fullName": "Separation weight", + "functionType": "Action", + "group": "Boids decision configuration", + "name": "SetSeparationWeight", + "sentence": "Change the separation weight of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::SetPropertySeparationWeight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "360", + "type": "Number", + "unit": "PixelSpeed", + "label": "Maximum speed", + "description": "", + "group": "Movement", + "extraInformation": [], + "name": "MaxSpeed" + }, + { + "value": "720", + "type": "Number", + "unit": "PixelAcceleration", + "label": "Maximum acceleration", + "description": "", + "group": "Movement", + "extraInformation": [], + "name": "MaxAcceleration" + }, + { + "value": "true", + "type": "Boolean", + "label": "Rotate object", + "description": "", + "group": "Movement", + "extraInformation": [], + "name": "ShouldRotate" + }, + { + "value": "64", + "type": "Number", + "unit": "Pixel", + "label": "Cohesion sight radius", + "description": "", + "group": "Sight", + "extraInformation": [], + "name": "CohesionRadius" + }, + { + "value": "48", + "type": "Number", + "unit": "Pixel", + "label": "Alignement sight radius", + "description": "", + "group": "Sight", + "extraInformation": [], + "name": "AlignmentRadius" + }, + { + "value": "32", + "type": "Number", + "unit": "Pixel", + "label": "Separation sight radius", + "description": "", + "group": "Sight", + "extraInformation": [], + "name": "SeparationRadius" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Cohesion decision weight", + "description": "", + "group": "Decision", + "extraInformation": [], + "name": "CohesionWeight" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Alignment decision weight", + "description": "", + "group": "Decision", + "extraInformation": [], + "name": "AlignmentWeight" + }, + { + "value": "2", + "type": "Number", + "unit": "Dimensionless", + "label": "Separation decision weight", + "description": "", + "group": "Decision", + "extraInformation": [], + "name": "SeparationWeight" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "Collision layer", + "description": "", + "group": "", + "extraInformation": [], + "advanced": true, + "name": "CollisionLayer" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Visual effect", + "extensionNamespace": "", + "fullName": "Rolling counter", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXNvcnQtbnVtZXJpYy12YXJpYW50IiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTcuNzgsN0M5LjA4LDcuMDQgMTAsNy41MyAxMC41Nyw4LjQ2QzExLjEzLDkuNCAxMS40MSwxMC41NiAxMS4zOSwxMS45NUMxMS40LDEzLjUgMTEuMDksMTQuNzMgMTAuNSwxNS42MkM5Ljg4LDE2LjUgOC45NSwxNi45NyA3LjcxLDE3QzYuNDUsMTYuOTYgNS41NCwxNi41IDQuOTYsMTUuNTZDNC4zOCwxNC42MyA0LjA5LDEzLjQ1IDQuMDksMTJDNC4wOSwxMC41NSA0LjM5LDkuMzYgNSw4LjQ0QzUuNTksNy41IDYuNSw3LjA0IDcuNzgsN003Ljc1LDguNjNDNy4zMSw4LjYzIDYuOTYsOC45IDYuNyw5LjQ2QzYuNDQsMTAgNi4zMiwxMC44NyA2LjMyLDEyQzYuMzEsMTMuMTUgNi40NCwxNCA2LjY5LDE0LjU0QzYuOTUsMTUuMSA3LjMxLDE1LjM3IDcuNzcsMTUuMzdDOC42OSwxNS4zNyA5LjE2LDE0LjI0IDkuMTcsMTJDOS4xNyw5Ljc3IDguNyw4LjY1IDcuNzUsOC42M00xMy4zMywxN1YxNS4yMkwxMy43NiwxNS4yNEwxNC4zLDE1LjIyTDE1LjM0LDE1LjAzQzE1LjY4LDE0LjkyIDE2LDE0Ljc4IDE2LjI2LDE0LjU4QzE2LjU5LDE0LjM1IDE2Ljg2LDE0LjA4IDE3LjA3LDEzLjc2QzE3LjI5LDEzLjQ1IDE3LjQ0LDEzLjEyIDE3LjUzLDEyLjc4TDE3LjUsMTIuNzdDMTcuMDUsMTMuMTkgMTYuMzgsMTMuNCAxNS40NywxMy40MUMxNC42MiwxMy40IDEzLjkxLDEzLjE1IDEzLjM0LDEyLjY1QzEyLjc3LDEyLjE1IDEyLjUsMTEuNDMgMTIuNDYsMTAuNUMxMi40Nyw5LjUgMTIuODEsOC42OSAxMy40Nyw4LjAzQzE0LjE0LDcuMzcgMTUsNy4wMyAxNi4xMiw3QzE3LjM3LDcuMDQgMTguMjksNy40NSAxOC44OCw4LjI0QzE5LjQ3LDkgMTkuNzYsMTAgMTkuNzYsMTEuMTlDMTkuNzUsMTIuMTUgMTkuNjEsMTMgMTkuMzIsMTMuNzZDMTkuMDMsMTQuNSAxOC42NCwxNS4xMyAxOC4xMiwxNS42NEMxNy42NiwxNi4wNiAxNy4xMSwxNi4zOCAxNi40NywxNi42MUMxNS44MywxNi44MyAxNS4xMiwxNi45NiAxNC4zNCwxN0gxMy4zM00xNi4wNiw4LjYzQzE1LjY1LDguNjQgMTUuMzIsOC44IDE1LjA2LDkuMTFDMTQuODEsOS40MiAxNC42OCw5Ljg0IDE0LjY4LDEwLjM2QzE0LjY4LDEwLjggMTQuOCwxMS4xNiAxNS4wMywxMS40NkMxNS4yNywxMS43NyAxNS42MywxMS45MiAxNi4xMSwxMS45M0MxNi40MywxMS45MyAxNi43LDExLjg2IDE2LjkyLDExLjc0QzE3LjE0LDExLjYxIDE3LjMsMTEuNDYgMTcuNDEsMTEuMjhDMTcuNSwxMS4xNyAxNy41MywxMC45NyAxNy41MywxMC43MUMxNy41NCwxMC4xNiAxNy40Myw5LjY5IDE3LjIsOS4yOEMxNi45Nyw4Ljg3IDE2LjU5LDguNjUgMTYuMDYsOC42M005LjI1LDVMMTIuNSwxLjc1TDE1Ljc1LDVIOS4yNU0xNS43NSwxOUwxMi41LDIyLjI1TDkuMjUsMTlIMTUuNzVaIiAvPjwvc3ZnPg==", + "name": "RollingCounter", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/e509cccd7fb426978c4a79b639670f624f773a886848d288a12be5c28dd7d380_sort-numeric-variant.svg", + "shortDescription": "Smoothly change a counter value in a text object.", + "version": "1.0.0", + "description": "Smoothly change a counter value in a text object.", + "tags": [ + "score", + "animation", + "text" + ], + "authorIds": [ + "dt0tRnf2kHWJnjkrpnzTzNj9Yc63" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Smoothly changes a counter value in a text object.", + "fullName": "Rolling counter", + "name": "RollingCounter", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RollingCounter::RollingCounter::SetPropertyDisplayedValue" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Speed * TimeDelta() * LayerTimeScale(Object.Layer())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "sign(Speed)", + "=", + "sign(DisplayedValue - CounterValue)" + ] + } + ], + "actions": [ + { + "type": { + "value": "RollingCounter::RollingCounter::SetPropertyDisplayedValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "CounterValue" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "Object", + "Text", + "=", + "Prefix + ToString(roundTo(round(DisplayedValue / Increment) * Increment, 9)) + Suffix" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RollingCounter::RollingCounter", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the value of the counter.", + "fullName": "Counter value", + "functionType": "ExpressionAndCondition", + "name": "Value", + "sentence": "the counter value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "CounterValue" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RollingCounter::RollingCounter", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Value", + "name": "SetValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RollingCounter::RollingCounter::SetPropertyDisplayedValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "CounterValue" + ] + }, + { + "type": { + "value": "RollingCounter::RollingCounter::SetPropertyCounterValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + }, + { + "type": { + "value": "RollingCounter::RollingCounter::SetPropertySpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "(CounterValue - DisplayedValue) / Duration" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RollingCounter::RollingCounter", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Directly display the counter value without playing the animation.", + "fullName": "Jump to the counter animation end", + "functionType": "Action", + "name": "ResetDisplayedValue", + "sentence": "Jump to the counter animation end of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RollingCounter::RollingCounter::SetPropertyDisplayedValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "CounterValue" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RollingCounter::RollingCounter", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Text capability", + "description": "", + "group": "", + "extraInformation": [ + "TextContainerCapability::TextContainerBehavior" + ], + "name": "Text" + }, + { + "value": "Score: ", + "type": "String", + "label": "Prefix", + "description": "", + "group": "", + "extraInformation": [], + "name": "Prefix" + }, + { + "value": "", + "type": "String", + "label": "Suffix", + "description": "", + "group": "", + "extraInformation": [], + "name": "Suffix" + }, + { + "value": "1", + "type": "Number", + "unit": "Second", + "label": "Animation duration", + "description": "", + "group": "", + "extraInformation": [], + "name": "Duration" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Increment", + "description": "", + "group": "", + "extraInformation": [], + "name": "Increment" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CounterValue" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "DisplayedValue" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Speed" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + } + ], + "externalLayouts": [ + { + "associatedLayout": "Game", + "name": "Level", + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1573, + "height": 1418, + "keepRatio": true, + "layer": "", + "name": "Cliff3", + "persistentUuid": "fd124638-ed69-49d6-be49-e2cb6e1fa28b", + "width": 1365, + "x": 17962, + "y": 5337, + "z": -900, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "fc92c400-be8c-4804-a4de-0761c918ac34", + "rotationY": 90, + "width": 390, + "x": -1477, + "y": 3478, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 500, + "height": 1000, + "layer": "", + "name": "SeaAndSky", + "persistentUuid": "a67d6249-0d71-4896-958b-e3f3dc72f8d9", + "width": 13500, + "x": -5500, + "y": -1000, + "z": -500, + "zOrder": 15, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "04cf1a4b-cb56-4e7d-b223-7ad9bdd583ca", + "width": 390, + "x": -1189, + "y": 3503, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 6, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "f2c83ff4-b55b-40c3-bdca-db33d4eb5677", + "rotationY": 180, + "width": 390, + "x": -837, + "y": 3460, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "409ef613-82ee-4932-a8e4-4a40e057e800", + "rotationY": 270, + "width": 390, + "x": -524, + "y": 3503, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "883250af-9d19-4680-9c4b-5bdbced1a05c", + "rotationY": 90, + "width": 390, + "x": -116, + "y": 3465, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "3a35345c-8769-4866-9951-b42e05dd5722", + "width": 390, + "x": 176, + "y": 3503, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "febef309-8271-41a7-97ec-1e5e477e0a0f", + "rotationY": 180, + "width": 390, + "x": 532, + "y": 3438, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "913bf26a-8c34-4d23-b1d2-a30b97e50e9a", + "rotationY": 270, + "width": 390, + "x": 854, + "y": 3438, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "9c8bce6e-5eba-44a6-8fcc-eeaaa2de3d42", + "rotationY": 90, + "width": 390, + "x": -2778, + "y": 3503, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "419874f0-64ab-4777-9c71-590e1c04bfb8", + "width": 390, + "x": -2491, + "y": 3503, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "a9163923-7c99-4345-8e08-0b4a012bd687", + "rotationY": 180, + "width": 390, + "x": -2153, + "y": 3503, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "6cbf23f6-e7a6-4912-8870-2f1c8fc6115e", + "rotationY": 270, + "width": 390, + "x": -1839, + "y": 3503, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "b732721c-2c6e-4a6c-8bf6-afe8638b8520", + "rotationY": 90, + "width": 390, + "x": 2487, + "y": 3503, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "bbb545b3-91ff-40fb-bb29-f53a03c01a0c", + "width": 390, + "x": 2782, + "y": 3456, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "b734a237-0890-4b5c-ad6b-df2863f4e600", + "rotationY": 180, + "width": 390, + "x": 3128, + "y": 3456, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "432c919f-2b27-4ef4-919f-393332d17f45", + "rotationY": 270, + "width": 390, + "x": 3447, + "y": 3503, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "0a76356c-7d61-42bd-93e9-84c579ccd49b", + "rotationY": 90, + "width": 390, + "x": 3848, + "y": 3503, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "2bd01ef7-c961-46ee-88a2-32eff58e3e3c", + "width": 390, + "x": 4147, + "y": 3503, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "0d619cc8-de3c-4f30-b7e6-8d891e0f3ba3", + "rotationY": 180, + "width": 390, + "x": 4512, + "y": 3503, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "2319882a-f9b8-4e24-a5ef-998cac7838a2", + "rotationY": 270, + "width": 390, + "x": 4834, + "y": 3503, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "d9d092ff-f722-4a99-afa1-638b59c08955", + "rotationY": 90, + "width": 390, + "x": 1184, + "y": 3438, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "84e1ecf5-e3ae-4fda-96c8-a1e81945185e", + "width": 390, + "x": 1471, + "y": 3438, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "f1b234b2-ce4c-4854-b141-29758f1a17ab", + "rotationY": 180, + "width": 390, + "x": 1809, + "y": 3438, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "9111d244-06e0-447a-8eaa-8f08ff381c72", + "rotationY": 270, + "width": 390, + "x": 2123, + "y": 3438, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 3935, + "height": 3666, + "keepRatio": true, + "layer": "", + "name": "Cliff3", + "persistentUuid": "168320d4-3560-4317-ab5e-190f37d8e756", + "rotationY": 180, + "width": 3555, + "x": 4923, + "y": 3813, + "z": -2000, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 3935, + "height": 3741, + "keepRatio": true, + "layer": "", + "name": "Cliff3", + "persistentUuid": "3c87db45-cfb3-4f9b-81f8-cb0ad17e2c29", + "rotationY": 270, + "width": 3940, + "x": -1955, + "y": 3955, + "z": -2000, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 55, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "0aa0f0f3-9e61-4e25-b790-7afc14ad899b", + "rotationY": 90, + "width": 390, + "x": -3070, + "y": 3326, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 55, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "6d0662c6-832f-4fe1-ae09-bb12f086d97f", + "rotationY": 180, + "width": 390, + "x": -3254, + "y": 3025, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 55, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "02d52070-96a3-47d5-9fd3-d951ad5aed1b", + "rotationY": 270, + "width": 390, + "x": -3507, + "y": 2767, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 55, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "3dd348c9-790c-487a-bc04-7b9f6c89d1fd", + "width": 390, + "x": -3660, + "y": 2512, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 64, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "8e01281d-b904-4629-bb3f-dd2a942d6a7c", + "rotationY": 90, + "width": 390, + "x": -3781, + "y": 2280, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 64, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "10d4e0b2-c6aa-4c56-951f-8b2e3e16647b", + "rotationY": 180, + "width": 390, + "x": -3914, + "y": 1953, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 64, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "d7df253e-d445-4479-b52c-f3fc95e81004", + "rotationY": 270, + "width": 390, + "x": -4123, + "y": 1658, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 64, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "70046cc2-513c-4ab5-8ac0-7ced098ce5a8", + "width": 390, + "x": -4233, + "y": 1382, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 52, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "e36b172a-4fd4-4e65-93d6-2ee39512b8e6", + "rotationY": 90, + "width": 390, + "x": -4333, + "y": 1156, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 52, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "b61ac186-f617-42d0-aa8f-d281d2d801b1", + "rotationY": 180, + "width": 390, + "x": -4535, + "y": 867, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 52, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "87e80e83-8025-41f5-9a57-00fd5a1b9562", + "rotationY": 270, + "width": 390, + "x": -4803, + "y": 625, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 52, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "a7fe075c-6537-4879-9a9c-187be0c4001e", + "width": 390, + "x": -4971, + "y": 380, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 52, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "d3553925-4397-47cb-b704-80d9ec6668fb", + "width": 390, + "x": -5139, + "y": 137, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 304, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "ebab5c8b-d105-4f69-a8a4-07ca6055a105", + "rotationY": 90, + "width": 390, + "x": 7377, + "y": 305, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 304, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "1a5ec1df-dfac-4434-bed6-18b4725323bb", + "rotationY": 180, + "width": 390, + "x": 7163, + "y": 585, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 304, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "a2e03959-2abe-475e-bb84-cc8b579fd950", + "rotationY": 270, + "width": 390, + "x": 7013, + "y": 914, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 304, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "01e267c5-2980-4fd4-b633-5357376b8fea", + "width": 390, + "x": 6830, + "y": 1148, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 313, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "d4c5c5c3-ddd4-4339-8d37-68444c97b017", + "rotationY": 90, + "width": 390, + "x": 6664, + "y": 1327, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 313, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "6748ffc4-03b4-4dd9-8d9c-5e976d6348aa", + "rotationY": 180, + "width": 390, + "x": 6407, + "y": 1569, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 313, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "63354bad-c2de-42d3-9c89-e52cb2c703d7", + "rotationY": 270, + "width": 390, + "x": 6207, + "y": 1870, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 313, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "81d5d30e-c5cf-4482-9116-f30902ae1a54", + "width": 390, + "x": 5989, + "y": 2072, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 301, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "26710051-173f-4b92-90dd-0c01e9e0a916", + "rotationY": 90, + "width": 390, + "x": 5806, + "y": 2271, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 301, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "75f576f0-bdb8-4104-8909-596335f26edd", + "rotationY": 180, + "width": 390, + "x": 5609, + "y": 2563, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 301, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "88801a01-5d03-4ffe-86a8-b5b7eaa57536", + "rotationY": 270, + "width": 390, + "x": 5480, + "y": 2900, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 301, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "fe6abe95-4da0-4201-a016-02f037fb8e10", + "width": 390, + "x": 5312, + "y": 3145, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 301, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "6e260884-69cb-4b27-848a-1176af3288b7", + "width": 390, + "x": 5146, + "y": 3390, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 304, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "68c63080-ce7b-4c0f-8b16-006d3ce586b3", + "rotationY": 90, + "width": 390, + "x": 7592, + "y": 112, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "4d8c4255-aef5-4ea8-a6f3-e4478cd57b31", + "width": 0, + "x": 3723, + "y": 1018, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "RedSnapper" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "bb789d8c-c60e-4acf-86b6-da7194fd5ce5", + "width": 0, + "x": -2707, + "y": 740, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "Clownfish" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "f5484302-bb98-4435-933a-cb648f5142ce", + "width": 0, + "x": -1445, + "y": 2053, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "YellowTang" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "e8618415-5039-4b5c-a434-e410f40c2063", + "width": 0, + "x": -2324, + "y": 1584, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "ParrotFish" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "be1100b2-a130-4413-a2c4-21449d61315a", + "width": 0, + "x": -1416, + "y": 773, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "RedSnapper" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "d1b5a4c9-2798-489e-9195-d8478335e33c", + "width": 0, + "x": 4786, + "y": 705, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "ParrotFish" + } + ] + }, + { + "angle": 82, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "180d7b4d-35f6-4ff4-9686-88635b9c9d9f", + "rotationX": -90, + "width": 536, + "x": -3294, + "y": 3379, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 330, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "1aa29ec0-96ce-4838-b768-f9754b78d171", + "rotationX": -90, + "width": 536, + "x": -3485, + "y": 3105, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 213, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "b8c46791-cf83-491c-89d6-2993ab552c30", + "rotationX": -90, + "width": 536, + "x": -3709, + "y": 2756, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 218, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "742cc1c3-ab59-4fa3-a854-4fccebd8fbfb", + "rotationX": -90, + "width": 536, + "x": -4302, + "y": 1714, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 335, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "a08229db-0c11-4ef6-9744-59d932ba803d", + "rotationX": -90, + "width": 536, + "x": -4095, + "y": 2087, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 87, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "1749333d-9c98-42ca-ad6d-3b848191db41", + "rotationX": -90, + "width": 536, + "x": -3940, + "y": 2388, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 213, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "7f8d2c51-965b-42c4-9e58-3e15268d1833", + "rotationX": -90, + "width": 536, + "x": -4898, + "y": 703, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 330, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "c97b1ee6-b048-4038-b9d5-7a5c8e78f9d3", + "rotationX": -90, + "width": 536, + "x": -4674, + "y": 1052, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 82, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "711ae087-9e6c-479a-a5f8-58ad70e60e15", + "rotationX": -90, + "width": 536, + "x": -4483, + "y": 1326, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 187, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "74782ef6-fb7d-4aa7-8e1a-83a1c9bbe000", + "rotationX": -90, + "width": 536, + "x": -5172, + "y": 367, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 187, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "c4d38b8d-0a8d-46cf-95f2-a4817afdb088", + "rotationX": -90, + "width": 536, + "x": 7843, + "y": 199, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 213, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "f5832a89-1055-46eb-92a1-ca4750fdc37e", + "rotationX": -90, + "width": 536, + "x": 7584, + "y": 442, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 330, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "fd8f2c17-1a75-4c7b-92c4-f62bd5f8e280", + "rotationX": -90, + "width": 536, + "x": 7314, + "y": 771, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 82, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "29832979-1c8f-4658-837f-fa73c7c722f8", + "rotationX": -90, + "width": 536, + "x": 7039, + "y": 1059, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 218, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "2383ba77-f4d2-4a66-9511-8b376b76bd0b", + "rotationX": -90, + "width": 536, + "x": 6886, + "y": 1433, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 335, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "5026c5cc-9858-4b6c-867c-455adf5029af", + "rotationX": -90, + "width": 536, + "x": 6533, + "y": 1746, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 87, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "e801db31-1a51-420b-bb8d-5b86ffe20621", + "rotationX": -90, + "width": 536, + "x": 6241, + "y": 2007, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 213, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "3a37dfca-182e-4b0c-8b13-79b7ee12144a", + "rotationX": -90, + "width": 536, + "x": 6040, + "y": 2368, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 330, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "ae519539-1c21-4ab1-b025-bdb9c371ecbd", + "rotationX": -90, + "width": 536, + "x": 5757, + "y": 2725, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 82, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "425f76ae-dffb-4a99-b6ed-9268d9302b23", + "rotationX": -90, + "width": 536, + "x": 5555, + "y": 3031, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 190, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "fe60712b-541a-4a96-a84c-d9ed8f7abc95", + "rotationX": -90, + "width": 536, + "x": 5340, + "y": 3350, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 218, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "1b8a4e8a-ad8f-4d7a-a58f-49f8e8411cb3", + "rotationX": -90, + "width": 536, + "x": 5775, + "y": 3391, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 144, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "4a6e2781-3b6c-40b6-a5b7-7985b53e1a7a", + "rotationX": -90, + "width": 536, + "x": 6036, + "y": 3020, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 190, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "33278f87-6e7a-44da-b833-40f4ac3ba89c", + "rotationX": -90, + "width": 536, + "x": 6265, + "y": 2615, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 190, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "a0ff2562-6897-4d5e-ac7d-99bec58263e2", + "rotationX": -90, + "width": 536, + "x": 6525, + "y": 2248, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 190, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "432ff665-5abc-47ca-b9c9-ca46040771b9", + "rotationX": -90, + "width": 536, + "x": 6817, + "y": 1895, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 190, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "603ca9fc-9f45-4ff3-b2fe-254fca8e9c2c", + "rotationX": -90, + "width": 536, + "x": 7196, + "y": 1578, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "340d764c-bb82-45ce-ba8c-ad97a7d12a04", + "rotationY": 90, + "width": 390, + "x": 7623, + "y": -158, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "1a71b08c-8786-4175-97bc-fcdf74bf96c0", + "rotationY": 90, + "width": 390, + "x": -5320, + "y": -143, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "70eb21f9-5370-4f58-8eb9-276a050d7193", + "width": 0, + "x": -2972, + "y": 2054, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "Clownfish" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "e28cb4ca-909f-42ff-8361-bbabb4307131", + "width": 0, + "x": 5876, + "y": 1011, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "RedSnapper" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "dfcf86aa-16d3-43a0-a0b0-938a87e330e7", + "width": 0, + "x": -3677, + "y": 911, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "RedSnapper" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "d4b54f4f-c21d-440e-877d-e5d9c51ab7f9", + "width": 0, + "x": -1979, + "y": 2994, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "Lionfish" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "9a6c7281-e029-419d-bb40-1e0bfde415bf", + "width": 0, + "x": 4391, + "y": 3007, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "Lionfish" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "c505912e-5bba-4f5e-a9e9-0c8464f5792d", + "width": 0, + "x": 1590, + "y": 2798, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "Anglerfish" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "3e5f8d64-6437-4247-877d-3581ffce017c", + "width": 0, + "x": 922, + "y": 2705, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "Anglerfish" + } + ] + }, + { + "angle": 290, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "63e96a6f-c0ac-4335-8db2-89383b2c11d6", + "rotationY": 180, + "width": 390, + "x": -25, + "y": 155, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 66, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "232f7cca-b970-49a2-8fdd-e0c5e059b315", + "width": 390, + "x": 2573, + "y": 110, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 299, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "56ae22b4-8705-4f93-9825-ee56625f97f3", + "rotationY": 270, + "width": 390, + "x": -140, + "y": 391, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 299, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "23df5a1e-cd33-432e-b833-7b0342ccd460", + "width": 390, + "x": -314, + "y": 596, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 299, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "1070bd8e-4a9c-4e3a-bc93-50d484b93de7", + "rotationY": 90, + "width": 390, + "x": -403, + "y": 846, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 181, + "customSize": true, + "depth": 392, + "height": 206, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "950494e1-a72c-464c-b903-a86df7f6ee9b", + "rotationY": 180, + "width": 376, + "x": -343, + "y": 897, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 16, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "29fa8333-8d5f-43f4-a2ec-60b6e1a79bb5", + "rotationY": 270, + "width": 390, + "x": -606, + "y": 1492, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 261, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "babb0518-3911-4bb1-beb3-a121be48ac55", + "width": 390, + "x": -689, + "y": 1586, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 249, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "4a6f39dd-f80f-42bc-a73e-3df01ecf4492", + "rotationY": 90, + "width": 390, + "x": -627, + "y": 1871, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 281, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "90117c48-64fc-4480-b1fb-65e8a8761947", + "rotationY": 90, + "width": 390, + "x": -613, + "y": 2263, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 299, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "d84c0248-6f02-4f28-8497-5a82b465d8e5", + "rotationY": 180, + "width": 390, + "x": -695, + "y": 2550, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 299, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "e956df91-182a-456f-a434-6152aa89895d", + "rotationY": 270, + "width": 390, + "x": -803, + "y": 2786, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 168, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "7e7fc704-342d-4069-8616-f7236401d551", + "width": 390, + "x": -731, + "y": 2777, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 190, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "dababd08-71d1-4def-9158-163a14ea2e2b", + "rotationY": 180, + "width": 390, + "x": -43, + "y": 942, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 190, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "b6ffbfed-66be-4ba5-b4bb-4fce993fa1c1", + "rotationY": 270, + "width": 390, + "x": 216, + "y": 967, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 190, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "a5a88606-771b-4aa5-83ad-9deae814eb7d", + "width": 390, + "x": 466, + "y": 1065, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 190, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "ddd16b31-0553-4d5d-aadf-89da776a3121", + "rotationY": 90, + "width": 390, + "x": 732, + "y": 1067, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 198, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "1731c701-d4f1-4726-abb3-a3b48e6ad658", + "rotationY": 180, + "width": 390, + "x": 1063, + "y": 1156, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 198, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "3a5a9f45-46e7-4d9b-8164-9bc1561b6146", + "rotationY": 270, + "width": 390, + "x": 1315, + "y": 1218, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 198, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "2f0abb7b-8d71-4859-ab77-7aebb322acab", + "width": 390, + "x": 1548, + "y": 1352, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 198, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "b2044e79-80b3-4872-bae2-1a1fa2f10cb3", + "rotationY": 90, + "width": 390, + "x": 1810, + "y": 1393, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 19, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "c64ab6fc-4c84-4d2d-a2d0-d54e7c6bfa98", + "rotationY": 180, + "width": 390, + "x": 476, + "y": 1873, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 19, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "beae3b5b-d970-467d-8d94-bc7f035cd1ee", + "rotationY": 270, + "width": 390, + "x": 225, + "y": 1808, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 19, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "416de88e-337e-4de5-9a08-4e3996db285a", + "width": 390, + "x": -8, + "y": 1673, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 19, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "2997a6a6-b3f0-4e1c-b25e-6fd3757de87f", + "rotationY": 90, + "width": 390, + "x": -269, + "y": 1630, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 175, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "cbdf5fbb-fcf5-419b-bcf1-4a18c359e828", + "rotationY": 180, + "width": 390, + "x": -417, + "y": 2738, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 175, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "e3794f0a-01d2-4d31-9ae7-f93a4cf60664", + "rotationY": 270, + "width": 390, + "x": -161, + "y": 2696, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 175, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "458c6acf-f86f-4aec-a65b-3f9e017f6e8a", + "width": 390, + "x": 107, + "y": 2725, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 175, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "e3927690-94b4-4c06-8212-b63d47dcbc82", + "rotationY": 90, + "width": 390, + "x": 364, + "y": 2659, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 67, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "ee23e71c-77be-430c-aec4-c9e01d2e12f4", + "rotationY": 180, + "width": 390, + "x": 2989, + "y": 1112, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 67, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "ab63f0cd-d4a2-40de-943f-f51f5f5188d0", + "rotationY": 270, + "width": 390, + "x": 2870, + "y": 881, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 67, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "1bd4bb20-a3ba-46c6-865a-423fb1f63690", + "width": 390, + "x": 2818, + "y": 618, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 67, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "e78199c7-3a85-40f5-92a8-c8213b45444e", + "rotationY": 90, + "width": 390, + "x": 2676, + "y": 393, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 183, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "f16e83bc-f3b0-44bb-b217-3d2a87e7ac20", + "rotationY": 180, + "width": 390, + "x": 2068, + "y": 1487, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 183, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "5bdcac9a-8ed1-4e58-b741-3a0732085bf2", + "rotationY": 270, + "width": 390, + "x": 2327, + "y": 1479, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 183, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "8697bcf6-90f8-42f5-b021-8892fcdf120c", + "width": 390, + "x": 2588, + "y": 1537, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 183, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "9fc47325-2083-4a62-b5a3-fd2ad2b2b3db", + "rotationY": 90, + "width": 390, + "x": 2851, + "y": 1512, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 116, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "9620ff9a-a70f-44ab-9cf8-f1312a61d325", + "width": 390, + "x": 3026, + "y": 1495, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 72, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "4863c76e-c778-4a75-aa95-548864969ac0", + "rotationY": 90, + "width": 390, + "x": 3076, + "y": 1372, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 150, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "0458390e-74ff-4650-8bd4-e56a67806cc1", + "rotationY": 180, + "width": 390, + "x": 3670, + "y": 2812, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 60, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "ac351137-ae9e-4baa-9d67-8719474d7ed1", + "rotationY": 270, + "width": 390, + "x": 3640, + "y": 2677, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 60, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "f723bfa8-5fab-4bc4-b44b-3d3716b73a62", + "width": 390, + "x": 3559, + "y": 2422, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 60, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "b6594e93-c3e8-4cab-802b-b3fe833acbe9", + "rotationY": 90, + "width": 390, + "x": 3392, + "y": 2214, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 106, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "e874f5f9-38d2-476d-a376-6098706d97e7", + "rotationY": 180, + "width": 390, + "x": 459, + "y": 2610, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 106, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "3400c5c6-b48a-4bb5-8677-3a2088e51ea9", + "rotationY": 270, + "width": 390, + "x": 509, + "y": 2356, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 106, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "d85977a8-4ee4-4062-938f-2396989d9610", + "width": 390, + "x": 631, + "y": 2116, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 57, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "0f3b3127-36d9-44ee-aaaf-05480dd96182", + "rotationY": 90, + "width": 390, + "x": 687, + "y": 1912, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 356, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "62df77be-5516-4490-9252-e5ba0bce3231", + "rotationY": 180, + "width": 390, + "x": 3173, + "y": 2176, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 356, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "66870e7e-ca66-452e-9d7c-2da061dee74a", + "rotationY": 270, + "width": 390, + "x": 2917, + "y": 2214, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 356, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "df2fd169-626e-48c1-8503-3d3b0627f11d", + "width": 390, + "x": 2650, + "y": 2181, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 356, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "25e4bbb8-4a3c-4daa-ab8b-ab794809de40", + "rotationY": 90, + "width": 390, + "x": 2392, + "y": 2243, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 299, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "c9b6b179-ea23-4c10-babd-bd77c9cb3097", + "rotationY": 180, + "width": 390, + "x": 2218, + "y": 2315, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 299, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "dab50da6-da1e-46ef-9adf-d0e8ff4da1dc", + "rotationY": 270, + "width": 390, + "x": 2110, + "y": 2551, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 205, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "dd23c645-6d1d-4131-93a2-7f577f17341c", + "width": 390, + "x": 2137, + "y": 2665, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 205, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "e9118082-fa1b-4ca0-b23c-c5095d48d962", + "rotationY": 90, + "width": 390, + "x": 2392, + "y": 2737, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 185, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "ab481ead-fac4-432f-8ffa-7b55de529510", + "rotationY": 180, + "width": 390, + "x": 2697, + "y": 2807, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 185, + "customSize": true, + "depth": 475, + "height": 249, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "cf7865c6-ca71-4af8-bebf-7ee741bce70d", + "rotationY": 270, + "width": 456, + "x": 2960, + "y": 2778, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 185, + "customSize": true, + "depth": 405, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "df202780-f6c7-4411-a392-e85905744e3e", + "width": 390, + "x": 3064, + "y": 2832, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 185, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "82dcf959-11ca-4d6b-8449-1e90f16e803f", + "rotationY": 90, + "width": 390, + "x": 3507, + "y": 2860, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 8, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "6952ce72-75ba-47f3-a201-b77bc4efe763", + "rotationY": 180, + "width": 390, + "x": 2467, + "y": 106, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 8, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "92971500-3949-4895-97c7-66bb20836148", + "rotationY": 270, + "width": 390, + "x": 2207, + "y": 90, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 8, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "790a11eb-cfd2-4e15-bca5-bcc8abd1636c", + "width": 390, + "x": 1954, + "y": 1, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 8, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "80f9d516-8143-4da4-a558-37f4f1b788d6", + "rotationY": 90, + "width": 390, + "x": 1688, + "y": 7, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 354, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "e642f1d8-2d3c-4088-918e-5eb67dbdba3a", + "rotationY": 180, + "width": 390, + "x": 915, + "y": -55, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 354, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "3e82fb1f-edc7-468f-94f7-f76e152b777b", + "rotationY": 270, + "width": 390, + "x": 660, + "y": -10, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 354, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "de9bd971-a08a-4125-936f-b5c93654bb55", + "width": 390, + "x": 392, + "y": -37, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 354, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "3755d628-ac62-496e-bead-085cf9fb230b", + "rotationY": 90, + "width": 390, + "x": 136, + "y": 32, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 354, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "260865d1-c2ff-4f3a-acd9-074e1c5b700b", + "rotationY": 180, + "width": 390, + "x": 1140, + "y": -67, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 8, + "customSize": true, + "depth": 406, + "height": 213, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "e86c5ff6-02f5-416c-b066-0b19d113dd16", + "rotationY": 90, + "width": 390, + "x": 1337, + "y": -41, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 205, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "be90451a-7fd1-4952-b8cf-581997326cb9", + "rotationX": -90, + "width": 536, + "x": 549, + "y": 51, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 322, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "a8a28874-ac61-4f0f-8cb7-6a3c36f108c5", + "rotationX": -90, + "width": 536, + "x": 235, + "y": 219, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "029122bc-fa64-4bce-b29e-3b2fc7260d59", + "rotationX": -90, + "width": 536, + "x": 260, + "y": 723, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 200, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "7ef601e3-37c8-49e1-bac5-6e5f7521c180", + "rotationX": -90, + "width": 536, + "x": 33, + "y": 420, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 317, + "customSize": true, + "depth": 580, + "height": 304, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "6ae8cb47-5305-4d07-a63d-a8438844c57e", + "rotationX": -90, + "width": 557, + "x": -160, + "y": 829, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 351, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "4f528853-4ac3-40c7-aa45-c4bb5bce23ab", + "rotationX": -90, + "width": 536, + "x": 912, + "y": 135, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 322, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "5535fdf4-f64d-4660-a190-3f50415f153b", + "rotationX": -90, + "width": 536, + "x": 745, + "y": 304, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 200, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "9f798031-dad1-4a30-bfd7-a4aad321469f", + "rotationX": -90, + "width": 536, + "x": 605, + "y": 827, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 317, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "9aaaa8e2-336a-4488-a736-baa449ae428a", + "rotationX": -90, + "width": 536, + "x": 439, + "y": 537, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "d76ed184-ead8-4d75-8936-292f9f656f2b", + "rotationX": -90, + "width": 536, + "x": 844, + "y": 609, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 322, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "aa69a404-b7d9-47b6-ad07-44a6b139f189", + "rotationX": -90, + "width": 536, + "x": 1272, + "y": 201, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 322, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "d3ac7492-1216-4476-8e19-f829cd7cf415", + "rotationX": -90, + "width": 536, + "x": 1515, + "y": 156, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 339, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "211509eb-bfd9-48c3-a57d-50611cae35c8", + "rotationX": -90, + "width": 536, + "x": 1741, + "y": 189, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 42, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "7fb55515-5f5e-4a9e-a827-0b7bc79b0bcf", + "rotationX": -90, + "width": 536, + "x": 2446, + "y": 208, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 18, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "235c888c-027d-440a-a080-9114cf0340c5", + "rotationX": -90, + "width": 536, + "x": 2211, + "y": 150, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "ff841572-866e-4f0d-8db9-57fc744ff8d2", + "rotationX": -90, + "width": 536, + "x": 1886, + "y": 121, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 750, + "height": 394, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "1550c78a-9bd5-4fac-8741-c70d88dfb781", + "rotationX": -90, + "width": 720, + "x": 1207, + "y": 534, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "5fe5bceb-9e8c-4dc8-8a18-a386e9a927a4", + "rotationX": -90, + "width": 536, + "x": 868, + "y": 944, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 169, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "58726929-02d3-462e-90b6-4e25ffe6ce0a", + "rotationX": -90, + "width": 536, + "x": 1261, + "y": 991, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "11cc36ce-c31e-477e-8670-243882a185aa", + "rotationX": -90, + "width": 536, + "x": 1621, + "y": 1143, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 750, + "height": 394, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "d7a06fee-2e90-4247-a932-98bb5cbdb214", + "rotationX": -90, + "width": 720, + "x": 1659, + "y": 664, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 750, + "height": 394, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "c9d86523-7793-4801-b36e-6ee02ae8be70", + "rotationX": -90, + "width": 720, + "x": 2019, + "y": 604, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 657, + "height": 345, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "0bedc1be-e33d-40c2-8028-a800389c4d64", + "rotationX": -90, + "width": 631, + "x": 2514, + "y": 557, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "70489360-4050-449d-9ed4-0a956fb8edf3", + "rotationX": -90, + "width": 536, + "x": 2594, + "y": 851, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "7616c4da-34ce-463d-bd99-603705e3ff41", + "rotationX": -90, + "width": 536, + "x": 2747, + "y": 1123, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 327, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "9209887c-a56b-42c9-86b4-33eb39f53900", + "rotationX": -90, + "width": 536, + "x": 2794, + "y": 1403, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "3e5d2da4-241c-4ba0-82f9-9718068d5a96", + "rotationX": -90, + "width": 536, + "x": 2181, + "y": 1017, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "5d882ec8-348d-4af6-a7c2-4a15da654a5d", + "rotationX": -90, + "width": 536, + "x": 1814, + "y": 1131, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 596, + "height": 313, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "1d778377-5013-4739-b13f-f85dd8ba4e43", + "rotationX": -90, + "width": 573, + "x": 2389, + "y": 1323, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 558, + "height": 293, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "d6c6d4e6-64cd-4b2e-8a27-32f4736003db", + "rotationX": -90, + "width": 536, + "x": 1941, + "y": 1277, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 726, + "height": 381, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "009391a1-fd5e-4a26-b003-6165c8c960a7", + "rotationX": -90, + "width": 696, + "x": 3311, + "y": 2600, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 223, + "customSize": true, + "depth": 795, + "height": 418, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "45745e84-e986-455d-afaa-32d0e0229eb3", + "rotationX": -90, + "width": 764, + "x": 2497, + "y": 2464, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 608, + "height": 319, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "0880c3f3-cc43-4dd9-8cd5-55999389d85f", + "rotationX": -90, + "width": 583, + "x": 2732, + "y": 2441, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 212, + "customSize": true, + "depth": 750, + "height": 394, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "49fdb9bd-8f54-4e29-a7fe-8abbe2b0aa3f", + "rotationX": -90, + "width": 720, + "x": 3188, + "y": 2381, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 453, + "height": 238, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "518744e2-f7a3-406a-93a7-b537701f467e", + "rotationX": -90, + "width": 435, + "x": 2838, + "y": 2618, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 348, + "customSize": true, + "depth": 782, + "height": 411, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "bff653d5-3de9-413d-8cbc-05714a4b3fe3", + "rotationX": -90, + "width": 750, + "x": -482, + "y": 1814, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 223, + "customSize": true, + "depth": 750, + "height": 394, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "50f1486b-aa90-41f5-8b17-9eaff546db44", + "rotationX": -90, + "width": 720, + "x": 394, + "y": 2094, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 223, + "customSize": true, + "depth": 753, + "height": 396, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "de46a3da-dce7-4b0d-aea9-b1008b9f6be1", + "rotationX": -90, + "width": 723, + "x": -420, + "y": 2504, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 223, + "customSize": true, + "depth": 467, + "height": 246, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "dcb1a799-8123-46a2-858f-05cae3dab3a0", + "rotationX": -90, + "width": 449, + "x": -11, + "y": 1862, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 223, + "customSize": true, + "depth": 536, + "height": 282, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "a01cb24a-76ab-40d7-b091-db62e69fb808", + "rotationX": -90, + "width": 515, + "x": -46, + "y": 2224, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 195, + "customSize": true, + "depth": 934, + "height": 491, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "c9448952-79a0-493e-a4cc-9c582fba379c", + "rotationX": -90, + "width": 897, + "x": 168, + "y": 2332, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 223, + "customSize": true, + "depth": 467, + "height": 246, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "a63cc464-279e-44f7-a2c7-c42bcf10d65d", + "rotationX": -90, + "width": 449, + "x": -193, + "y": 1999, + "z": -200, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "SharkSpawnPoint", + "persistentUuid": "67d625ec-0a35-461b-8342-c8df9f474773", + "width": 0, + "x": -4019, + "y": 243, + "zOrder": 17, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "SharkSpawnPoint", + "persistentUuid": "769b78f9-63d2-4f07-8f58-f974fcfebda9", + "width": 0, + "x": -1662, + "y": 307, + "zOrder": 17, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "SharkSpawnPoint", + "persistentUuid": "c456545f-cc7a-4ed7-8292-843657ddd819", + "width": 0, + "x": 3661, + "y": 348, + "zOrder": 17, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "SharkSpawnPoint", + "persistentUuid": "3418e505-dc73-4f8f-b0d1-a82830f995ee", + "width": 0, + "x": 5610, + "y": 337, + "zOrder": 17, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "16565642-6ccd-4bba-aa14-dac2821b9d7e", + "width": 0, + "x": 5313, + "y": 2016, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "YellowTang" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "867d8a40-4bff-4901-abf5-33cb67f08f55", + "width": 0, + "x": 4434, + "y": 1547, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "ParrotFish" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "53420fc4-d288-4cc0-9b44-de4227778c93", + "width": 0, + "x": 3897, + "y": 2221, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "Clownfish" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "FishSpawner", + "persistentUuid": "14f4ec15-3bf0-46c0-8b31-f2c5959702e8", + "width": 0, + "x": 1371, + "y": 1961, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "FishType", + "type": "string", + "value": "Lionfish" + } + ] + }, + { + "angle": 329, + "customSize": true, + "depth": 148, + "height": 5442, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "4097018f-36b0-417f-a3f3-8db247bafb54", + "width": 148, + "x": -4114, + "y": -1146, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": true, + "depth": 148, + "height": 9546, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "4d5af3b8-2542-46f6-a3f8-b7db7f7fb106", + "width": 148, + "x": 923, + "y": -1409, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 37, + "customSize": true, + "depth": 148, + "height": 5442, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "8fa1b8a6-9906-4bd9-8380-0d20c40d0a0c", + "width": 148, + "x": 6201, + "y": -1172, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 316, + "customSize": true, + "depth": 100, + "height": 100, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "7633d4e7-86c7-41d1-9ab9-7d38935b0e70", + "width": 632, + "x": -5229, + "y": -215, + "zOrder": 19, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 47, + "customSize": true, + "depth": 100, + "height": 100, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "9526bbb7-c193-44cd-8571-08a14b456311", + "width": 632, + "x": 7161, + "y": -176, + "zOrder": 19, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 298, + "customSize": true, + "depth": 122, + "height": 122, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "4e89787d-43c7-4c17-873b-77661ae4d100", + "width": 1248, + "x": -908, + "y": 379, + "zOrder": 20, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 43, + "customSize": true, + "depth": 100, + "height": 100, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "d3097f99-4899-4382-b368-24ca561a7f34", + "width": 471, + "x": -300, + "y": -207, + "zOrder": 21, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 11, + "customSize": true, + "depth": 66, + "height": 66, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "5940e311-33b8-4940-92c0-99cb597c150c", + "width": 2159, + "x": -618, + "y": 1172, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 46, + "height": 46, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "6a112487-dde8-43c3-95bc-c2f569a234da", + "width": 1012, + "x": 1991, + "y": 1646, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 26, + "customSize": true, + "depth": 31, + "height": 31, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "3f2827d8-c01f-4401-8b9d-f7cc5fab9519", + "width": 680, + "x": 1388, + "y": 1523, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 312, + "customSize": true, + "depth": 17, + "height": 38, + "layer": "", + "name": "Obstacle", + "persistentUuid": "6a0092d2-b9ce-432f-8415-9f893bd6760e", + "width": 372, + "x": 2943, + "y": 1557, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 65, + "customSize": true, + "depth": 81, + "height": 81, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "d5e215ec-da42-4302-9d59-f4dfcc3454e0", + "width": 1785, + "x": 1972, + "y": 593, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 17, + "customSize": true, + "depth": 46, + "height": 46, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "ed28e5e4-3232-498a-aeec-f322c0621700", + "width": 1507, + "x": -709, + "y": 1491, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 311, + "customSize": true, + "depth": 11, + "height": 11, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "c993f63c-389a-4a4d-82eb-ba6bd11c8adb", + "width": 354, + "x": -960, + "y": 1396, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 256, + "customSize": true, + "depth": 17, + "height": 17, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "c9d5fb14-e7ee-429c-948f-7e9f33cdb8b2", + "width": 541, + "x": -1107, + "y": 1761, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 288, + "customSize": true, + "depth": 32, + "height": 32, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "e727ab81-1b81-4aa0-8336-2b9f809628d0", + "width": 1027, + "x": -1384, + "y": 2380, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": true, + "depth": 45, + "height": 45, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "6861dcc5-9601-46a5-a572-2be83080ed29", + "width": 759, + "x": -1028, + "y": 2864, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 172, + "customSize": true, + "depth": 56, + "height": 56, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "5c98e33c-c06a-4f48-8ab8-658fe845365b", + "width": 939, + "x": -372, + "y": 2791, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 110, + "customSize": true, + "depth": 56, + "height": 56, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "eceb0b62-cc13-4b46-a894-9c382c3b0dce", + "width": 943, + "x": 202, + "y": 2346, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 240, + "customSize": true, + "depth": 14, + "height": 14, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "ac91e552-7dc0-4d4f-81d7-41fdd28841d1", + "width": 230, + "x": 685, + "y": 1827, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 141, + "customSize": true, + "depth": 100, + "height": 100, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "2a7cb4f1-7b21-4a16-aafd-9af8b95543f1", + "width": 471, + "x": 2344, + "y": -258, + "zOrder": 21, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 357, + "customSize": true, + "depth": 46, + "height": 46, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "43844f36-09f8-4a38-9bf0-08bd1ad01351", + "width": 1263, + "x": 2212, + "y": 2004, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 303, + "customSize": true, + "depth": 14, + "height": 14, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "4ffbba33-48bd-4fe4-93e8-1611fe4b8bbb", + "width": 393, + "x": 1913, + "y": 2206, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 282, + "customSize": true, + "depth": 16, + "height": 16, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "5fdc375d-d7e7-4956-af82-71f0ac119204", + "width": 287, + "x": 1834, + "y": 2508, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 11, + "customSize": true, + "depth": 26, + "height": 26, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "eecf96fd-81ac-4ce7-9573-9ae61db9f138", + "width": 734, + "x": 2052, + "y": 2873, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 240, + "customSize": true, + "depth": 9, + "height": 9, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "2a9652b5-64f0-496c-85e1-8c494f173171", + "width": 238, + "x": 1884, + "y": 2715, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 62, + "customSize": true, + "depth": 35, + "height": 35, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "0837e9d9-8dbe-463f-98ca-9d329d311e1a", + "width": 951, + "x": 3218, + "y": 2371, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 330, + "customSize": true, + "depth": 14, + "height": 14, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "a0c27cb7-cf04-4bba-ad5e-46b4b217a401", + "width": 373, + "x": 3581, + "y": 2887, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 2, + "customSize": true, + "depth": 31, + "height": 31, + "keepRatio": true, + "layer": "", + "name": "Obstacle", + "persistentUuid": "4547f206-7b48-476e-9de4-f9924436eabf", + "width": 844, + "x": 2772, + "y": 2945, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 3935, + "height": 3547, + "keepRatio": true, + "layer": "", + "name": "Cliff3", + "persistentUuid": "1d898faa-55ed-43f0-ad2a-a259a733a20e", + "width": 3415, + "x": 1694, + "y": 4127, + "z": -2000, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Mine", + "persistentUuid": "61af541c-21a1-4116-8e36-410583e59b88", + "width": 0, + "x": 1090, + "y": 1624, + "zOrder": 23, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Mine", + "persistentUuid": "1ffb964e-14c8-436f-bbc2-0ae04aaedbbf", + "width": 0, + "x": 1960, + "y": 1877, + "zOrder": 24, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Mine", + "persistentUuid": "02349660-aa33-4bde-b4ef-838dedece5c8", + "width": 0, + "x": 128, + "y": 1347, + "zOrder": 25, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Mine", + "persistentUuid": "0cdfbf6d-d9f2-4df4-a162-0184ba7d8345", + "width": 0, + "x": 684, + "y": 3047, + "zOrder": 26, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Mine", + "persistentUuid": "dff73495-96d3-4a8a-a364-244b986706c5", + "width": 0, + "x": 3997, + "y": 3079, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Mine", + "persistentUuid": "47539c05-7839-4497-91fc-6219562ebe74", + "width": 0, + "x": -1389, + "y": 2867, + "zOrder": 28, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Mine", + "persistentUuid": "7730b664-929e-489b-9d94-a7dd4dd31c94", + "width": 0, + "x": -2722, + "y": 2655, + "zOrder": 29, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Mine", + "persistentUuid": "975467c4-1559-4fcb-a620-58ede68602a1", + "width": 0, + "x": 4897, + "y": 2586, + "zOrder": 30, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "fd410876-b5b3-403c-b69c-2075fde71196", + "width": 52, + "x": -3047, + "y": 3110, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "ff67fd12-b716-4eba-8d56-5320fd934eb6", + "width": 52, + "x": -2319, + "y": 3389, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "cf4890f4-808b-4638-857b-94756433deba", + "width": 52, + "x": -954, + "y": 3365, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "65f747e6-273c-4ee2-b5b0-fd9253bdbe24", + "width": 52, + "x": -897, + "y": 3315, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "71d2cd46-f11d-487d-b0c7-95a11eb94530", + "width": 52, + "x": -654, + "y": 3374, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "e677d72c-2be0-4380-a9d8-4df238fe6427", + "width": 52, + "x": 327, + "y": 3361, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "910ff657-6b8e-4105-8599-38afb6ef5483", + "width": 52, + "x": 1058, + "y": 3300, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "ca11faa7-7656-4d75-8cfb-93554a9bb177", + "width": 52, + "x": 1196, + "y": 3301, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "35627ab4-4cbf-451f-aa53-185f6977e1fa", + "width": 52, + "x": 1624, + "y": 3334, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "8fbfd1ed-7104-4118-81ee-7e8f9bf28f3a", + "width": 52, + "x": 1673, + "y": 3328, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "d713a409-d1c8-4c72-8f86-a60dc5cf3569", + "width": 52, + "x": 2349, + "y": 3352, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "2ff8a2d4-7549-4332-adbf-da5590424735", + "width": 52, + "x": 2400, + "y": 3326, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "2ac65b8b-af78-4c59-a1ab-2706271cc917", + "width": 52, + "x": 3313, + "y": 3387, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "2075ac91-2212-44b4-8e80-10110528ac85", + "width": 52, + "x": 4342, + "y": 3407, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "d004f098-1680-4d2b-8a06-a74d19ce538e", + "width": 52, + "x": 4940, + "y": 3323, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "d8948061-6b5f-4813-acce-8a0033e13cba", + "width": 52, + "x": 3595, + "y": 2296, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "f15fec90-b0d2-40ce-b6d7-15ed7e88cf21", + "width": 52, + "x": 3723, + "y": 2620, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "f2e7b90f-95bd-46f1-aba8-dbd8bd354f37", + "width": 52, + "x": 2884, + "y": 2079, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "64bc687e-920b-4df0-9067-e833477d2664", + "width": 52, + "x": 2818, + "y": 2103, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "a3eb6de4-88c1-4ef3-9aca-eed4b7e569a5", + "width": 52, + "x": 2194, + "y": 2133, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "2c63b7ba-6506-42c7-bb33-ecf374a17dd3", + "width": 52, + "x": 569, + "y": 1743, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "35a00d24-223f-4a8f-8704-d01564fdadfb", + "width": 52, + "x": 517, + "y": 1718, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "2f3e4e65-6358-414c-bc64-519d3beec5df", + "width": 52, + "x": -588, + "y": 1364, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "b12758b1-d80d-4a2b-8a4b-9d987998c2b9", + "width": 52, + "x": -657, + "y": 1361, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "d9ed21ab-013f-45f9-85d6-722417c34567", + "width": 52, + "x": -325, + "y": 452, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "776fb624-a2bd-4012-9026-016d220d3dc6", + "width": 52, + "x": -293, + "y": 401, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "9d14ca3e-244e-48ce-8d33-6571e16595d4", + "width": 52, + "x": -4570, + "y": 691, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "5d13c492-dadb-4d89-8c92-f700a2605139", + "width": 52, + "x": -4683, + "y": 536, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "3b43ca45-6ee7-42ea-900a-9028ccb40322", + "width": 52, + "x": -4512, + "y": 717, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "e311bb3b-c530-42ec-a4c9-93ea7f4da97a", + "width": 52, + "x": -4328, + "y": 951, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "5333fdc9-9322-44aa-b0fd-1cefa8e700cf", + "width": 52, + "x": -757, + "y": 2263, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "7ad9e4ab-31ef-4a50-97a9-69e614b8ef08", + "width": 52, + "x": 2858, + "y": 462, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "fcac58e2-98aa-44f1-adc9-d8c4694260f1", + "width": 52, + "x": 2995, + "y": 845, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "de36d1e8-0fad-4f39-9531-b841f1bd3e75", + "width": 52, + "x": 6820, + "y": 975, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "df3cb31d-bd8a-45e8-9f6d-7cf6bccc44a1", + "width": 52, + "x": 6987, + "y": 720, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "c5fbe64b-2673-4f63-83af-005eb2c1e0b1", + "width": 52, + "x": 6030, + "y": 1891, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 34, + "height": 128, + "keepRatio": true, + "layer": "", + "name": "Grass", + "persistentUuid": "c1effd53-d592-4f9d-b727-5ed69b7058c2", + "width": 52, + "x": 5979, + "y": 1942, + "z": -200, + "zOrder": 31, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 144, + "keepRatio": true, + "layer": "", + "name": "Grass2", + "persistentUuid": "52ab86ab-2ab5-4e28-a4de-eea2f855c922", + "width": 46, + "x": 1296, + "y": 3318, + "z": -190, + "zOrder": 32, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 144, + "keepRatio": true, + "layer": "", + "name": "Grass2", + "persistentUuid": "7d3966a7-a39b-45f4-a2cb-46884d3ea0cd", + "width": 46, + "x": -2672, + "y": 3371, + "z": -190, + "zOrder": 32, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 144, + "keepRatio": true, + "layer": "", + "name": "Grass2", + "persistentUuid": "3b6b7baf-1512-4c3b-891d-9c7fd38d08ee", + "width": 46, + "x": -3380, + "y": 2669, + "z": -190, + "zOrder": 32, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 144, + "keepRatio": true, + "layer": "", + "name": "Grass2", + "persistentUuid": "7aa9b37f-5f77-4eff-987d-0c06f5249bbd", + "width": 46, + "x": -3989, + "y": 1592, + "z": -190, + "zOrder": 32, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 144, + "keepRatio": true, + "layer": "", + "name": "Grass2", + "persistentUuid": "eebefa78-cb92-43d1-9c8f-61c98f28e544", + "width": 46, + "x": -3969, + "y": 1624, + "z": -190, + "zOrder": 32, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 144, + "keepRatio": true, + "layer": "", + "name": "Grass2", + "persistentUuid": "ce15d0a7-4bd1-4f2a-ad54-c595187ce6f8", + "width": 46, + "x": 5570, + "y": 2401, + "z": -190, + "zOrder": 32, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 144, + "keepRatio": true, + "layer": "", + "name": "Grass2", + "persistentUuid": "7895cd62-d161-44d4-9ce4-b83dc1901bb9", + "width": 46, + "x": 5610, + "y": 2328, + "z": -190, + "zOrder": 32, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 144, + "keepRatio": true, + "layer": "", + "name": "Grass2", + "persistentUuid": "c1a01f9b-c3b1-4b9d-8ac5-ed17f4ae561b", + "width": 46, + "x": 4821, + "y": 3358, + "z": -190, + "zOrder": 32, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 144, + "keepRatio": true, + "layer": "", + "name": "Grass2", + "persistentUuid": "c0431b72-858c-4c41-a4fc-c74f4e3fae01", + "width": 46, + "x": 4697, + "y": 3405, + "z": -190, + "zOrder": 32, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 144, + "keepRatio": true, + "layer": "", + "name": "Grass2", + "persistentUuid": "b38c6415-c40f-42f5-aeb1-24e38c420f3c", + "width": 46, + "x": 3918, + "y": 3373, + "z": -190, + "zOrder": 32, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Mine", + "persistentUuid": "7af65975-ff8e-4c8c-8e0a-105632b48767", + "width": 0, + "x": -3294, + "y": 639, + "zOrder": 33, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Mine", + "persistentUuid": "d7345bc6-7028-4496-91bd-ee818dd0e921", + "width": 0, + "x": 6352, + "y": 547, + "zOrder": 34, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Mine", + "persistentUuid": "3a626c98-b15c-4e54-a48f-304137e75c54", + "width": 0, + "x": 4199, + "y": 738, + "zOrder": 35, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Mine", + "persistentUuid": "7e0b22aa-ba4c-49e4-a3b7-fae3c41643f8", + "width": 0, + "x": -1883, + "y": 1015, + "zOrder": 36, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 3935, + "height": 3666, + "keepRatio": true, + "layer": "", + "name": "Cliff3", + "persistentUuid": "4d434642-d902-4e37-b646-4f6cacaa61fa", + "rotationY": 88, + "width": 3555, + "x": 6849, + "y": 3475, + "z": -2100, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 3935, + "height": 3763, + "keepRatio": true, + "layer": "", + "name": "Cliff3", + "persistentUuid": "8b52230d-d92c-46ba-bcab-5b315d01e22a", + "rotationY": 90, + "width": 4008, + "x": -4559, + "y": 3224, + "z": -2100, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 373, + "height": 197, + "keepRatio": true, + "layer": "", + "name": "Cliff1", + "persistentUuid": "f44fef8a-41f9-4a25-8044-76dfbc698523", + "rotationX": -90, + "width": 359, + "x": -861, + "y": 3597, + "z": -200, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 6655, + "keepRatio": true, + "layer": "", + "name": "LeftBoundary", + "persistentUuid": "dcb532b2-db05-4efc-9758-b768b8444eef", + "width": 100, + "x": -4900, + "y": -2153, + "zOrder": 38, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 100, + "keepRatio": true, + "layer": "", + "name": "TopBoundary", + "persistentUuid": "089e63da-2470-4ba3-8bbc-f68ba0d2b355", + "width": 14817, + "x": -6114, + "y": -1000, + "zOrder": 39, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 6708, + "keepRatio": true, + "layer": "", + "name": "RightBoundary", + "persistentUuid": "4e524995-151f-4b2b-8a23-0dbe29b7483c", + "width": 100, + "x": 7350, + "y": -2153, + "zOrder": 40, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 100, + "keepRatio": true, + "layer": "", + "name": "BottomBoundary", + "persistentUuid": "89d3af5a-238b-4beb-8d6b-9bfd47f0e974", + "width": 14612, + "x": -6012, + "y": 3350, + "zOrder": 41, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 3440, + "layer": "", + "name": "Grass2", + "persistentUuid": "4c4eb789-ce8d-48b1-930f-f8b58b09b9b0", + "width": 312, + "x": -3019, + "y": 3321, + "z": -1500, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 3440, + "layer": "", + "name": "Grass2", + "persistentUuid": "8da4b0a2-bcc9-424d-b96d-9490940da758", + "width": 312, + "x": -3192, + "y": 3594, + "z": -2000, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 3169, + "layer": "", + "name": "Grass2", + "persistentUuid": "ac539908-e51e-46aa-9b70-39f44baa26af", + "width": 384, + "x": -2718, + "y": 3399, + "z": -1750, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 3440, + "layer": "", + "name": "Grass2", + "persistentUuid": "aefe050e-ee39-4e45-a512-18e7993e3eea", + "width": 312, + "x": -1210, + "y": 3414, + "z": -1500, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 3440, + "layer": "", + "name": "Grass2", + "persistentUuid": "da834800-4869-42ec-ab30-5d7818b096ed", + "width": 312, + "x": 5496, + "y": 3666, + "z": -1500, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 3440, + "layer": "", + "name": "Grass2", + "persistentUuid": "3f585f06-140c-40ff-b477-1b596ff61b12", + "width": 312, + "x": 5713, + "y": 3450, + "z": -1750, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 3440, + "layer": "", + "name": "Grass2", + "persistentUuid": "f62787c8-25ca-40c7-a4fd-74a09a8e8505", + "width": 312, + "x": 3754, + "y": 3613, + "z": -2000, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 3440, + "layer": "", + "name": "Grass2", + "persistentUuid": "ffa00f33-f69f-4ed0-99fd-5d778460e8e6", + "width": 312, + "x": 1419, + "y": 3826, + "z": -2000, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 28, + "height": 3440, + "layer": "", + "name": "Grass2", + "persistentUuid": "71a279b5-aae0-4760-8740-a5279b204bf7", + "width": 312, + "x": 1181, + "y": 4095, + "z": -1750, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 0.05366288772177734, + "windowMask": false + } + } + ], + "externalSourceFiles": [] +} \ No newline at end of file diff --git a/examples/3d-shark-frenzy/README.md b/examples/3d-shark-frenzy/README.md new file mode 100644 index 000000000..52f8a6dce --- /dev/null +++ b/examples/3d-shark-frenzy/README.md @@ -0,0 +1 @@ +Eat as much fish as possible to survive in a game inspired from Hungry Shark. \ No newline at end of file diff --git a/examples/3d-shark-frenzy/TAGS.md b/examples/3d-shark-frenzy/TAGS.md new file mode 100644 index 000000000..09ba07039 --- /dev/null +++ b/examples/3d-shark-frenzy/TAGS.md @@ -0,0 +1 @@ +game, advanced \ No newline at end of file diff --git a/examples/3d-shark-frenzy/assets/Anglerfish.glb b/examples/3d-shark-frenzy/assets/Anglerfish.glb new file mode 100644 index 000000000..cd32de61f Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Anglerfish.glb differ diff --git a/examples/3d-shark-frenzy/assets/Black.png b/examples/3d-shark-frenzy/assets/Black.png new file mode 100644 index 000000000..85908c3b7 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Black.png differ diff --git a/examples/3d-shark-frenzy/assets/Blue Button With Shadow_Hovered.png b/examples/3d-shark-frenzy/assets/Blue Button With Shadow_Hovered.png new file mode 100644 index 000000000..44852ada8 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Blue Button With Shadow_Hovered.png differ diff --git a/examples/3d-shark-frenzy/assets/Blue Button With Shadow_Idle.png b/examples/3d-shark-frenzy/assets/Blue Button With Shadow_Idle.png new file mode 100644 index 000000000..268cefb05 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Blue Button With Shadow_Idle.png differ diff --git a/examples/3d-shark-frenzy/assets/Blue Button With Shadow_Pressed.png b/examples/3d-shark-frenzy/assets/Blue Button With Shadow_Pressed.png new file mode 100644 index 000000000..5cf947c4e Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Blue Button With Shadow_Pressed.png differ diff --git a/examples/3d-shark-frenzy/assets/CantoraOne-Regular.ttf b/examples/3d-shark-frenzy/assets/CantoraOne-Regular.ttf new file mode 100644 index 000000000..57446a27a Binary files /dev/null and b/examples/3d-shark-frenzy/assets/CantoraOne-Regular.ttf differ diff --git a/examples/3d-shark-frenzy/assets/Cliff 1.glb b/examples/3d-shark-frenzy/assets/Cliff 1.glb new file mode 100644 index 000000000..daed14407 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Cliff 1.glb differ diff --git a/examples/3d-shark-frenzy/assets/Cliff 3.glb b/examples/3d-shark-frenzy/assets/Cliff 3.glb new file mode 100644 index 000000000..27c5267e5 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Cliff 3.glb differ diff --git a/examples/3d-shark-frenzy/assets/Clownfish.glb b/examples/3d-shark-frenzy/assets/Clownfish.glb new file mode 100644 index 000000000..377d74747 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Clownfish.glb differ diff --git a/examples/3d-shark-frenzy/assets/Explosion 6.aac b/examples/3d-shark-frenzy/assets/Explosion 6.aac new file mode 100644 index 000000000..2a88668db Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Explosion 6.aac differ diff --git a/examples/3d-shark-frenzy/assets/ExplosionTexture1.png b/examples/3d-shark-frenzy/assets/ExplosionTexture1.png new file mode 100644 index 000000000..e6705a76b Binary files /dev/null and b/examples/3d-shark-frenzy/assets/ExplosionTexture1.png differ diff --git a/examples/3d-shark-frenzy/assets/Fire round button.png b/examples/3d-shark-frenzy/assets/Fire round button.png new file mode 100644 index 000000000..c1d75b7e3 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Fire round button.png differ diff --git a/examples/3d-shark-frenzy/assets/Gold 3.aac b/examples/3d-shark-frenzy/assets/Gold 3.aac new file mode 100644 index 000000000..f23b584f8 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Gold 3.aac differ diff --git a/examples/3d-shark-frenzy/assets/Grass 2.glb b/examples/3d-shark-frenzy/assets/Grass 2.glb new file mode 100644 index 000000000..26fd3bc6c Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Grass 2.glb differ diff --git a/examples/3d-shark-frenzy/assets/Grass.glb b/examples/3d-shark-frenzy/assets/Grass.glb new file mode 100644 index 000000000..d91ee0fac Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Grass.glb differ diff --git a/examples/3d-shark-frenzy/assets/Jump_Land_03.wav b/examples/3d-shark-frenzy/assets/Jump_Land_03.wav new file mode 100644 index 000000000..b85e8eea4 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Jump_Land_03.wav differ diff --git a/examples/3d-shark-frenzy/assets/Jump_Start_01.wav b/examples/3d-shark-frenzy/assets/Jump_Start_01.wav new file mode 100644 index 000000000..be4fe4260 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Jump_Start_01.wav differ diff --git a/examples/3d-shark-frenzy/assets/LightGlow.png b/examples/3d-shark-frenzy/assets/LightGlow.png new file mode 100644 index 000000000..871c194cc Binary files /dev/null and b/examples/3d-shark-frenzy/assets/LightGlow.png differ diff --git a/examples/3d-shark-frenzy/assets/Line light joystick border.png b/examples/3d-shark-frenzy/assets/Line light joystick border.png new file mode 100644 index 000000000..a795a9e84 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Line light joystick border.png differ diff --git a/examples/3d-shark-frenzy/assets/Line light joystick thumb.png b/examples/3d-shark-frenzy/assets/Line light joystick thumb.png new file mode 100644 index 000000000..ece439075 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Line light joystick thumb.png differ diff --git a/examples/3d-shark-frenzy/assets/Lionfish.glb b/examples/3d-shark-frenzy/assets/Lionfish.glb new file mode 100644 index 000000000..41f894066 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Lionfish.glb differ diff --git a/examples/3d-shark-frenzy/assets/Metal Bar Border.png b/examples/3d-shark-frenzy/assets/Metal Bar Border.png new file mode 100644 index 000000000..a93f09e6f Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Metal Bar Border.png differ diff --git a/examples/3d-shark-frenzy/assets/MetalV1_Jump_Start_04.wav b/examples/3d-shark-frenzy/assets/MetalV1_Jump_Start_04.wav new file mode 100644 index 000000000..f86e7075e Binary files /dev/null and b/examples/3d-shark-frenzy/assets/MetalV1_Jump_Start_04.wav differ diff --git a/examples/3d-shark-frenzy/assets/Parrot Fish.glb b/examples/3d-shark-frenzy/assets/Parrot Fish.glb new file mode 100644 index 000000000..4d8448946 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Parrot Fish.glb differ diff --git a/examples/3d-shark-frenzy/assets/Pixel Red Fill Bar.png b/examples/3d-shark-frenzy/assets/Pixel Red Fill Bar.png new file mode 100644 index 000000000..646d2ea5e Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Pixel Red Fill Bar.png differ diff --git a/examples/3d-shark-frenzy/assets/Poison_Bubbles_2.png b/examples/3d-shark-frenzy/assets/Poison_Bubbles_2.png new file mode 100644 index 000000000..50a1fff4c Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Poison_Bubbles_2.png differ diff --git a/examples/3d-shark-frenzy/assets/Red Snapper.glb b/examples/3d-shark-frenzy/assets/Red Snapper.glb new file mode 100644 index 000000000..5d91c1ff1 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Red Snapper.glb differ diff --git a/examples/3d-shark-frenzy/assets/Red.png b/examples/3d-shark-frenzy/assets/Red.png new file mode 100644 index 000000000..04c0d0838 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Red.png differ diff --git a/examples/3d-shark-frenzy/assets/Shaded Blue Fill Bar.png b/examples/3d-shark-frenzy/assets/Shaded Blue Fill Bar.png new file mode 100644 index 000000000..7480bd53e Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Shaded Blue Fill Bar.png differ diff --git a/examples/3d-shark-frenzy/assets/Shark.glb b/examples/3d-shark-frenzy/assets/Shark.glb new file mode 100644 index 000000000..6badc1e36 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Shark.glb differ diff --git a/examples/3d-shark-frenzy/assets/Spiky Ball.glb b/examples/3d-shark-frenzy/assets/Spiky Ball.glb new file mode 100644 index 000000000..944bbd40e Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Spiky Ball.glb differ diff --git a/examples/3d-shark-frenzy/assets/Square Blue Slider Border.png b/examples/3d-shark-frenzy/assets/Square Blue Slider Border.png new file mode 100644 index 000000000..e8f39e23d Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Square Blue Slider Border.png differ diff --git a/examples/3d-shark-frenzy/assets/Square Blue Slider Fill Bar.png b/examples/3d-shark-frenzy/assets/Square Blue Slider Fill Bar.png new file mode 100644 index 000000000..416fcd626 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Square Blue Slider Fill Bar.png differ diff --git a/examples/3d-shark-frenzy/assets/Square Blue Slider Thumb.png b/examples/3d-shark-frenzy/assets/Square Blue Slider Thumb.png new file mode 100644 index 000000000..d30fd7719 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Square Blue Slider Thumb.png differ diff --git a/examples/3d-shark-frenzy/assets/Transperent.png b/examples/3d-shark-frenzy/assets/Transperent.png new file mode 100644 index 000000000..97a94551b Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Transperent.png differ diff --git a/examples/3d-shark-frenzy/assets/Yellow Tang.glb b/examples/3d-shark-frenzy/assets/Yellow Tang.glb new file mode 100644 index 000000000..b1dabc296 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Yellow Tang.glb differ diff --git a/examples/3d-shark-frenzy/assets/Yellow.png b/examples/3d-shark-frenzy/assets/Yellow.png new file mode 100644 index 000000000..894b733e6 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/Yellow.png differ diff --git a/examples/3d-shark-frenzy/assets/boundary.png b/examples/3d-shark-frenzy/assets/boundary.png new file mode 100644 index 000000000..00ee70acf Binary files /dev/null and b/examples/3d-shark-frenzy/assets/boundary.png differ diff --git a/examples/3d-shark-frenzy/assets/tiled_Sky Background.png b/examples/3d-shark-frenzy/assets/tiled_Sky Background.png new file mode 100644 index 000000000..a3334a872 Binary files /dev/null and b/examples/3d-shark-frenzy/assets/tiled_Sky Background.png differ diff --git a/examples/3d-shark-frenzy/assets/tiled_Summer Tile Water.png b/examples/3d-shark-frenzy/assets/tiled_Summer Tile Water.png new file mode 100644 index 000000000..7f4289b7c Binary files /dev/null and b/examples/3d-shark-frenzy/assets/tiled_Summer Tile Water.png differ diff --git a/examples/3d-shark-frenzy/thumbnail.png b/examples/3d-shark-frenzy/thumbnail.png new file mode 100644 index 000000000..71e3e6b09 Binary files /dev/null and b/examples/3d-shark-frenzy/thumbnail.png differ