diff --git a/examples/3d-bomber-bunny/3d-bomber-bunny.json b/examples/3d-bomber-bunny/3d-bomber-bunny.json new file mode 100644 index 000000000..b3bf283a1 --- /dev/null +++ b/examples/3d-bomber-bunny/3d-bomber-bunny.json @@ -0,0 +1,43801 @@ +{ + "firstLayout": "Selection", + "gdVersion": { + "build": 99, + "major": 4, + "minor": 0, + "revision": 0 + }, + "properties": { + "adaptGameResolutionAtRuntime": true, + "antialiasingMode": "MSAA", + "antialisingEnabledOnMobile": false, + "folderProject": false, + "orientation": "landscape", + "packageName": "com.example", + "pixelsRounding": false, + "projectUuid": "e10dc7b2-c4b9-4811-a44d-da52021923f8", + "scaleMode": "linear", + "sizeOnStartupMode": "", + "templateSlug": "", + "useExternalSourceFiles": false, + "version": "1.0.0", + "name": "Bomber Bunny", + "description": "This is a game example to show how to do a Bomberman clone with GDevelop. The source can be found directly in GDevelop in the examples list.\n\nControls are:\n\n- arrows and RShift\n- ESDF and LShift\n- IJKL and H\n- 8456 and 0\n- or gamepads\n\nAsset sources:\n\n- Bunnies, bombs and rocks are from Quaternius\n- Cabbages and walls are from Kenney", + "author": "", + "windowWidth": 1280, + "windowHeight": 720, + "latestCompilationDirectory": "", + "maxFPS": 60, + "minFPS": 20, + "verticalSync": false, + "platformSpecificAssets": { + "android-icon-144": "", + "android-icon-192": "", + "android-icon-36": "", + "android-icon-48": "", + "android-icon-72": "", + "android-icon-96": "", + "android-windowSplashScreenAnimatedIcon": "", + "desktop-icon-512": "", + "ios-icon-100": "", + "ios-icon-1024": "", + "ios-icon-114": "", + "ios-icon-120": "", + "ios-icon-144": "", + "ios-icon-152": "", + "ios-icon-167": "", + "ios-icon-180": "", + "ios-icon-20": "", + "ios-icon-29": "", + "ios-icon-40": "", + "ios-icon-50": "", + "ios-icon-57": "", + "ios-icon-58": "", + "ios-icon-60": "", + "ios-icon-72": "", + "ios-icon-76": "", + "ios-icon-80": "", + "ios-icon-87": "", + "liluo-thumbnail": "preview.png" + }, + "loadingScreen": { + "backgroundColor": 0, + "backgroundFadeInDuration": 0.2, + "backgroundImageResourceName": "", + "gdevelopLogoStyle": "light", + "logoAndProgressFadeInDuration": 0.2, + "logoAndProgressLogoFadeInDelay": 0.2, + "minDuration": 0, + "progressBarColor": 16777215, + "progressBarHeight": 20, + "progressBarMaxWidth": 200, + "progressBarMinWidth": 40, + "progressBarWidthPercent": 30, + "showGDevelopSplash": true, + "showProgressBar": false + }, + "watermark": { + "placement": "bottom-left", + "showWatermark": true + }, + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "authorUsernames": [], + "categories": [ + "action", + "multiplayer" + ], + "playableDevices": [ + "keyboard", + "gamepad" + ], + "extensionProperties": [], + "platforms": [ + { + "name": "GDevelop JS platform" + } + ], + "currentPlatform": "GDevelop JS platform" + }, + "resources": { + "resources": [ + { + "alwaysLoaded": false, + "file": "assets/BombeBonus.png", + "kind": "image", + "metadata": "", + "name": "BombeBonus.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/ClassicLevel.png", + "kind": "image", + "metadata": "", + "name": "ClassicLevel.png", + "smoothed": true, + "userAdded": false + }, + { + "alwaysLoaded": false, + "file": "assets/EmptyLevel.png", + "kind": "image", + "metadata": "", + "name": "EmptyLevel.png", + "smoothed": true, + "userAdded": false + }, + { + "alwaysLoaded": false, + "file": "assets/JoueurSelectionMask.png", + "kind": "image", + "metadata": "{\"localFilePath\":\"assets/JoueurSelectionMask.png\",\"extension\":\".png\"}", + "name": "JoueurSelectionMask.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/FlammeBonus.png", + "kind": "image", + "metadata": "", + "name": "assets\\FlammeBonus.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "preview.png", + "kind": "image", + "metadata": "", + "name": "preview.png", + "smoothed": true, + "userAdded": true + }, + { + "file": "assets/Cabbage.glb", + "kind": "model3D", + "metadata": "", + "name": "Cabbage.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Food/Vegetable/9dc8da10b4175e52ea9142bdaaae9daf1499c92fa46bd504cd2d00cf257492fa_Cabbage.glb", + "name": "Cabbage.glb" + } + }, + { + "file": "assets/blockRoundedLong.glb", + "kind": "model3D", + "metadata": "", + "name": "blockRoundedLong.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Platformer Kit/ground/77ab9160f1ee5bbb1e5135ddfda9848a109520ca4ffc982dd29aeab1a7a422b1_blockRoundedLong.glb", + "name": "blockRoundedLong.glb" + } + }, + { + "file": "assets/BlueBunny.glb", + "kind": "model3D", + "metadata": "", + "name": "assets\\BlueBunny.glb", + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/NewSprite.png", + "kind": "image", + "metadata": "", + "name": "assets\\NewSprite.png", + "smoothed": true, + "userAdded": true + }, + { + "file": "assets/Bomb.glb", + "kind": "model3D", + "metadata": "", + "name": "Bomb.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Platformer Pack/e3840854ed7be06c0f09cab214bee0eb8271d4a7f39b5a90fbc0740b0780deaa_Bomb.glb", + "name": "Bomb.glb" + } + }, + { + "file": "assets/PurpleBunny.glb", + "kind": "model3D", + "metadata": "", + "name": "assets\\PurpleBunny.glb", + "userAdded": false + }, + { + "file": "assets/OrangeBunny.glb", + "kind": "model3D", + "metadata": "", + "name": "assets\\OrangeBunny.glb", + "userAdded": false + }, + { + "file": "assets/PinkBunny.glb", + "kind": "model3D", + "metadata": "", + "name": "assets\\PinkBunny.glb", + "userAdded": false + }, + { + "alwaysLoaded": false, + "file": "assets/Purple.png", + "kind": "image", + "metadata": "{\"localFilePath\":\"assets/Purple.png\",\"extension\":\".png\"}", + "name": "assets\\Purple.png", + "smoothed": true, + "userAdded": false + }, + { + "alwaysLoaded": false, + "file": "assets/Orange.png", + "kind": "image", + "metadata": "{\"localFilePath\":\"assets/Orange.png\",\"extension\":\".png\"}", + "name": "assets\\Orange.png", + "smoothed": true, + "userAdded": false + }, + { + "alwaysLoaded": false, + "file": "assets/Pink.png", + "kind": "image", + "metadata": "{\"localFilePath\":\"assets/Pink.png\",\"extension\":\".png\"}", + "name": "assets\\Pink.png", + "smoothed": true, + "userAdded": false + }, + { + "alwaysLoaded": false, + "file": "assets/ExplosionCentre-Anim5.png", + "kind": "image", + "metadata": "{\"extension\":\".png\"}", + "name": "ExplosionCentre-Anim4", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/Bomb.png", + "kind": "image", + "metadata": "{\"extension\":\".png\"}", + "name": "Bomb", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/SmoothParticle.png", + "kind": "image", + "metadata": "", + "name": "assets\\SmoothParticle.png", + "smoothed": true, + "userAdded": true + }, + { + "file": "assets/FlashyRock.glb", + "kind": "model3D", + "metadata": "", + "name": "assets\\FlashyRock.glb", + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/Soil2.png", + "kind": "image", + "metadata": "", + "name": "assets\\Soil2.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/New image.png", + "kind": "image", + "metadata": "{\"extension\":\".png\",\"pskl\":{},\"localFilePath\":\"assets/New image.png\"}", + "name": "New image", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/BlueBunnyIcon.png", + "kind": "image", + "metadata": "", + "name": "assets\\BlueBunnyIcon.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/PurpleBunnyIcon.png", + "kind": "image", + "metadata": "", + "name": "assets\\PurpleBunnyIcon.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/OrangeBunnyIcon.png", + "kind": "image", + "metadata": "", + "name": "assets\\OrangeBunnyIcon.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/PinkBunnyIcon.png", + "kind": "image", + "metadata": "", + "name": "assets\\PinkBunnyIcon.png", + "smoothed": true, + "userAdded": true + }, + { + "file": "assets/GreyBlock.glb", + "kind": "model3D", + "metadata": "", + "name": "assets\\GreyBlock.glb", + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/New image.png", + "kind": "image", + "metadata": "", + "name": "assets\\New image.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/SoilBorder.png", + "kind": "image", + "metadata": "", + "name": "assets\\SoilBorder.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/SoilCorner.png", + "kind": "image", + "metadata": "", + "name": "assets\\SoilCorner.png", + "smoothed": true, + "userAdded": false + }, + { + "alwaysLoaded": false, + "file": "assets/NewObject.png", + "kind": "image", + "metadata": "{\"extension\":\".png\"}", + "name": "NewObject", + "smoothed": true, + "userAdded": false + } + ], + "resourceFolders": [] + }, + "objects": [], + "objectsGroups": [], + "variables": [ + { + "name": "Score", + "type": "string", + "value": "" + }, + { + "name": "PlayerCount", + "type": "number", + "value": 4 + }, + { + "name": "Level", + "type": "string", + "value": "TestLevel" + }, + { + "name": "Bomb", + "type": "string", + "value": "2" + }, + { + "name": "Flame", + "type": "string", + "value": "2" + } + ], + "layouts": [ + { + "b": 58, + "disableInputWhenNotFocused": true, + "mangledName": "Game", + "name": "Game", + "r": 102, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 80, + "uiSettings": { + "grid": true, + "gridType": "rectangular", + "gridWidth": 12, + "gridHeight": 12, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": true, + "zoomFactor": 0.6429657028564686, + "windowMask": false + }, + "objectsGroups": [ + { + "name": "Obstacle", + "objects": [ + { + "name": "Crate" + }, + { + "name": "Rock" + }, + { + "name": "BlockRoundedLong" + } + ] + }, + { + "name": "Player", + "objects": [ + { + "name": "Player1" + }, + { + "name": "Player2" + }, + { + "name": "Player3" + }, + { + "name": "Player4" + } + ] + }, + { + "name": "ScoreIcon", + "objects": [ + { + "name": "ScoreIcon1" + }, + { + "name": "ScoreIcon2" + }, + { + "name": "ScoreIcon3" + }, + { + "name": "ScoreIcon4" + } + ] + }, + { + "name": "Wall", + "objects": [ + { + "name": "Rock" + }, + { + "name": "BlockRoundedLong" + } + ] + }, + { + "name": "PlayerModel", + "objects": [ + { + "name": "BlueBunny" + }, + { + "name": "PurpleBunny" + }, + { + "name": "OrangeBunny" + }, + { + "name": "PinkBunny" + } + ] + } + ], + "variables": [], + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 24, + "layer": "UI", + "name": "Score", + "persistentUuid": "42e783b6-213a-45b7-93dd-5d15c9482f94", + "width": 48, + "x": 48, + "y": 28, + "zOrder": 1000, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "PlayerNum", + "type": "string", + "value": "1" + } + ] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 32, + "layer": "UI", + "name": "ScoreIcon1", + "persistentUuid": "906f526d-ae6c-414a-8084-114f9a51cd0a", + "width": 32, + "x": 12, + "y": 24, + "zOrder": 1001, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "Number", + "type": "string", + "value": "1" + } + ] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 32, + "layer": "UI", + "name": "ScoreIcon2", + "persistentUuid": "2cc418a5-16ad-465f-a4bc-ff0f479488b8", + "width": 32, + "x": 12, + "y": 72, + "zOrder": 1002, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "Number", + "type": "string", + "value": "2" + } + ] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 32, + "layer": "UI", + "name": "ScoreIcon4", + "persistentUuid": "1713db2a-fecc-4906-b55c-8a68cc53ab88", + "width": 32, + "x": 12, + "y": 168, + "zOrder": 1003, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "PlayerNum", + "type": "string", + "value": "4" + } + ] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 32, + "layer": "UI", + "name": "ScoreIcon3", + "persistentUuid": "69e1ebf6-95a0-4c89-a026-0666d11c2762", + "width": 32, + "x": 12, + "y": 120, + "zOrder": 1004, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "Number", + "type": "string", + "value": "3" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 24, + "layer": "UI", + "name": "Score", + "persistentUuid": "c9cc7551-b991-48ff-ae7e-10ca7eedc420", + "width": 48, + "x": 48, + "y": 172, + "zOrder": 1000, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "PlayerNum", + "type": "string", + "value": "4" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 24, + "layer": "UI", + "name": "Score", + "persistentUuid": "b35a1096-fe26-4162-988f-887c1db68133", + "width": 48, + "x": 48, + "y": 124, + "zOrder": 1000, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "PlayerNum", + "type": "string", + "value": "3" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 24, + "layer": "UI", + "name": "Score", + "persistentUuid": "970d4113-26f4-41fa-9bb3-716987e4632d", + "width": 48, + "x": 48, + "y": 76, + "zOrder": 1000, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "PlayerNum", + "type": "string", + "value": "2" + } + ] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 252, + "layer": "UI", + "name": "Panel", + "persistentUuid": "197982e1-0bc8-4cb6-8531-23bc9d79bed2", + "width": 144, + "x": 0, + "y": 0, + "zOrder": 0, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "objects": [ + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Player1", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "Number", + "type": "string", + "value": "1" + }, + { + "name": "Keys", + "type": "structure", + "children": [ + { + "name": "Bomb", + "type": "string", + "value": "RShift" + }, + { + "name": "Down", + "type": "string", + "value": "Down" + }, + { + "name": "Left", + "type": "string", + "value": "Left" + }, + { + "name": "Right", + "type": "string", + "value": "Right" + }, + { + "name": "Up", + "type": "string", + "value": "Up" + } + ] + }, + { + "name": "BombCapacity", + "type": "string", + "value": "" + }, + { + "name": "Range", + "type": "string", + "value": "" + } + ], + "effects": [], + "behaviors": [ + { + "name": "Player", + "type": "Player::Player" + }, + { + "name": "RemapForTopdown", + "type": "BehaviorRemapper::RemapForTopdown", + "Up": "Up", + "Left": "Left", + "Right": "Right", + "Down": "Down", + "Topdown": "TopDownMovement" + }, + { + "name": "Respawn", + "type": "Respawn::Respawn", + "InvincibilityTime": 5 + }, + { + "name": "TopDownCornerSlider", + "type": "TopDownCornerSliding::TopDownCornerSlider", + "TopDownMovement": "TopDownMovement", + "PixelSize": 1, + "OffsetX": 0, + "OffsetY": 0 + }, + { + "name": "TopDownGamepadMapper", + "type": "Gamepads::TopDownGamepadMapper", + "TopDownMovement": "TopDownMovement", + "GamepadIdentifier": 1, + "UseArrows": true, + "UseLeftStick": true, + "UseRightStick": false, + "StickMode": "8 Directions" + }, + { + "name": "TopDownMovement", + "type": "TopDownMovementBehavior::TopDownMovementBehavior", + "rotateObject": false, + "angularMaxSpeed": 450, + "maxSpeed": 300, + "acceleration": 16000, + "deceleration": 16000, + "allowDiagonals": true, + "angleOffset": 0, + "ignoreDefaultControls": true + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\NewSprite.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "", + "name": "BlueBunny", + "tags": "", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Flash", + "type": "Flash::Flash", + "HalfPeriodTime": 0.1, + "IsFlashing": false, + "FlashDuration": 0 + }, + { + "name": "PlayerModel", + "type": "Player::PlayerModel", + "Tween": "Tween", + "Tween3D": "Tween3D", + "Flash": "Flash" + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + }, + { + "name": "Tween3D", + "type": "Tween3D::Tween3D", + "Object3D": "Object3D", + "Scale": "Scale" + } + ], + "content": { + "centerLocation": "ModelOrigin", + "depth": 120, + "height": 120, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "assets\\BlueBunny.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 120, + "animations": [ + { + "loop": true, + "name": "Idle", + "source": "Idle" + }, + { + "loop": true, + "name": "Run", + "source": "Run" + }, + { + "loop": false, + "name": "Death", + "source": "Death" + }, + { + "loop": false, + "name": "Duck", + "source": "Duck" + }, + { + "loop": false, + "name": "HitReact", + "source": "HitReact" + }, + { + "loop": false, + "name": "Idle_Gun", + "source": "Idle_Gun" + }, + { + "loop": false, + "name": "Idle_Shoot", + "source": "Idle_Shoot" + }, + { + "loop": false, + "name": "Jump", + "source": "Jump" + }, + { + "loop": false, + "name": "Jump_Idle", + "source": "Jump_Idle" + }, + { + "loop": false, + "name": "Jump_Land", + "source": "Jump_Land" + }, + { + "loop": false, + "name": "No", + "source": "No" + }, + { + "loop": false, + "name": "Punch", + "source": "Punch" + }, + { + "loop": false, + "name": "Run_Gun", + "source": "Run_Gun" + }, + { + "loop": false, + "name": "Run_Shoot", + "source": "Run_Shoot" + }, + { + "loop": false, + "name": "Walk", + "source": "Walk" + }, + { + "loop": false, + "name": "Walk_Gun", + "source": "Walk_Gun" + }, + { + "loop": false, + "name": "Wave", + "source": "Wave" + }, + { + "loop": false, + "name": "Yes", + "source": "Yes" + } + ] + } + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Player2", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "Keys", + "type": "structure", + "children": [ + { + "name": "Bomb", + "type": "string", + "value": "LShift" + }, + { + "name": "Down", + "type": "string", + "value": "d" + }, + { + "name": "Left", + "type": "string", + "value": "s" + }, + { + "name": "Right", + "type": "string", + "value": "f" + }, + { + "name": "Up", + "type": "string", + "value": "e" + } + ] + }, + { + "name": "BombCapacity", + "type": "string", + "value": "" + }, + { + "name": "Number", + "type": "string", + "value": "2" + }, + { + "name": "Range", + "type": "string", + "value": "" + } + ], + "effects": [], + "behaviors": [ + { + "name": "Player", + "type": "Player::Player" + }, + { + "name": "RemapForTopdown", + "type": "BehaviorRemapper::RemapForTopdown", + "Up": "e", + "Left": "s", + "Right": "f", + "Down": "d", + "Topdown": "TopDownMovement" + }, + { + "name": "Respawn", + "type": "Respawn::Respawn", + "InvincibilityTime": 5 + }, + { + "name": "TopDownCornerSlider", + "type": "TopDownCornerSliding::TopDownCornerSlider", + "TopDownMovement": "TopDownMovement", + "PixelSize": 1, + "OffsetX": 0, + "OffsetY": 0 + }, + { + "name": "TopDownGamepadMapper", + "type": "Gamepads::TopDownGamepadMapper", + "TopDownMovement": "TopDownMovement", + "GamepadIdentifier": 2, + "UseArrows": true, + "UseLeftStick": true, + "UseRightStick": false, + "StickMode": "8 Directions" + }, + { + "name": "TopDownMovement", + "type": "TopDownMovementBehavior::TopDownMovementBehavior", + "acceleration": 16000, + "allowDiagonals": true, + "angleOffset": 0, + "angularMaxSpeed": 180, + "deceleration": 16000, + "ignoreDefaultControls": true, + "maxSpeed": 200, + "rotateObject": false + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\Purple.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "", + "name": "PurpleBunny", + "tags": "", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Flash", + "type": "Flash::Flash", + "HalfPeriodTime": 0.1, + "IsFlashing": false, + "FlashDuration": 0 + }, + { + "name": "PlayerModel", + "type": "Player::PlayerModel", + "Tween": "Tween", + "Tween3D": "Tween3D", + "Flash": "Flash" + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + }, + { + "name": "Tween3D", + "type": "Tween3D::Tween3D", + "Object3D": "Object3D", + "Scale": "Scale" + } + ], + "content": { + "centerLocation": "ModelOrigin", + "depth": 120, + "height": 120, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "assets\\PurpleBunny.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 120, + "animations": [ + { + "loop": true, + "name": "Idle", + "source": "Idle" + }, + { + "loop": true, + "name": "Run", + "source": "Run" + }, + { + "loop": false, + "name": "Death", + "source": "Death" + }, + { + "loop": false, + "name": "Duck", + "source": "Duck" + }, + { + "loop": false, + "name": "HitReact", + "source": "HitReact" + }, + { + "loop": false, + "name": "Idle_Gun", + "source": "Idle_Gun" + }, + { + "loop": false, + "name": "Idle_Shoot", + "source": "Idle_Shoot" + }, + { + "loop": false, + "name": "Jump", + "source": "Jump" + }, + { + "loop": false, + "name": "Jump_Idle", + "source": "Jump_Idle" + }, + { + "loop": false, + "name": "Jump_Land", + "source": "Jump_Land" + }, + { + "loop": false, + "name": "No", + "source": "No" + }, + { + "loop": false, + "name": "Punch", + "source": "Punch" + }, + { + "loop": false, + "name": "Run_Gun", + "source": "Run_Gun" + }, + { + "loop": false, + "name": "Run_Shoot", + "source": "Run_Shoot" + }, + { + "loop": false, + "name": "Walk", + "source": "Walk" + }, + { + "loop": false, + "name": "Walk_Gun", + "source": "Walk_Gun" + }, + { + "loop": false, + "name": "Wave", + "source": "Wave" + }, + { + "loop": false, + "name": "Yes", + "source": "Yes" + } + ] + } + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Player3", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "Number", + "type": "string", + "value": "3" + }, + { + "name": "Keys", + "type": "structure", + "children": [ + { + "name": "Bomb", + "type": "string", + "value": "h" + }, + { + "name": "Down", + "type": "string", + "value": "k" + }, + { + "name": "Left", + "type": "string", + "value": "j" + }, + { + "name": "Right", + "type": "string", + "value": "l" + }, + { + "name": "Up", + "type": "string", + "value": "i" + } + ] + }, + { + "name": "BombCapacity", + "type": "string", + "value": "" + }, + { + "name": "Range", + "type": "string", + "value": "" + } + ], + "effects": [], + "behaviors": [ + { + "name": "Player", + "type": "Player::Player" + }, + { + "name": "RemapForTopdown", + "type": "BehaviorRemapper::RemapForTopdown", + "Up": "i", + "Left": "j", + "Right": "l", + "Down": "k", + "Topdown": "TopDownMovement" + }, + { + "name": "Respawn", + "type": "Respawn::Respawn", + "InvincibilityTime": 5 + }, + { + "name": "TopDownCornerSlider", + "type": "TopDownCornerSliding::TopDownCornerSlider", + "TopDownMovement": "TopDownMovement", + "PixelSize": 1, + "OffsetX": 0, + "OffsetY": 0 + }, + { + "name": "TopDownGamepadMapper", + "type": "Gamepads::TopDownGamepadMapper", + "TopDownMovement": "TopDownMovement", + "GamepadIdentifier": 3, + "UseArrows": true, + "UseLeftStick": true, + "UseRightStick": false, + "StickMode": "8 Directions" + }, + { + "name": "TopDownMovement", + "type": "TopDownMovementBehavior::TopDownMovementBehavior", + "acceleration": 16000, + "deceleration": 16000, + "maxSpeed": 200, + "allowDiagonals": true, + "angleOffset": 0, + "angularMaxSpeed": 180, + "ignoreDefaultControls": true, + "rotateObject": false + } + ], + "animations": [ + { + "name": "assets\\Orange", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\Orange.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "", + "name": "OrangeBunny", + "tags": "", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Flash", + "type": "Flash::Flash", + "HalfPeriodTime": 0.1, + "IsFlashing": false, + "FlashDuration": 0 + }, + { + "name": "PlayerModel", + "type": "Player::PlayerModel", + "Tween": "Tween", + "Tween3D": "Tween3D", + "Flash": "Flash" + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + }, + { + "name": "Tween3D", + "type": "Tween3D::Tween3D", + "Object3D": "Object3D", + "Scale": "Scale" + } + ], + "content": { + "centerLocation": "ModelOrigin", + "depth": 120, + "height": 120, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "assets\\OrangeBunny.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 120, + "animations": [ + { + "loop": true, + "name": "Idle", + "source": "Idle" + }, + { + "loop": true, + "name": "Run", + "source": "Run" + }, + { + "loop": false, + "name": "Death", + "source": "Death" + }, + { + "loop": false, + "name": "Duck", + "source": "Duck" + }, + { + "loop": false, + "name": "HitReact", + "source": "HitReact" + }, + { + "loop": false, + "name": "Idle_Gun", + "source": "Idle_Gun" + }, + { + "loop": false, + "name": "Idle_Shoot", + "source": "Idle_Shoot" + }, + { + "loop": false, + "name": "Jump", + "source": "Jump" + }, + { + "loop": false, + "name": "Jump_Idle", + "source": "Jump_Idle" + }, + { + "loop": false, + "name": "Jump_Land", + "source": "Jump_Land" + }, + { + "loop": false, + "name": "No", + "source": "No" + }, + { + "loop": false, + "name": "Punch", + "source": "Punch" + }, + { + "loop": false, + "name": "Run_Gun", + "source": "Run_Gun" + }, + { + "loop": false, + "name": "Run_Shoot", + "source": "Run_Shoot" + }, + { + "loop": false, + "name": "Walk", + "source": "Walk" + }, + { + "loop": false, + "name": "Walk_Gun", + "source": "Walk_Gun" + }, + { + "loop": false, + "name": "Wave", + "source": "Wave" + }, + { + "loop": false, + "name": "Yes", + "source": "Yes" + } + ] + } + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Player4", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "Number", + "type": "string", + "value": "4" + }, + { + "name": "Keys", + "type": "structure", + "children": [ + { + "name": "Bomb", + "type": "string", + "value": "Numpad0" + }, + { + "name": "Down", + "type": "string", + "value": "Numpad5" + }, + { + "name": "Left", + "type": "string", + "value": "Numpad4" + }, + { + "name": "Right", + "type": "string", + "value": "Numpad6" + }, + { + "name": "Up", + "type": "string", + "value": "Numpad8" + } + ] + }, + { + "name": "BombCapacity", + "type": "string", + "value": "" + }, + { + "name": "Range", + "type": "string", + "value": "" + } + ], + "effects": [], + "behaviors": [ + { + "name": "Player", + "type": "Player::Player" + }, + { + "name": "RemapForTopdown", + "type": "BehaviorRemapper::RemapForTopdown", + "Up": "Numpad8", + "Left": "Numpad4", + "Right": "Numpad6", + "Down": "Numpad5", + "Topdown": "TopDownMovement" + }, + { + "name": "Respawn", + "type": "Respawn::Respawn", + "InvincibilityTime": 5 + }, + { + "name": "TopDownCornerSlider", + "type": "TopDownCornerSliding::TopDownCornerSlider", + "TopDownMovement": "TopDownMovement", + "PixelSize": 1, + "OffsetX": 0, + "OffsetY": 0 + }, + { + "name": "TopDownGamepadMapper", + "type": "Gamepads::TopDownGamepadMapper", + "TopDownMovement": "TopDownMovement", + "GamepadIdentifier": 4, + "UseArrows": true, + "UseLeftStick": true, + "UseRightStick": false, + "StickMode": "8 Directions" + }, + { + "name": "TopDownMovement", + "type": "TopDownMovementBehavior::TopDownMovementBehavior", + "acceleration": 16000, + "deceleration": 16000, + "maxSpeed": 200, + "allowDiagonals": true, + "angleOffset": 0, + "angularMaxSpeed": 180, + "ignoreDefaultControls": true, + "rotateObject": false + } + ], + "animations": [ + { + "name": "assets\\Pink", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\Pink.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "", + "name": "PinkBunny", + "tags": "", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Flash", + "type": "Flash::Flash", + "HalfPeriodTime": 0.1, + "IsFlashing": false, + "FlashDuration": 0 + }, + { + "name": "PlayerModel", + "type": "Player::PlayerModel", + "Tween": "Tween", + "Tween3D": "Tween3D", + "Flash": "Flash" + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + }, + { + "name": "Tween3D", + "type": "Tween3D::Tween3D", + "Object3D": "Object3D", + "Scale": "Scale" + } + ], + "content": { + "centerLocation": "ModelOrigin", + "depth": 120, + "height": 120, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "assets\\PinkBunny.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 120, + "animations": [ + { + "loop": true, + "name": "Idle", + "source": "Idle" + }, + { + "loop": true, + "name": "Run", + "source": "Run" + }, + { + "loop": false, + "name": "Death", + "source": "Death" + }, + { + "loop": false, + "name": "Duck", + "source": "Duck" + }, + { + "loop": false, + "name": "HitReact", + "source": "HitReact" + }, + { + "loop": false, + "name": "Idle_Gun", + "source": "Idle_Gun" + }, + { + "loop": false, + "name": "Idle_Shoot", + "source": "Idle_Shoot" + }, + { + "loop": false, + "name": "Jump", + "source": "Jump" + }, + { + "loop": false, + "name": "Jump_Idle", + "source": "Jump_Idle" + }, + { + "loop": false, + "name": "Jump_Land", + "source": "Jump_Land" + }, + { + "loop": false, + "name": "No", + "source": "No" + }, + { + "loop": false, + "name": "Punch", + "source": "Punch" + }, + { + "loop": false, + "name": "Run_Gun", + "source": "Run_Gun" + }, + { + "loop": false, + "name": "Run_Shoot", + "source": "Run_Shoot" + }, + { + "loop": false, + "name": "Walk", + "source": "Walk" + }, + { + "loop": false, + "name": "Walk_Gun", + "source": "Walk_Gun" + }, + { + "loop": false, + "name": "Wave", + "source": "Wave" + }, + { + "loop": false, + "name": "Yes", + "source": "Yes" + } + ] + } + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Bomb", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "Bomb", + "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": "b1eeab64f8aaf7a51a61e308980d490144c452c25901fd4075cc46f9e05a2395", + "name": "BombModel", + "tags": "", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "BombAnimator", + "type": "Bomb::BombAnimator", + "Tween3D": "Tween3D", + "Tween": "Tween", + "Wobble": "Wobble" + }, + { + "name": "Sticker", + "type": "Sticker::Sticker", + "OnlyFollowPosition": true, + "IsDestroyedWithParent": true + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + }, + { + "name": "Tween3D", + "type": "Tween3D::Tween3D", + "Object3D": "Object3D", + "Scale": "Scale" + }, + { + "name": "Wobble", + "type": "Tween3D::Wobble", + "Tween3D": "Tween3D", + "Tween": "Tween", + "ScaleMin": 0.75, + "ScaleMax": 1, + "ScalePeriodDuration": 1, + "ScalePeriodOffset": 0, + "StretchMin": 1, + "StretchMax": 1.25, + "StretchPeriodDuration": 1, + "StretchPeriodOffset": -0.25, + "Top": "Z+" + } + ], + "content": { + "centerLocation": "ObjectCenter", + "depth": 82.77, + "height": 60, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Bomb.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 0, + "width": 60, + "animations": [] + } + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Explosion", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Explosion", + "type": "Bomb::ExplosionBehavior" + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.034, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "ExplosionCentre-Anim4", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 6 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 15, + "y": 15 + }, + { + "x": 45, + "y": 15 + }, + { + "x": 45, + "y": 45 + }, + { + "x": 15, + "y": 45 + } + ] + ] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "", + "name": "Bonus", + "tags": "", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "BonusAnimator", + "type": "Bonus::BonusAnimator", + "Tween3D": "Tween3D", + "Tween": "Tween", + "Shake3D": "ShakeModel3D" + }, + { + "name": "ShakeModel3D", + "type": "ShakeObject3D::ShakeModel3D", + "TranslationAmplitudeX": 0, + "TranslationAmplitudeY": 0, + "TranslationAmplitudeZ": 0, + "RotationAmplitudeX": 30, + "RotationAmplitudeY": 30, + "RotationAmplitudeZ": 0, + "Time": 5, + "Duration": 5, + "StartEasingDuration": 5, + "StopEasingDuration": 5, + "Frequency": 2, + "DeltaX": 5, + "DeltaY": 5, + "DeltaZ": 5, + "DeltaAngleX": 5, + "DeltaAngleY": 5, + "DeltaAngleZ": 5, + "NoiseTime": 5, + "Object3D": "Object3D" + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + }, + { + "name": "Tween3D", + "type": "Tween3D::Tween3D", + "Object3D": "Object3D", + "Scale": "Scale" + } + ], + "content": { + "width": 50, + "height": 50, + "depth": 0.01, + "enableTextureTransparency": true, + "facesOrientation": "Y", + "frontFaceResourceName": "BombeBonus.png", + "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": "", + "bold": false, + "italic": false, + "name": "Score", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [ + { + "name": "PlayerNum", + "type": "string", + "value": "" + } + ], + "effects": [], + "behaviors": [], + "string": "Score", + "font": "", + "textAlignment": "", + "characterSize": 20, + "color": { + "b": 46, + "g": 56, + "r": 26 + } + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "ScoreIcon1", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\BlueBunnyIcon.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "ScoreIcon2", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\PurpleBunnyIcon.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "ScoreIcon3", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "PlayerNum", + "type": "string", + "value": "3" + } + ], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\OrangeBunnyIcon.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "ScoreIcon4", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\PinkBunnyIcon.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "cc824d9e1c33714ecde03e236bc3edc83ea437cb2de23060abd030fbe3d83eea", + "name": "Rock", + "tags": "", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "TopDownCornerSliderObstacle", + "type": "TopDownCornerSliding::TopDownCornerSliderObstacle", + "SlidingCornerSize": 40 + } + ], + "content": { + "centerLocation": "ObjectCenter", + "depth": 40, + "height": 60, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "assets\\FlashyRock.glb", + "originLocation": "TopLeft", + "rotationX": 0, + "rotationY": 0, + "rotationZ": 0, + "width": 60, + "animations": [] + } + }, + { + "assetStoreId": "9c628d2e17c64382fccfe686ec2106319f395e38b8d77b764a8ba9838b65734d", + "name": "Crate", + "tags": "", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "TopDownCornerSliderObstacle", + "type": "TopDownCornerSliding::TopDownCornerSliderObstacle", + "SlidingCornerSize": 40 + } + ], + "content": { + "centerLocation": "ObjectCenter", + "depth": 60, + "height": 60, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Cabbage.glb", + "originLocation": "TopLeft", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 0, + "width": 60, + "animations": [] + } + }, + { + "assetStoreId": "ca4c977991d157fdc33034d1882a0f0973d7332a8df743aa0f38c7c436022ceb", + "name": "BlockRoundedLong", + "tags": "", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "TopDownCornerSliderObstacle", + "type": "TopDownCornerSliding::TopDownCornerSliderObstacle", + "SlidingCornerSize": 40 + } + ], + "content": { + "centerLocation": "ModelOrigin", + "depth": 40, + "height": 120, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "assets\\GreyBlock.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": -90, + "width": 60, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "ExplosionParticleEmitter", + "tags": "", + "type": "ParticleEmitter3D::ParticleEmitter3D", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "Z": 30, + "Duration": 1, + "GravityTop": "Z+", + "StartSpeedMax": 100, + "SpayConeAngle": 360, + "StartSizeMin": 42, + "StartSizeMax": 84, + "EndScale": 0.25, + "StartSpeedMin": 100, + "LifespanMax": 0.5, + "LifespanMin": 0.25, + "Flow": 120, + "EndColor": "255;255;0", + "EndOpacity": 0 + }, + "childrenContent": { + "Particle": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Image", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "assets\\SmoothParticle.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 20, + "y": 21 + }, + { + "x": 44, + "y": 21 + }, + { + "x": 44, + "y": 46 + }, + { + "x": 20, + "y": 46 + } + ] + ] + } + ] + } + ] + } + ] + } + } + }, + { + "assetStoreId": "", + "name": "UpgradeParticleEmitter", + "tags": "", + "type": "ParticleEmitter3D::ParticleEmitter3D", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Sticker", + "type": "Sticker::Sticker", + "OnlyFollowPosition": true, + "IsDestroyedWithParent": false + } + ], + "content": { + "Z": 20, + "Duration": 0.03125, + "GravityTop": "Z+", + "StartSpeedMax": 300, + "SpayConeAngle": 360, + "StartSizeMin": 42, + "StartSizeMax": 84, + "EndScale": 0.25, + "StartSpeedMin": 300, + "LifespanMax": 0.333, + "LifespanMin": 0.333, + "Flow": 480, + "EndColor": "255;255;255", + "EndOpacity": 0, + "StartColor": "255;255;255", + "AreParticlesRelative": true, + "Gravity": 0 + }, + "childrenContent": { + "Particle": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Image", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "assets\\SmoothParticle.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 20, + "y": 21 + }, + { + "x": 44, + "y": 21 + }, + { + "x": 44, + "y": 46 + }, + { + "x": 20, + "y": 46 + } + ] + ] + } + ] + } + ] + } + ] + } + } + }, + { + "assetStoreId": "", + "name": "Soil", + "tags": "", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "width": 110, + "height": 110, + "depth": 0.01, + "enableTextureTransparency": false, + "facesOrientation": "Y", + "frontFaceResourceName": "assets\\Soil2.png", + "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": "SoilBorder", + "tags": "", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "width": 60, + "height": 120, + "depth": 0.01, + "enableTextureTransparency": false, + "facesOrientation": "Y", + "frontFaceResourceName": "assets\\SoilBorder.png", + "backFaceResourceName": "", + "backFaceUpThroughWhichAxisRotation": "X", + "leftFaceResourceName": "", + "rightFaceResourceName": "", + "topFaceResourceName": "", + "bottomFaceResourceName": "", + "frontFaceVisible": true, + "backFaceVisible": false, + "leftFaceVisible": false, + "rightFaceVisible": false, + "topFaceVisible": false, + "bottomFaceVisible": false, + "frontFaceResourceRepeat": true, + "backFaceResourceRepeat": false, + "leftFaceResourceRepeat": false, + "rightFaceResourceRepeat": false, + "topFaceResourceRepeat": false, + "bottomFaceResourceRepeat": false, + "materialType": "Basic" + } + }, + { + "assetStoreId": "", + "name": "SoilCorner", + "tags": "", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "width": 60, + "height": 60, + "depth": 0.01, + "enableTextureTransparency": false, + "facesOrientation": "Y", + "frontFaceResourceName": "assets\\SoilCorner.png", + "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": "New3DBox", + "tags": "", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "width": 100, + "height": 100, + "depth": 0.01, + "enableTextureTransparency": false, + "facesOrientation": "Y", + "frontFaceResourceName": "New image", + "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" + } + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Panel", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "assets\\New image.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 16, + "y": 0 + }, + { + "x": 16, + "y": 16 + }, + { + "x": 0, + "y": 16 + } + ] + ] + } + ] + } + ] + } + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::SetCameraRotationX" + }, + "parameters": [ + "", + "=", + "20", + "", + "" + ] + }, + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "=", + "650", + "", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "BuiltinExternalLayouts::CreateObjectsFromExternalLayout" + }, + "parameters": [ + "", + "GlobalVariableString(Level)", + "0", + "0" + ] + }, + { + "type": { + "value": "BuiltinExternalLayouts::CreateObjectsFromExternalLayout" + }, + "parameters": [ + "", + "\"SoilBorders\"", + "0", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Rock", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Soil", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Soil", + "=", + "Rock.CenterX()", + "=", + "Rock.CenterY()" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Soil", + "=", + "90 * Random(3)" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Soil", + "+", + "RandomFloatInRange(-15, 15)" + ] + }, + { + "type": { + "value": "Scene3D::Cube3DObject::SetZ" + }, + "parameters": [ + "Soil", + "+", + "-10" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Settings chosen in the scene \"Selection\" are applied." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Player", + "Number", + ">", + "GlobalVariable(PlayerCount)" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Player", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "ScoreIcon", + "PlayerNum", + ">", + "GlobalVariable(PlayerCount)" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "ScoreIcon", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Score", + "PlayerNum", + ">", + "GlobalVariable(PlayerCount)" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Score", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Link", + "include": { + "includeConfig": 0 + }, + "target": "Print score" + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Bonus", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Distance" + }, + "parameters": [ + "Player", + "Bonus", + "20", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Player::Player::PickUpBonus" + }, + "parameters": [ + "Player", + "Player", + "Bonus", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "UpgradeParticleEmitter", + "Player.CenterX()", + "Player.CenterY() - 15", + "" + ] + }, + { + "type": { + "value": "Sticker::Sticker::Stick" + }, + "parameters": [ + "UpgradeParticleEmitter", + "Sticker", + "Player", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Bomb", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Players put bombs", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The player variables can't be used in an expression if no condition nor action referred to it. The repeat loop takes that role." + }, + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Player", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Player.VariableString(Keys.Bomb)" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Player.Variable(Number)", + "\"A\"", + "" + ] + } + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "canPutBomb variable is used to forget the bombs picked by the condition and be able to access the created one." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetSceneVariableAsBoolean" + }, + "parameters": [ + "canPutBomb", + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Player::Player::CanPutBomb" + }, + "parameters": [ + "Player", + "Player", + "Bomb", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetSceneVariableAsBoolean" + }, + "parameters": [ + "canPutBomb", + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneVariableAsBoolean" + }, + "parameters": [ + "canPutBomb", + "True" + ] + } + ], + "actions": [ + { + "type": { + "value": "Player::Player::PutBomb" + }, + "parameters": [ + "Player", + "Player", + "Bomb", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "BombModel", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "BombModel", + "=", + "Bomb.CenterX()", + "=", + "Bomb.CenterY()" + ] + }, + { + "type": { + "value": "Sticker::Sticker::Stick" + }, + "parameters": [ + "BombModel", + "Sticker", + "Bomb", + "" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Bomb" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "AjoutObjConcern" + }, + "parameters": [ + "", + "Player" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Other players can be on the square where the bomb is put." + }, + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Player", + "conditions": [ + { + "type": { + "value": "CollisionNP" + }, + "parameters": [ + "Player", + "Bomb", + "", + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Player::Player::AllowToWalkOnBomb" + }, + "parameters": [ + "Player", + "Player", + "Bomb", + "" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Collision between bombs and players", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Player::Player::SeparateFromBomb" + }, + "parameters": [ + "Player", + "Player", + "Bomb", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Bomb detonation", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "A bomb can explode because of the detonator..." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectTimer" + }, + "parameters": [ + "Bomb", + "\"Detonator\"", + "3" + ] + } + ], + "actions": [ + { + "type": { + "value": "Bomb::Explode" + }, + "parameters": [ + "", + "Bomb", + "Explosion", + "Explosion", + "Obstacle", + "ExplosionParticleEmitter", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Link", + "include": { + "includeConfig": 0 + }, + "target": "Check explosion collision" + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "...or by chain reaction." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetSceneVariableAsBoolean" + }, + "parameters": [ + "hasNewBombExploded", + "True" + ] + } + ] + }, + { + "infiniteLoopWarning": true, + "type": "BuiltinCommonInstructions::While", + "whileConditions": [ + { + "type": { + "value": "SceneVariableAsBoolean" + }, + "parameters": [ + "hasNewBombExploded", + "True" + ] + } + ], + "conditions": [], + "actions": [ + { + "type": { + "value": "SetSceneVariableAsBoolean" + }, + "parameters": [ + "hasNewBombExploded", + "False" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Bomb", + "conditions": [ + { + "type": { + "value": "CollisionNP" + }, + "parameters": [ + "Explosion", + "Bomb", + "", + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AjoutObjConcern" + }, + "parameters": [ + "", + "Explosion" + ] + }, + { + "type": { + "value": "Bomb::Explode" + }, + "parameters": [ + "", + "Bomb", + "Explosion", + "Explosion", + "Obstacle", + "ExplosionParticleEmitter", + "" + ] + }, + { + "type": { + "value": "SetSceneVariableAsBoolean" + }, + "parameters": [ + "hasNewBombExploded", + "True" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Link", + "include": { + "includeConfig": 0 + }, + "target": "Check explosion collision" + } + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Death", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Every death counts." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetSceneVariableAsBoolean" + }, + "parameters": [ + "scoreHasChanged", + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Player", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionNP" + }, + "parameters": [ + "Player", + "Explosion", + "", + "", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "Respawn::Respawn::isInvincible" + }, + "parameters": [ + "Player", + "Respawn", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "VarObjet" + }, + "parameters": [ + "Player", + "Death", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetSceneVariableAsBoolean" + }, + "parameters": [ + "scoreHasChanged", + "True" + ] + }, + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Player", + "Death", + "True" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "LinkedObjects::PickObjectsLinkedTo" + }, + "parameters": [ + "", + "PlayerModel", + "Player", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Player::PlayerModel::PlayDeathAnimationFromExplosion" + }, + "parameters": [ + "PlayerModel", + "PlayerModel", + "Explosion", + "Player", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Explosion", + "PlayerNum", + "!=", + "Player.Variable(Number)" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarGlobal" + }, + "parameters": [ + "Score[Explosion.VariableString(PlayerNum)]", + "+", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Explosion", + "PlayerNum", + "=", + "Player.Variable(Number)" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarGlobal" + }, + "parameters": [ + "Score[Explosion.VariableString(PlayerNum)]", + "-", + "1" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Dead players come back to their initial location." + }, + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Player", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Player", + "Death", + "True" + ] + }, + { + "type": { + "value": "Player::PlayerModel::CanRespawn" + }, + "parameters": [ + "PlayerModel", + "PlayerModel", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Player", + "Death", + "False" + ] + }, + { + "type": { + "value": "Respawn::Respawn::respawn" + }, + "parameters": [ + "Player", + "Respawn", + "" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Player", + "BombPut", + "=", + "0" + ] + }, + { + "type": { + "value": "Player::Player::GiveBackBonuses" + }, + "parameters": [ + "Player", + "Player", + "Bonus", + "BonusAnimator", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "LinkedObjects::PickObjectsLinkedTo" + }, + "parameters": [ + "", + "PlayerModel", + "Player", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Player::PlayerModel::PlayRespawnAnimation" + }, + "parameters": [ + "PlayerModel", + "PlayerModel", + "" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneVariableAsBoolean" + }, + "parameters": [ + "scoreHasChanged", + "True" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Link", + "include": { + "includeConfig": 0 + }, + "target": "Print score" + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Players skin", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "LinkedObjects::LinkObjects" + }, + "parameters": [ + "", + "Player1", + "BlueBunny" + ] + }, + { + "type": { + "value": "LinkedObjects::LinkObjects" + }, + "parameters": [ + "", + "Player2", + "PurpleBunny" + ] + }, + { + "type": { + "value": "LinkedObjects::LinkObjects" + }, + "parameters": [ + "", + "Player3", + "OrangeBunny" + ] + }, + { + "type": { + "value": "LinkedObjects::LinkObjects" + }, + "parameters": [ + "", + "Player4", + "PinkBunny" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneInstancesCount" + }, + "parameters": [ + "", + "Player3", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "OrangeBunny", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneInstancesCount" + }, + "parameters": [ + "", + "Player4", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "PinkBunny", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Player", + "conditions": [ + { + "type": { + "value": "LinkedObjects::PickObjectsLinkedTo" + }, + "parameters": [ + "", + "PlayerModel", + "Player", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Player::PlayerModel::UpdatePosition" + }, + "parameters": [ + "PlayerModel", + "PlayerModel", + "Player", + "TopDownMovement", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyReleased" + }, + "parameters": [ + "", + "Space" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetSpeedScale" + }, + "parameters": [ + "BlueBunny", + "Animation", + "*", + "-1" + ] + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 16, + "ambientLightColorG": 150995056, + "ambientLightColorR": 1869181824, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "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": "Effect", + "doubleParameters": { + "elevation": 90, + "intensity": 1, + "rotation": 0 + }, + "stringParameters": { + "groundColor": "127;127;127", + "skyColor": "255;255;255", + "top": "Z+" + }, + "booleanParameters": {} + } + ] + }, + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "UI", + "renderingType": "2d", + "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": {} + } + ] + } + ], + "behaviorsSharedData": [ + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, + { + "name": "BombAnimator", + "type": "Bomb::BombAnimator" + }, + { + "name": "BonusAnimator", + "type": "Bonus::BonusAnimator" + }, + { + "name": "Effect", + "type": "EffectCapability::EffectBehavior" + }, + { + "name": "Explosion", + "type": "Bomb::ExplosionBehavior" + }, + { + "name": "Flash", + "type": "Flash::Flash" + }, + { + "name": "Flippable", + "type": "FlippableCapability::FlippableBehavior" + }, + { + "name": "Object3D", + "type": "Scene3D::Base3DBehavior" + }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, + { + "name": "Player", + "type": "Player::Player" + }, + { + "name": "PlayerModel", + "type": "Player::PlayerModel", + "MovementAngle": 90 + }, + { + "name": "RemapForTopdown", + "type": "BehaviorRemapper::RemapForTopdown" + }, + { + "name": "Resizable", + "type": "ResizableCapability::ResizableBehavior" + }, + { + "name": "Respawn", + "type": "Respawn::Respawn" + }, + { + "name": "Scale", + "type": "ScalableCapability::ScalableBehavior" + }, + { + "name": "ShakeModel3D", + "type": "ShakeObject3D::ShakeModel3D", + "EasingFactor": 0 + }, + { + "name": "Sticker", + "type": "Sticker::Sticker" + }, + { + "name": "TopDownCornerSlider", + "type": "TopDownCornerSliding::TopDownCornerSlider" + }, + { + "name": "TopDownCornerSliderObstacle", + "type": "TopDownCornerSliding::TopDownCornerSliderObstacle" + }, + { + "name": "TopDownGamepadMapper", + "type": "Gamepads::TopDownGamepadMapper" + }, + { + "name": "TopDownMovement", + "type": "TopDownMovementBehavior::TopDownMovementBehavior" + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + }, + { + "name": "Tween3D", + "type": "Tween3D::Tween3D" + }, + { + "name": "Wobble", + "type": "Tween3D::Wobble" + } + ] + }, + { + "b": 121, + "disableInputWhenNotFocused": true, + "mangledName": "Selection", + "name": "Selection", + "r": 69, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 147, + "uiSettings": { + "grid": true, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": true, + "zoomFactor": 0.6213954974393143, + "windowMask": false + }, + "objectsGroups": [ + { + "name": "LevelButton", + "objects": [ + { + "name": "ClassicLevel" + }, + { + "name": "EmptyLevel" + } + ] + } + ], + "variables": [], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 128, + "layer": "", + "name": "PlayerButton", + "persistentUuid": "2cfd5749-461c-49c7-aa2c-ed96d18ff8fa", + "width": 128, + "x": 384, + "y": 96, + "zOrder": 20, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "PlayerCount", + "type": "number", + "value": 2 + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "ClassicLevel", + "persistentUuid": "c0dfb158-0c70-4190-8054-75e1b1b1519a", + "width": 0, + "x": 122, + "y": 350, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "EmptyLevel", + "persistentUuid": "0affdf6e-c1d7-4ce5-9127-58bcf4c6332f", + "width": 0, + "x": 800, + "y": 352, + "zOrder": 5, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Player1", + "persistentUuid": "0bf817cd-1d90-4559-aa65-58ef521467f7", + "width": 0, + "x": 764, + "y": 144, + "zOrder": 15, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Player1", + "persistentUuid": "632fdf20-f66d-41db-83e0-f396192ba2a7", + "width": 0, + "x": 585, + "y": 144, + "zOrder": 15, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Player2", + "persistentUuid": "92d0f636-73f4-403e-be06-77090c45d50f", + "width": 0, + "x": 609, + "y": 132, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Player2", + "persistentUuid": "d5c2c919-f98f-4d5d-b53f-8f8d0b7996b8", + "width": 0, + "x": 788, + "y": 132, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Player3", + "persistentUuid": "89bb8063-0ffa-4ee3-b4eb-7ed589a16dfb", + "width": 0, + "x": 633, + "y": 120, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Player3", + "persistentUuid": "ee365d7f-282c-4746-9b01-cefdcee6cb7c", + "width": 0, + "x": 812, + "y": 120, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Player4", + "persistentUuid": "988cd659-15ed-43a1-b191-1722f5590994", + "width": 0, + "x": 832, + "y": 108, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 224, + "layer": "", + "name": "Controls", + "persistentUuid": "e3d6399e-afd4-45f3-89b0-e5e32647d0c7", + "width": 192, + "x": 544, + "y": 352, + "zOrder": 21, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Player1", + "persistentUuid": "39330ce0-708f-400e-9cbe-93a810f37c84", + "width": 0, + "x": 406, + "y": 145, + "zOrder": 15, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Player2", + "persistentUuid": "2c6334f5-2b8d-41d3-853b-007a9df4bb6e", + "width": 0, + "x": 426, + "y": 133, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Controls2", + "persistentUuid": "2febaeab-ceed-4d24-9a94-9e5c97de2473", + "width": 0, + "x": 654, + "y": 352, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 288, + "layer": "", + "name": "DarkBackground", + "persistentUuid": "8ea97105-1b13-4bd1-9d9b-c0bb7bd19c04", + "width": 416, + "x": 96, + "y": 320, + "zOrder": 0, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 288, + "layer": "", + "name": "DarkBackground", + "persistentUuid": "d8ab7ddb-21d1-4522-af28-890e7e65738e", + "width": 416, + "x": 768, + "y": 320, + "zOrder": 0, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 128, + "layer": "", + "name": "PlayerButton", + "persistentUuid": "4512ec27-3766-449b-9474-40ca30c1073e", + "width": 128, + "x": 576, + "y": 96, + "zOrder": 20, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "PlayerCount", + "type": "number", + "value": 3 + } + ] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 128, + "layer": "", + "name": "PlayerButton", + "persistentUuid": "fd56520c-eac7-4977-a95c-f5c1beb0a154", + "width": 128, + "x": 768, + "y": 96, + "zOrder": 20, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "folded": true, + "name": "PlayerCount", + "type": "number", + "value": 4 + } + ] + } + ], + "objects": [ + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "PlayerButton", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "folded": true, + "name": "PlayerCount", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [ + { + "name": "ButtonFSM", + "type": "ButtonStates::ButtonFSM", + "ShouldCheckHovering": true, + "State": "Idle", + "TouchId": 0, + "TouchIsInside": false, + "MouseIsInside": false, + "Index": 0 + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "JoueurSelectionMask.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "ClassicLevel", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "Name", + "type": "string", + "value": "ClassicLevel" + }, + { + "name": "Bomb", + "type": "string", + "value": "1" + }, + { + "name": "Flame", + "type": "string", + "value": "2" + } + ], + "effects": [ + { + "effectType": "Adjustment", + "name": "Adjustment", + "doubleParameters": { + "alpha": 1, + "blue": 1, + "brightness": 1, + "contrast": 1, + "gamma": 1, + "green": 1, + "red": 1, + "saturation": 1 + }, + "stringParameters": {}, + "booleanParameters": {} + } + ], + "behaviors": [ + { + "name": "ButtonFSM", + "type": "ButtonStates::ButtonFSM", + "ShouldCheckHovering": true, + "State": "Idle", + "TouchId": 0, + "TouchIsInside": false, + "MouseIsInside": false, + "Index": 0 + }, + { + "name": "ButtonObjectEffects", + "type": "ButtonStates::ButtonObjectEffectTween", + "ButtonStatesBehavior": "ButtonFSM", + "ObjectEffectCapability": "Effect", + "HoverEffect": "Effect", + "PressedEffect": "", + "HeldOutsideEffect": "", + "IdleEffect": "", + "FocusedEffect": "", + "Effect": "Effect", + "EffectProperty": "brightness", + "FocusedValue": 1.1, + "IdleValue": 1, + "PressedValue": 1.3, + "ButtonFSM": "ButtonFSM", + "EffectCapability": "Effect", + "Effect2": "Effect", + "EffectName": "Adjustment", + "FadeOutDuration": 0.5, + "FadeInDuration": 0.125 + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "ClassicLevel.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "EmptyLevel", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "Name", + "type": "string", + "value": "EmptyLevel" + }, + { + "name": "Bomb", + "type": "string", + "value": "4" + }, + { + "name": "Flame", + "type": "string", + "value": "6" + } + ], + "effects": [ + { + "effectType": "Adjustment", + "name": "Adjustment", + "doubleParameters": { + "alpha": 1, + "blue": 1, + "brightness": 1, + "contrast": 1, + "gamma": 1, + "green": 1, + "red": 1, + "saturation": 1 + }, + "stringParameters": {}, + "booleanParameters": {} + } + ], + "behaviors": [ + { + "name": "ButtonFSM", + "type": "ButtonStates::ButtonFSM", + "ShouldCheckHovering": true, + "State": "Idle", + "TouchId": 0, + "TouchIsInside": false, + "MouseIsInside": false, + "Index": 0 + }, + { + "name": "ButtonObjectEffects", + "type": "ButtonStates::ButtonObjectEffectTween", + "ButtonStatesBehavior": "ButtonFSM", + "ObjectEffectCapability": "Effect", + "HoverEffect": "Effect", + "PressedEffect": "", + "HeldOutsideEffect": "", + "IdleEffect": "", + "FocusedEffect": "", + "Effect": "Effect", + "EffectProperty": "brightness", + "FocusedValue": 1.1, + "IdleValue": 1, + "PressedValue": 1.3, + "ButtonFSM": "ButtonFSM", + "EffectCapability": "Effect", + "Effect2": "Effect", + "EffectName": "Adjustment", + "FadeOutDuration": 0.5, + "FadeInDuration": 0.125 + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "EmptyLevel.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "DarkBackground", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "NewObject", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "NewObject", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Player1", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\BlueBunnyIcon.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Player2", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\PurpleBunnyIcon.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Player3", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\OrangeBunnyIcon.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Player4", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\PinkBunnyIcon.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Controls", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "arrows\nESDF\nIJKL\n8456\n\nor gamepads", + "font": "", + "textAlignment": "", + "characterSize": 30, + "color": { + "b": 194, + "g": 212, + "r": 157 + } + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Controls2", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "RShift\nLShift\nH\n0", + "font": "", + "textAlignment": "", + "characterSize": 30, + "color": { + "b": 194, + "g": 212, + "r": 157 + } + } + ], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Players count selection", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "PlayerButton", + "Opacity", + "=", + "127" + ] + }, + { + "type": { + "value": "ModVarGlobal" + }, + "parameters": [ + "PlayerCount", + "=", + "2" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "PlayerButton", + "PlayerCount", + "=", + "2" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "PlayerButton" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsClicked" + }, + "parameters": [ + "PlayerButton", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarGlobal" + }, + "parameters": [ + "PlayerCount", + "=", + "PlayerButton.Variable(PlayerCount)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "AjoutObjConcern" + }, + "parameters": [ + "", + "PlayerButton" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "PlayerButton", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "PlayerButton" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Level selection", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsClicked" + }, + "parameters": [ + "LevelButton", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarGlobalTxt" + }, + "parameters": [ + "Level", + "=", + "LevelButton.VariableString(Name)" + ] + }, + { + "type": { + "value": "ModVarGlobal" + }, + "parameters": [ + "Bomb", + "=", + "LevelButton.Variable(Bomb)" + ] + }, + { + "type": { + "value": "ModVarGlobal" + }, + "parameters": [ + "Flame", + "=", + "LevelButton.Variable(Flame)" + ] + }, + { + "type": { + "value": "Scene" + }, + "parameters": [ + "", + "\"Game\"", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "layers": [ + { + "ambientLightColorB": 8099672, + "ambientLightColorG": 8127688, + "ambientLightColorR": 8867392, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "2d", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "behaviorsSharedData": [ + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, + { + "name": "ButtonFSM", + "type": "ButtonStates::ButtonFSM" + }, + { + "name": "ButtonObjectEffects", + "type": "ButtonStates::ButtonObjectEffectTween" + }, + { + "name": "Effect", + "type": "EffectCapability::EffectBehavior" + }, + { + "name": "Flippable", + "type": "FlippableCapability::FlippableBehavior" + }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, + { + "name": "Resizable", + "type": "ResizableCapability::ResizableBehavior" + }, + { + "name": "Scale", + "type": "ScalableCapability::ScalableBehavior" + } + ] + } + ], + "externalEvents": [ + { + "associatedLayout": "Game", + "lastChangeTimeStamp": 0, + "name": "Check explosion collision", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionNP" + }, + "parameters": [ + "Explosion", + "Crate", + "", + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Wait" + }, + "parameters": [ + "1" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Random bonus creation" + }, + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Crate", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "RandomInRange(1, 4)", + "<=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "Player::CreateBonus" + }, + "parameters": [ + "", + "Bonus", + "Crate.X()", + "Crate.Y()", + "RandomInRange(1,2)", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The crate is removed after because its location is used to create the bonus." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Explosion", + "" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Crate", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Give the player its bomb back." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Player", + "Number", + "=", + "Bomb.Variable(PlayerNum)" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Player", + "BombPut", + "-", + "1" + ] + } + ] + } + ] + }, + { + "associatedLayout": "Game", + "lastChangeTimeStamp": 0, + "name": "Print score", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Called in \"Game\" and \"Death\"." + }, + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Player", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Score", + "PlayerNum", + "=", + "Player.Variable(Number)" + ] + } + ], + "actions": [ + { + "type": { + "value": "TextObject::String" + }, + "parameters": [ + "Score", + "=", + "GlobalVariableString(Score[Player.VariableString(Number)])" + ] + } + ] + } + ] + } + ], + "eventsFunctionsExtensions": [ + { + "author": "", + "category": "User interface", + "extensionNamespace": "", + "fullName": "Button states and effects", + "helpPath": "/objects/button", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWdlc3R1cmUtdGFwLWJ1dHRvbiIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMyA1QzE1LjIxIDUgMTcgNi43OSAxNyA5QzE3IDEwLjUgMTYuMiAxMS43NyAxNSAxMi40NlYxMS4yNEMxNS42MSAxMC42OSAxNiA5Ljg5IDE2IDlDMTYgNy4zNCAxNC42NiA2IDEzIDZTMTAgNy4zNCAxMCA5QzEwIDkuODkgMTAuMzkgMTAuNjkgMTEgMTEuMjRWMTIuNDZDOS44IDExLjc3IDkgMTAuNSA5IDlDOSA2Ljc5IDEwLjc5IDUgMTMgNU0yMCAyMC41QzE5Ljk3IDIxLjMyIDE5LjMyIDIxLjk3IDE4LjUgMjJIMTNDMTIuNjIgMjIgMTIuMjYgMjEuODUgMTIgMjEuNTdMOCAxNy4zN0w4Ljc0IDE2LjZDOC45MyAxNi4zOSA5LjIgMTYuMjggOS41IDE2LjI4SDkuN0wxMiAxOFY5QzEyIDguNDUgMTIuNDUgOCAxMyA4UzE0IDguNDUgMTQgOVYxMy40N0wxNS4yMSAxMy42TDE5LjE1IDE1Ljc5QzE5LjY4IDE2LjAzIDIwIDE2LjU2IDIwIDE3LjE0VjIwLjVNMjAgMkg0QzIuOSAyIDIgMi45IDIgNFYxMkMyIDEzLjExIDIuOSAxNCA0IDE0SDhWMTJMNCAxMkw0IDRIMjBMMjAgMTJIMThWMTRIMjBWMTMuOTZMMjAuMDQgMTRDMjEuMTMgMTQgMjIgMTMuMDkgMjIgMTJWNEMyMiAyLjkgMjEuMTEgMiAyMCAyWiIgLz48L3N2Zz4=", + "name": "ButtonStates", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/753a9a794bd885058159b7509f06f5a8f67f72decfccb9a1b0efee26f41c3c4c_gesture-tap-button.svg", + "shortDescription": "Use any object as a button and change appearance during user interaction.", + "version": "1.1.0", + "description": [ + "Use the \"Button states\" behavior to track user interaction with an object, including:", + "", + "- Hovered", + "- Pressed", + "- Clicked", + "- Idle", + "", + "Add additional behaviors to make a juicy button with animated responses to user input:", + "", + "- Size", + "- Color", + "- Angle", + "- Opacity", + "- Animation", + "- Object effects" + ], + "origin": { + "identifier": "ButtonStates", + "name": "gdevelop-extension-store" + }, + "tags": [ + "ui", + "button" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + ], + "dependencies": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Use any object as a button.", + "fullName": "Button states", + "name": "ButtonFSM", + "objectType": "", + "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": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::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": "ButtonStates::ButtonFSM::SetPropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyShouldCheckHovering" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "MouseOnlyCursorX(Object.Layer(), 0)", + "MouseOnlyCursorY(Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::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": "ButtonStates::ButtonFSM::SetPropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::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": "ButtonStates::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": "ButtonStates::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": "ButtonStates::ButtonFSM::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::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": "ButtonStates::ButtonFSM::PropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ButtonStates::ButtonFSM::PropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::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": "ButtonStates::ButtonFSM::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + }, + { + "type": { + "inverted": true, + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::ResetState" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::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": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::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": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::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": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::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": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::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": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::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": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::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": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::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": "ButtonStates::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": [] + }, + { + "description": "Enable effects on buttons based on their state.", + "fullName": "Button object effects", + "name": "ButtonObjectEffects", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "Object.Behavior::PropertyIdleEffect()", + "yes" + ] + }, + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "Object.Behavior::PropertyFocusedEffect()", + "no" + ] + }, + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "Object.Behavior::PropertyPressedEffect()", + "no" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffects", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "States", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "Object.Behavior::PropertyIdleEffect()", + "no" + ] + }, + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "Object.Behavior::PropertyFocusedEffect()", + "no" + ] + }, + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "Object.Behavior::PropertyPressedEffect()", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffects::PropertyIdleEffect" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::IsIdle" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "Object.Behavior::PropertyIdleEffect()", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffects::PropertyFocusedEffect" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::IsFocused" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "Object.Behavior::PropertyFocusedEffect()", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffects::PropertyPressedEffect" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::IsPressed" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "Object.Behavior::PropertyPressedEffect()", + "yes" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffects", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Button states", + "description": "", + "group": "", + "extraInformation": [ + "ButtonStates::ButtonFSM" + ], + "hidden": false, + "name": "ButtonFSM" + }, + { + "value": "", + "type": "Behavior", + "label": "Effect capability", + "description": "", + "group": "", + "extraInformation": [ + "EffectCapability::EffectBehavior" + ], + "hidden": false, + "name": "Effect" + }, + { + "value": "", + "type": "String", + "label": "Idle state effect", + "description": "", + "group": "Effects", + "extraInformation": [], + "hidden": false, + "name": "IdleEffect" + }, + { + "value": "", + "type": "String", + "label": "Focused state effect", + "description": "The state is Focused when the button is hovered or held outside.", + "group": "Effects", + "extraInformation": [], + "hidden": false, + "name": "FocusedEffect" + }, + { + "value": "", + "type": "String", + "label": "Pressed state effect", + "description": "", + "group": "Effects", + "extraInformation": [], + "hidden": false, + "name": "PressedEffect" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Change the current animation number of a button according to their state.", + "fullName": "Button animation (number)", + "name": "ButtonAnimationNumber", + "objectType": "Sprite", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Object", + "Animation", + "=", + "Object.Behavior::PropertyIdleAnimation()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAnimationNumber", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "States", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsIdle" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Object", + "Animation", + "=", + "Object.Behavior::PropertyIdleAnimation()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsFocused" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Object", + "Animation", + "=", + "Object.Behavior::PropertyFocusedAnimation()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsPressed" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Object", + "Animation", + "=", + "Object.Behavior::PropertyPressedAnimation()" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAnimationNumber", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Button states", + "description": "", + "group": "", + "extraInformation": [ + "ButtonStates::ButtonFSM" + ], + "hidden": false, + "name": "ButtonFSM" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "Idle state animation number", + "description": "", + "group": "Animation", + "extraInformation": [], + "hidden": false, + "name": "IdleAnimation" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Focused state animation number", + "description": "", + "group": "Animation", + "extraInformation": [], + "hidden": false, + "name": "FocusedAnimation" + }, + { + "value": "2", + "type": "Number", + "unit": "Dimensionless", + "label": "Pressed state animation number", + "description": "", + "group": "Animation", + "extraInformation": [], + "hidden": false, + "name": "PressedAnimation" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Change the animation of buttons according to their state.", + "fullName": "Button animation (name)", + "name": "ButtonAnimationName", + "objectType": "Sprite", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "Object.Behavior::PropertyIdleAnimationName()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAnimationName", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Change based on state", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsIdle" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "Object.Behavior::PropertyIdleAnimationName()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsFocused" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "Object.Behavior::PropertyFocusedAnimationName()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsPressed" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "Object.Behavior::PropertyPressedAnimationName()" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAnimationName", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Button states", + "description": "", + "group": "", + "extraInformation": [ + "ButtonStates::ButtonFSM" + ], + "hidden": false, + "name": "ButtonFSM" + }, + { + "value": "Idle", + "type": "String", + "label": "Idle state animation name", + "description": "", + "group": "Animation", + "extraInformation": [], + "hidden": false, + "name": "IdleAnimationName" + }, + { + "value": "Focused", + "type": "String", + "label": "Focused state animation name", + "description": "", + "group": "Animation", + "extraInformation": [], + "hidden": false, + "name": "FocusedAnimationName" + }, + { + "value": "Pressed", + "type": "String", + "label": "Pressed state animation name", + "description": "", + "group": "Animation", + "extraInformation": [], + "hidden": false, + "name": "PressedAnimationName" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Smoothly change an effect on buttons according to their state.", + "fullName": "Button object effect tween", + "name": "ButtonObjectEffectTween", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyEffectValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyIdleValue()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "States", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsIdle" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyIdleValue()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsFocused" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFocusedValue()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFocusedValue()", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsPressed" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonAngleTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyPressedValue()", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Tween", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PropertyTweenState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"FadeIn\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PlayTween" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFadeInDuration()", + "Object.Behavior::PropertyFadeInEasing()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PropertyTweenState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"FadeOut\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PlayTween" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFadeOutDuration()", + "Object.Behavior::PropertyFadeOutEasing()", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "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": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade in", + "functionType": "Action", + "name": "FadeIn", + "private": true, + "sentence": "_PARAM0_ fade in to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"FadeIn\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyEffectValue()" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenTargetedValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade out", + "functionType": "Action", + "name": "FadeOut", + "private": true, + "sentence": "_PARAM0_ fade out to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"FadeOut\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyEffectValue()" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenTargetedValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "Play tween", + "functionType": "Action", + "name": "PlayTween", + "private": true, + "sentence": "Tween the effect property of object _PARAM0_ over _PARAM2_ seconds with _PARAM3_ easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PropertyTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "GetArgumentAsNumber(\"Duration\")" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Object.Behavior::TimeDelta()" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyEffectValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Tween::Ease(GetArgumentAsString(\"Easing\"), Object.Behavior::PropertyTweenInitialValue(), Object.Behavior::PropertyTweenTargetedValue(), Object.Behavior::PropertyTweenTime() / GetArgumentAsNumber(\"Duration\"))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PropertyTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "GetArgumentAsNumber(\"Duration\")" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"NoTween\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyEffectValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyTweenTargetedValue()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::SetEffectDoubleParameter" + }, + "parameters": [ + "Object", + "Effect", + "Object.Behavior::PropertyEffectName()", + "Object.Behavior::PropertyEffectProperty()", + "Object.Behavior::PropertyEffectValue()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[]", + "type": "string" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Button states", + "description": "", + "group": "", + "extraInformation": [ + "ButtonStates::ButtonFSM" + ], + "hidden": false, + "name": "ButtonFSM" + }, + { + "value": "", + "type": "Behavior", + "label": "Effect capability", + "description": "", + "group": "", + "extraInformation": [ + "EffectCapability::EffectBehavior" + ], + "hidden": false, + "name": "Effect" + }, + { + "value": "Effect", + "type": "String", + "label": "Effect name", + "description": "", + "group": "Effect", + "extraInformation": [], + "hidden": false, + "name": "EffectName" + }, + { + "value": "", + "type": "String", + "label": "Effect property", + "description": "", + "group": "Effect", + "extraInformation": [], + "hidden": false, + "name": "EffectProperty" + }, + { + "value": "0", + "type": "Number", + "label": "Idle effect property value", + "description": "", + "group": "Value", + "extraInformation": [], + "hidden": false, + "name": "IdleValue" + }, + { + "value": "0", + "type": "Number", + "label": "Focused effect property value", + "description": "The state is Focused when the button is hovered or held outside.", + "group": "Value", + "extraInformation": [], + "hidden": false, + "name": "FocusedValue" + }, + { + "value": "0", + "type": "Number", + "label": "Pressed effect property value", + "description": "", + "group": "Value", + "extraInformation": [], + "hidden": false, + "name": "PressedValue" + }, + { + "value": "easeInOutQuad", + "type": "Choice", + "label": "Fade-in easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "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" + ], + "hidden": false, + "name": "FadeInEasing" + }, + { + "value": "easeInOutQuad", + "type": "Choice", + "label": "Fade-out easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "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" + ], + "hidden": false, + "name": "FadeOutEasing" + }, + { + "value": "0.125", + "type": "Number", + "unit": "Second", + "label": "Fade-in duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "FadeInDuration" + }, + { + "value": "0.5", + "type": "Number", + "unit": "Second", + "label": "Fade-out duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "FadeOutDuration" + }, + { + "value": "Idle", + "type": "Choice", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "Idle", + "Focused", + "Pressed" + ], + "hidden": true, + "name": "PreviousState" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TweenInitialValue" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TweenTargetedValue" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TweenTime" + }, + { + "value": "NoTween", + "type": "Choice", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "NoTween", + "FadeIn", + "FadeOut" + ], + "hidden": true, + "name": "TweenState" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "EffectValue" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Smoothly resize buttons according to their state.", + "fullName": "Button scale", + "name": "ButtonScaleTween", + "objectType": "Sprite", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetValue" + }, + "parameters": [ + "Object", + "Scale", + "=", + "Object.Behavior::PropertyIdleScale()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Change based on state", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsIdle" + }, + "parameters": [ + "Object", + "ButtonStatesBehavior", + "" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonScaleTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonScaleTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyIdleScale()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsFocused" + }, + "parameters": [ + "Object", + "ButtonStatesBehavior", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonScaleTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFocusedScale()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonScaleTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFocusedScale()", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsPressed" + }, + "parameters": [ + "Object", + "ButtonStatesBehavior", + "" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonScaleTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonScaleTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyPressedScale()", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade in", + "functionType": "Action", + "name": "FadeIn", + "private": true, + "sentence": "_PARAM0_ fade in to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectScaleTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__ButtonScaleTween.Fade\"", + "GetArgumentAsNumber(\"Value\")", + "GetArgumentAsNumber(\"Value\")", + "Object.Behavior::PropertyFadeInEasing()", + "1000 * Object.Behavior::PropertyFadeInDuration()", + "no", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade out", + "functionType": "Action", + "name": "FadeOut", + "private": true, + "sentence": "_PARAM0_ fade out to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectScaleTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__ButtonScaleTween.Fade\"", + "GetArgumentAsNumber(\"Value\")", + "GetArgumentAsNumber(\"Value\")", + "Object.Behavior::PropertyFadeOutEasing()", + "1000 * Object.Behavior::PropertyFadeOutDuration()", + "no", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Button states behavior (required)", + "description": "", + "group": "", + "extraInformation": [ + "ButtonStates::ButtonFSM" + ], + "hidden": false, + "name": "ButtonStatesBehavior" + }, + { + "value": "", + "type": "Behavior", + "label": "Tween behavior (required)", + "description": "", + "group": "", + "extraInformation": [ + "Tween::TweenBehavior" + ], + "hidden": false, + "name": "TweenBehavior" + }, + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Fade-in duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "FadeInDuration" + }, + { + "value": "0.2", + "type": "Number", + "unit": "Second", + "label": "Fade-out duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "FadeOutDuration" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Idle state size scale", + "description": "", + "group": "Size", + "extraInformation": [], + "hidden": false, + "name": "IdleScale" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Focused state size scale", + "description": "", + "group": "Size", + "extraInformation": [], + "hidden": false, + "name": "FocusedScale" + }, + { + "value": "0.95", + "type": "Number", + "unit": "Dimensionless", + "label": "Pressed state size scale", + "description": "", + "group": "Size", + "extraInformation": [], + "hidden": false, + "name": "PressedScale" + }, + { + "value": "easeInOutQuad", + "type": "Choice", + "label": "Fade-in easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "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" + ], + "hidden": false, + "name": "FadeInEasing" + }, + { + "value": "easeInOutQuad", + "type": "Choice", + "label": "Fade-out easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "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" + ], + "hidden": false, + "name": "FadeOutEasing" + }, + { + "value": "Idle", + "type": "Choice", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "Idle", + "Focused", + "Pressed" + ], + "hidden": true, + "name": "PreviousState" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Smoothly rotate buttons according to their state.", + "fullName": "Button angle tween", + "name": "ButtonAngleTween", + "objectType": "", + "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": "Angle can't be changed in onCreate." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonAngleTween::PropertyHasJustBeenCreated" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonAngleTween::SetPropertyHasJustBeenCreated" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "Object.Behavior::PropertyIdleAngle()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAngleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "States", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsIdle" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonAngleTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonAngleTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonAngleTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyIdleAngle()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsFocused" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonAngleTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonAngleTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonAngleTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFocusedAngle()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonAngleTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonAngleTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonAngleTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFocusedAngle()", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsPressed" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonAngleTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonAngleTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonAngleTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyPressedAngle()", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAngleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade in", + "functionType": "Action", + "name": "FadeIn", + "private": true, + "sentence": "_PARAM0_ fade in to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectAngleTween" + }, + "parameters": [ + "Object", + "Tween", + "\"__ButtonAngleTween.Fade\"", + "GetArgumentAsNumber(\"Value\")", + "Object.Behavior::PropertyFadeInEasing()", + "1000 * Object.Behavior::PropertyFadeInDuration()", + "no" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAngleTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade out", + "functionType": "Action", + "name": "FadeOut", + "private": true, + "sentence": "_PARAM0_ fade out to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectAngleTween" + }, + "parameters": [ + "Object", + "Tween", + "\"__ButtonAngleTween.Fade\"", + "GetArgumentAsNumber(\"Value\")", + "Object.Behavior::PropertyFadeOutEasing()", + "1000 * Object.Behavior::PropertyFadeOutDuration()", + "no" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAngleTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Button states", + "description": "", + "group": "", + "extraInformation": [ + "ButtonStates::ButtonFSM" + ], + "hidden": false, + "name": "ButtonFSM" + }, + { + "value": "", + "type": "Behavior", + "label": "Tween", + "description": "", + "group": "", + "extraInformation": [ + "Tween::TweenBehavior" + ], + "hidden": false, + "name": "Tween" + }, + { + "value": "20", + "type": "Number", + "unit": "DegreeAngle", + "label": "Idle state angle", + "description": "", + "group": "Rotation", + "extraInformation": [], + "hidden": false, + "name": "IdleAngle" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Focussed state angle", + "description": "", + "group": "Rotation", + "extraInformation": [], + "hidden": false, + "name": "FocusedAngle" + }, + { + "value": "180", + "type": "Number", + "unit": "DegreeAngle", + "label": "Pressed state angle", + "description": "", + "group": "Rotation", + "extraInformation": [], + "hidden": false, + "name": "PressedAngle" + }, + { + "value": "0.3", + "type": "Number", + "unit": "Second", + "label": "Fade-in duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "FadeInDuration" + }, + { + "value": "0.6", + "type": "Number", + "unit": "Second", + "label": "Fade-out duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "FadeOutDuration" + }, + { + "value": "easeOutBounce", + "type": "Choice", + "label": "Fade-in easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "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" + ], + "hidden": false, + "name": "FadeInEasing" + }, + { + "value": "easeOutBounce", + "type": "Choice", + "label": "Fade-out easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "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" + ], + "hidden": false, + "name": "FadeOutEasing" + }, + { + "value": "Idle", + "type": "Choice", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "Idle", + "Focused", + "Pressed" + ], + "hidden": true, + "name": "PreviousState" + }, + { + "value": "true", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HasJustBeenCreated" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Smoothly change the opacity of buttons according to their state.", + "fullName": "Button opacity tween", + "name": "ButtonOpacityTween", + "objectType": "Sprite", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "Object", + "Opacity", + "=", + "Object.Behavior::PropertyIdleOpacity()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonOpacityTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "States", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsIdle" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonOpacityTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonOpacityTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonAngleTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyIdleOpacity()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsFocused" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonOpacityTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonOpacityTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonAngleTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFocusedOpacity()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonOpacityTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonOpacityTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonAngleTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFocusedOpacity()", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsPressed" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonOpacityTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonOpacityTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonAngleTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyPressedOpacity()", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonOpacityTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade in", + "functionType": "Action", + "name": "FadeIn", + "private": true, + "sentence": "_PARAM0_ fade in to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectOpacityTween" + }, + "parameters": [ + "Object", + "Tween", + "\"__ButtonOpacityTween.Fade\"", + "GetArgumentAsNumber(\"Value\")", + "Object.Behavior::PropertyFadeInEasing()", + "1000 * Object.Behavior::PropertyFadeInDuration()", + "no" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonOpacityTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade out", + "functionType": "Action", + "name": "FadeOut", + "private": true, + "sentence": "_PARAM0_ fade out to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectOpacityTween" + }, + "parameters": [ + "Object", + "Tween", + "\"__ButtonOpacityTween.Fade\"", + "GetArgumentAsNumber(\"Value\")", + "Object.Behavior::PropertyFadeOutEasing()", + "1000 * Object.Behavior::PropertyFadeOutDuration()", + "no" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonOpacityTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Button states", + "description": "", + "group": "", + "extraInformation": [ + "ButtonStates::ButtonFSM" + ], + "hidden": false, + "name": "ButtonFSM" + }, + { + "value": "", + "type": "Behavior", + "label": "Tween", + "description": "", + "group": "", + "extraInformation": [ + "Tween::TweenBehavior" + ], + "hidden": false, + "name": "Tween" + }, + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Fade-in duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "FadeInDuration" + }, + { + "value": "0.2", + "type": "Number", + "unit": "Second", + "label": "Fade-out duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "FadeOutDuration" + }, + { + "value": "200", + "type": "Number", + "unit": "Dimensionless", + "label": "Idle state opacity", + "description": "", + "group": "Opacity", + "extraInformation": [], + "hidden": false, + "name": "IdleOpacity" + }, + { + "value": "255", + "type": "Number", + "unit": "Dimensionless", + "label": "Focused state opacity", + "description": "", + "group": "Opacity", + "extraInformation": [], + "hidden": false, + "name": "FocusedOpacity" + }, + { + "value": "255", + "type": "Number", + "unit": "Dimensionless", + "label": "Pressed state opacity", + "description": "", + "group": "Opacity", + "extraInformation": [], + "hidden": false, + "name": "PressedOpacity" + }, + { + "value": "easeInOutQuad", + "type": "Choice", + "label": "Fade-in easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "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" + ], + "hidden": false, + "name": "FadeInEasing" + }, + { + "value": "easeInOutQuad", + "type": "Choice", + "label": "Fade-out easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "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" + ], + "hidden": false, + "name": "FadeOutEasing" + }, + { + "value": "Idle", + "type": "Choice", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "Idle", + "Focused", + "Pressed" + ], + "hidden": true, + "name": "PreviousState" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Smoothly change the color tint of buttons according to their state.", + "fullName": "Button color tint tween", + "name": "ButtonColorTintTween", + "objectType": "Sprite", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ChangeColor" + }, + "parameters": [ + "Object", + "Object.Behavior::PropertyIdleColorTint()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "States", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsIdle" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonAngleTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyIdleColorTint()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsFocused" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFocusedColorTint()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFocusedColorTint()", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsPressed" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyPressedColorTint()", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade in", + "functionType": "Action", + "name": "FadeIn", + "private": true, + "sentence": "_PARAM0_ fade in to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectColorTween" + }, + "parameters": [ + "Object", + "Tween", + "\"__ButtonColorTintTween.Fade\"", + "GetArgumentAsString(\"Value\")", + "Object.Behavior::PropertyFadeInEasing()", + "1000 * Object.Behavior::PropertyFadeInDuration()", + "no", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "color" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade out", + "functionType": "Action", + "name": "FadeOut", + "private": true, + "sentence": "_PARAM0_ fade out to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectColorTween" + }, + "parameters": [ + "Object", + "Tween", + "\"__ButtonColorTintTween.Fade\"", + "GetArgumentAsString(\"Value\")", + "Object.Behavior::PropertyFadeOutEasing()", + "1000 * Object.Behavior::PropertyFadeOutDuration()", + "no", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "color" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Button states", + "description": "", + "group": "", + "extraInformation": [ + "ButtonStates::ButtonFSM" + ], + "hidden": false, + "name": "ButtonFSM" + }, + { + "value": "", + "type": "Behavior", + "label": "Tween", + "description": "", + "group": "", + "extraInformation": [ + "Tween::TweenBehavior" + ], + "hidden": false, + "name": "Tween" + }, + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Fade-in duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "FadeInDuration" + }, + { + "value": "0.2", + "type": "Number", + "unit": "Second", + "label": "Fade-out duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "FadeOutDuration" + }, + { + "value": "255;255;255", + "type": "Color", + "label": "Idle state color tint", + "description": "", + "group": "Color", + "extraInformation": [], + "hidden": false, + "name": "IdleColorTint" + }, + { + "value": "192;192;192", + "type": "Color", + "label": "Focused state color tint", + "description": "", + "group": "Color", + "extraInformation": [], + "hidden": false, + "name": "FocusedColorTint" + }, + { + "value": "64;64;64", + "type": "Color", + "label": "Pressed state color tint", + "description": "", + "group": "Color", + "extraInformation": [], + "hidden": false, + "name": "PressedColorTint" + }, + { + "value": "easeInOutQuad", + "type": "Choice", + "label": "Fade-in easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "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" + ], + "hidden": false, + "name": "FadeInEasing" + }, + { + "value": "easeInOutQuad", + "type": "Choice", + "label": "Fade-out easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "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" + ], + "hidden": false, + "name": "FadeOutEasing" + }, + { + "value": "Idle", + "type": "Choice", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "Idle", + "Focused", + "Pressed" + ], + "hidden": true, + "name": "PreviousState" + } + ], + "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.0", + "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": [], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._shakeObjectExtension = gdjs._shakeObjectExtension || {};", + "", + "/** Noise generator manager. */", + "gdjs._shakeObjectExtension.NoiseManager = /** @class */ (function () {", + " /**", + " * Create the manager of noise generators.", + " */", + " function NoiseManager() {", + " this.seed = gdjs.randomInRange(1, Number.MAX_SAFE_INTEGER);", + " /** @type {Map} */", + " this.generators = new Map();", + " }", + "", + " /**", + " * @param name {string}", + " * @return {gdjs._shakeObjectExtension.NoiseGenerator}", + " */", + " NoiseManager.prototype.getGenerator = function (name) {", + " let generator = this.generators.get(name);", + " if (!generator) {", + " generator = new gdjs._shakeObjectExtension.NoiseGenerator(name + this.seed);", + " this.generators.set(name, generator);", + " }", + " return generator;", + " }", + "", + " /**", + " * @param seed {number}", + " */", + " NoiseManager.prototype.setSeed = function (seed) {", + " this.seed = seed;", + " this.generators.forEach(generator => generator.setSeed(seed));", + " }", + "", + " /**", + " * @param name {string}", + " */", + " NoiseManager.prototype.deleteGenerator = function (name) {", + " this.generators.delete(name);", + " }", + "", + " /**", + " */", + " NoiseManager.prototype.deleteAllGenerators = function () {", + " this.generators.clear();", + " }", + "", + " return NoiseManager;", + "}());", + "", + "/** Noise generator with octaves. */", + "gdjs._shakeObjectExtension.NoiseGenerator = /** @class */ (function () {", + " /**", + " * Create a noise generator with a seed.", + " * @param seed {string}", + " */", + " function NoiseGenerator(seed) {", + " this.simplexNoise = new gdjs._shakeObjectExtension.SimplexNoise(seed);", + " this.frequency = 1;", + " this.octaves = 1;", + " this.persistence = 0.5;", + " this.lacunarity = 2;", + " this.xLoopPeriod = 0;", + " this.yLoopPeriod = 0;", + " }", + "", + " /**", + " * @param seed {string}", + " */", + " NoiseGenerator.prototype.setSeed = function(seed) {", + " this.simplexNoise = new gdjs._shakeObjectExtension.SimplexNoise(seed);", + " }", + "", + " /**", + " * @param x {float}", + " * @param y {float}", + " * @param z {float} optionnal", + " * @param w {float} optionnal", + " * @return {float}", + " */", + " NoiseGenerator.prototype.noise = function (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;", + " }", + "", + " return NoiseGenerator;", + "}());", + "", + "/*", + "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]);", + "", + "/** Deterministic simplex noise generator suitable for 2D, 3D and 4D spaces. */", + "gdjs._shakeObjectExtension.SimplexNoise = /** @class */ (function () {", + " /**", + " * 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).", + " */", + " function SimplexNoise(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]", + " */", + " SimplexNoise.prototype.noise2D = function (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]", + " */", + " SimplexNoise.prototype.noise3D = function (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);", + " };", + "", + " /**", + " * 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", + " };", + " }", + " return SimplexNoise;", + "}());", + "", + "gdjs._shakeObjectExtension.noiseManager = new gdjs._shakeObjectExtension.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": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyIsStartingAtCreation" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "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": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyNoiseTime" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "TimeDelta() * Object.Behavior::Frequency()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::IsShaking" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetSharedPropertyEasingFactor" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "1" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTime" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "Object.Behavior::PropertyStartEasingDuration()" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTime" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "Object.Behavior::PropertyDuration() - Object.Behavior::PropertyStopEasingDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetSharedPropertyEasingFactor" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(0, 1, Object.Behavior::PropertyTime() / Object.Behavior::PropertyStartEasingDuration())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTime" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "Object.Behavior::PropertyDuration() - Object.Behavior::PropertyStopEasingDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetSharedPropertyEasingFactor" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(0, 1, (Object.Behavior::PropertyDuration() - Object.Behavior::PropertyTime()) / Object.Behavior::PropertyStopEasingDuration())" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ShakeObject3D::SetFrequency" + }, + "parameters": [ + "", + "Object.Behavior::PropertyFrequency()", + "\"\"", + "" + ] + } + ] + }, + { + "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": "ShakeObject3D::ShakeModel3D::PropertyTranslationAmplitudeX" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDeltaX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ShakeObject3D::Noise2d(\"\", Object.Behavior::PropertyNoiseTime(), 1000) * Object.Behavior::PropertyTranslationAmplitudeX() * Object.Behavior::SharedPropertyEasingFactor()" + ] + }, + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "+", + "Object.Behavior::PropertyDeltaX()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTranslationAmplitudeY" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDeltaY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ShakeObject3D::Noise2d(\"\", Object.Behavior::PropertyNoiseTime(), 2000) * Object.Behavior::PropertyTranslationAmplitudeY() * Object.Behavior::SharedPropertyEasingFactor()" + ] + }, + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "+", + "Object.Behavior::PropertyDeltaY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTranslationAmplitudeZ" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDeltaZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ShakeObject3D::Noise2d(\"\", Object.Behavior::PropertyNoiseTime(), 3000) * Object.Behavior::PropertyTranslationAmplitudeZ() * Object.Behavior::SharedPropertyEasingFactor()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "Object.Behavior::PropertyDeltaY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyRotationAmplitudeX" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDeltaAngleX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ShakeObject3D::Noise2d(\"\", Object.Behavior::PropertyNoiseTime(), 4000) * Object.Behavior::PropertyRotationAmplitudeX() * Object.Behavior::SharedPropertyEasingFactor()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "Object.Behavior::PropertyDeltaAngleX()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyRotationAmplitudeY" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDeltaAngleY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ShakeObject3D::Noise2d(\"\", Object.Behavior::PropertyNoiseTime(), 5000) * Object.Behavior::PropertyRotationAmplitudeY() * Object.Behavior::SharedPropertyEasingFactor()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "Object.Behavior::PropertyDeltaAngleY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyRotationAmplitudeZ" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDeltaAngleZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ShakeObject3D::Noise2d(\"\", Object.Behavior::PropertyNoiseTime(), 6000) * Object.Behavior::PropertyRotationAmplitudeZ() * Object.Behavior::SharedPropertyEasingFactor()" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "Object.Behavior::PropertyDeltaAngleZ()" + ] + } + ] + } + ] + } + ], + "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", + "-", + "Object.Behavior::PropertyDeltaX()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTranslationAmplitudeY" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "-", + "Object.Behavior::PropertyDeltaY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyTranslationAmplitudeZ" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Object", + "Object3D", + "-", + "Object.Behavior::PropertyDeltaZ()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyRotationAmplitudeX" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Object", + "Object3D", + "-", + "Object.Behavior::PropertyDeltaAngleX()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyRotationAmplitudeY" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "-", + "Object.Behavior::PropertyDeltaAngleY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::PropertyRotationAmplitudeZ" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "-", + "Object.Behavior::PropertyDeltaAngleZ()" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Shake the camera on layers chosen with configuration actions.", + "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() * Object.Behavior::Frequency()" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Duration\")" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyStartEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"StartEaseDuration\")" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyStopEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"StopEaseDuration\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"Duration\"", + "<", + "GetArgumentAsNumber(\"StartEaseDuration\") + GetArgumentAsNumber(\"StopEaseDuration\")" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyStartEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"StartEaseDuration\") * Variable(__CameraShake.Duration) / (GetArgumentAsNumber(\"StartEaseDuration\") + GetArgumentAsNumber(\"StopEaseDuration\"))" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyStopEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"StopEaseDuration\") * Variable(__CameraShake.Duration) / (GetArgumentAsNumber(\"StartEaseDuration\") + GetArgumentAsNumber(\"StopEaseDuration\"))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "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": "Start shaking the camera indefinitely.", + "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() * Object.Behavior::Frequency()" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "1234567890" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyStartEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"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 camera.", + "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", + "=", + "GetArgumentAsNumber(\"EaseDuration\")" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetPropertyStopEasingDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"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", + "<", + "Object.Behavior::PropertyDuration()" + ] + } + ], + "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": [ + "Object.Behavior::PropertyFrequency()" + ] + } + ] + } + ], + "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", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "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": [], + "hidden": false, + "name": "TranslationAmplitudeX" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Translation amplitude on Y axis", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "TranslationAmplitudeY" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Translation amplitude on Z axis", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "TranslationAmplitudeZ" + }, + { + "value": "5", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation amplitude around X axis", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "RotationAmplitudeX" + }, + { + "value": "5", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation amplitude around Y axis", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "RotationAmplitudeY" + }, + { + "value": "5", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation amplitude around Z axis", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "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": [], + "hidden": false, + "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" + ], + "hidden": false, + "name": "Object3D" + }, + { + "value": "", + "type": "Boolean", + "label": "Start to shake at the object creation", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "IsStartingAtCreation" + } + ], + "sharedPropertyDescriptors": [ + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "EasingFactor" + } + ] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "@4ian, Entropy, VegeTato", + "category": "", + "extensionNamespace": "", + "fullName": "Flash object", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWZsYXNoLW91dGxpbmUiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNywySDE3TDEzLjUsOUgxN0wxMCwyMlYxNEg3VjJNOSw0VjEySDEyVjE0LjY2TDE0LDExSDEwLjI0TDEzLjc2LDRIOVoiIC8+PC9zdmc+", + "name": "Flash", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/flash-outline.svg", + "shortDescription": "Make an object flash visibility (blink), color tint, object effect, or opacity (fade).", + "version": "1.1.1", + "description": [ + "Make an object flash for a period of time so that it alternates between two different states.", + "Includes the ability to flash visibility (blink), color tint, object effect, or opacity (fade).", + "", + "After adding a behavior to an object, you **trigger the effect** by using the **Flash action**.", + "", + "This can be used to:", + "- Let players know they are invincible after being hit", + "- Catch player attention on the interface (for instance a \"press start\" text)", + "" + ], + "origin": { + "identifier": "Flash", + "name": "gdevelop-extension-store" + }, + "tags": [ + "tween", + "flash", + "blink", + "visible", + "invisible", + "hit", + "damage", + "fade", + "effect", + "color", + "tint" + ], + "authorIds": [ + "wWP8BSlAW0UP4NeaHa2LcmmDzmH2", + "q8ubdigLvIRXLxsJDDTaokO41mc2", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Color tint applied to an object.", + "fullName": "Color tint applied to an object", + "functionType": "ExpressionAndCondition", + "name": "ColorTint", + "sentence": "Color tint applied to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Return the color string for the tint applied to the object" + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.SpriteRuntimeObject} */\r", + "const tintedObject = objects[0];\r", + "const tint = tintedObject.getColor();\r", + "eventsFunctionContext.returnValue = tint;" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "color" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a color tint is applied to an object.", + "fullName": "Is a color tint applied to an object", + "functionType": "StringExpression", + "name": "IsTinted", + "sentence": "_PARAM1_ is color tinted", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Flash::ColorTint" + }, + "parameters": [ + "", + "=", + "\"255;255;255\"", + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "expressionType": { + "type": "color" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Toggle an object effect.", + "fullName": "Toggle an object effect", + "functionType": "Action", + "name": "ToggleEffect", + "sentence": "Toggle effect _PARAM2_ on _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_EffectToggled", + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "IsEffectEnabled" + }, + "parameters": [ + "Object", + "GetArgumentAsString(\"EffectName\")" + ] + } + ], + "actions": [ + { + "type": { + "value": "EnableEffect" + }, + "parameters": [ + "Object", + "GetArgumentAsString(\"EffectName\")", + "" + ] + }, + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_EffectToggled", + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_EffectToggled", + "False" + ] + }, + { + "type": { + "inverted": true, + "value": "IsEffectEnabled" + }, + "parameters": [ + "Object", + "GetArgumentAsString(\"EffectName\")" + ] + } + ], + "actions": [ + { + "type": { + "value": "EnableEffect" + }, + "parameters": [ + "Object", + "GetArgumentAsString(\"EffectName\")", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Effect name to toggle", + "name": "EffectName", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Toggle color tint between the starting tint and a given value.", + "fullName": "Toggle a color tint", + "functionType": "Action", + "name": "ToggleColorTint", + "private": true, + "sentence": "Toggle color tint _PARAM2_ on _PARAM1_", + "events": [ + { + "colorB": 35, + "colorG": 166, + "colorR": 245, + "creationTime": 0, + "name": "Note: This function cannot be \"public\" until it properly handles objects without a starting color tint variable (NULL)", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Swap between the starting tint and the given value", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_ColorTintToggled", + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::ColorTint" + }, + "parameters": [ + "", + "=", + "Object.VariableString(__FlashColor_StartingTint)", + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ChangeColor" + }, + "parameters": [ + "Object", + "GetArgumentAsString(\"ColorTint\")" + ] + }, + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_ColorTintToggled", + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_ColorTintToggled", + "False" + ] + }, + { + "type": { + "inverted": true, + "value": "Flash::ColorTint" + }, + "parameters": [ + "", + "=", + "Object.VariableString(__FlashColor_StartingTint)", + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ChangeColor" + }, + "parameters": [ + "Object", + "Object.VariableString(__FlashColor_StartingTint)" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "objectList" + }, + { + "description": "Color tint", + "name": "ColorTint", + "type": "color" + } + ], + "objectGroups": [] + }, + { + "description": "Toggle object visibility.", + "fullName": "Toggle object visibility", + "functionType": "Action", + "name": "ToggleVisibility", + "sentence": "Toggle visibility of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_VisibilityToggled", + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Visible" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_VisibilityToggled", + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_VisibilityToggled", + "False" + ] + }, + { + "type": { + "inverted": true, + "value": "Visible" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Make the object flash (blink) for a period of time so it alternates between visible and invisible.", + "fullName": "Flash visibility (blink)", + "name": "Flash", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::Flash::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Alternate states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Timer\"", + ">", + "Object.Behavior::PropertyHalfPeriodTime()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::ToggleVisibility" + }, + "parameters": [ + "", + "Object", + "" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Timer\"" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Stop flashing", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::Flash::PropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Duration_Timer\"", + ">", + "Object.Behavior::PropertyFlashDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::Flash::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::Flash", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Make an object flash (blink) visibility for a period of time.", + "fullName": "Flash visibility (blink)", + "functionType": "Action", + "name": "Flash", + "sentence": "Make _PARAM0_ flash (blink) for _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Flash::Flash::IsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::ToggleVisibility" + }, + "parameters": [ + "", + "Object", + "" + ] + }, + { + "type": { + "value": "Flash::Flash::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Timer\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Duration_Timer\"" + ] + }, + { + "type": { + "value": "Flash::Flash::SetPropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"FlashDuration\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::Flash", + "type": "behavior" + }, + { + "description": "Duration of the flashing, in seconds", + "longDescription": "Use \"0\" to keep flashing until stopped.", + "name": "FlashDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if an object is flashing visibility.", + "fullName": "Is object flashing visibility", + "functionType": "Condition", + "name": "IsFlashing", + "sentence": "_PARAM0_ is flashing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::Flash::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::Flash", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Flash::Flash::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::Flash", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Stop flashing visibility (blink) of an object.", + "fullName": "Stop flashing visibility (blink)", + "functionType": "Action", + "name": "Stop", + "sentence": "Stop flashing visibility of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::Flash::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "Flash::Flash::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Timer\"" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Duration_Timer\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::Flash", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Half period (time during which object is invisible)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "HalfPeriodTime" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsFlashing" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Flash duration", + "description": "Use \"0\" to keep flashing until stopped", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "FlashDuration" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Make an object flash a color tint for a period of time.", + "fullName": "Flash color tint", + "name": "FlashColor", + "objectType": "Sprite", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashColor::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Alternate states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Timer\"", + ">", + "Object.Behavior::PropertyHalfPeriodTime()" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Timer\"" + ] + }, + { + "type": { + "value": "Flash::ToggleColorTint" + }, + "parameters": [ + "", + "Object", + "Object.Behavior::PropertyTintColor()", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Stop flashing", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashColor::PropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Duration_Timer\"", + ">", + "Object.Behavior::PropertyFlashDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashColor::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashColor", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Make an object flash a color tint for a period of time.", + "fullName": "Flash color tint", + "functionType": "Action", + "name": "Flash", + "sentence": "Make _PARAM0_ flash the color tint _PARAM3_ for _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Flash::FlashColor::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjetTxt" + }, + "parameters": [ + "Object", + "__FlashColor_StartingTint", + "=", + "Flash::ColorTint(Object)" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Timer\"" + ] + }, + { + "type": { + "value": "Flash::ToggleColorTint" + }, + "parameters": [ + "", + "Object", + "GetArgumentAsString(\"ColorTint\")", + "" + ] + }, + { + "type": { + "value": "Flash::FlashColor::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Duration_Timer\"" + ] + }, + { + "type": { + "value": "Flash::FlashColor::SetPropertyTintColor" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"ColorTint\")" + ] + }, + { + "type": { + "value": "Flash::FlashColor::SetPropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"FlashDuration\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashColor", + "type": "behavior" + }, + { + "description": "Duration of the flashing, in seconds", + "longDescription": "Use \"0\" to keep flashing until stopped.", + "name": "FlashDuration", + "type": "expression" + }, + { + "description": "Color tint", + "name": "ColorTint", + "type": "color" + } + ], + "objectGroups": [] + }, + { + "description": "Check if an object is flashing a color tint.", + "fullName": "Is object flashing a color tint", + "functionType": "Condition", + "name": "IsFlashing", + "sentence": "_PARAM0_ is flashing a color tint", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashColor::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashColor", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Flash::FlashColor::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashColor", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Stop flashing a color tint on an object.", + "fullName": "Stop flashing color tint", + "functionType": "Action", + "name": "Stop", + "sentence": "Stop flashing color tint _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashColor::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashColor::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "ChangeColor" + }, + "parameters": [ + "Object", + "Object.VariableString(__FlashColor_StartingTint)" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Timer\"" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Duration_Timer\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashColor", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Half period (time between flashes)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "HalfPeriodTime" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsFlashing" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Flash duration", + "description": "Use \"0\" to keep flashing until stopped", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "FlashDuration" + }, + { + "value": "\"255;255;255\"", + "type": "String", + "label": "Tint color", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TintColor" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Flash opacity smoothly (fade) in a repeating loop.", + "fullName": "Flash opacity smothly (fade)", + "name": "FlashOpacity", + "objectType": "Sprite", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashOpacity::IsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Alternate states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween::HasFinished" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectOpacityTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToStartingOpacity\"", + "Object.Behavior::PropertyStartingOpacity()", + "\"easeInOutCubic\"", + "1000 * Object.Behavior::PropertyHalfPeriodTime()", + "" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween::HasFinished" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToStartingOpacity\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectOpacityTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"", + "Object.Behavior::PropertyTargetOpacity()", + "\"easeInOutCubic\"", + "1000 * Object.Behavior::PropertyHalfPeriodTime()", + "" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToStartingOpacity\"" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Stop flashing", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashOpacity::PropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Opacity_Duration_Timer\"", + ">", + "Object.Behavior::PropertyFlashDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashOpacity::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashOpacity", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Make an object flash opacity smoothly (fade) in a repeating loop.", + "fullName": "Flash opacity (fade)", + "functionType": "Action", + "name": "Flash", + "sentence": "Make _PARAM0_ flash opacity smoothly to _PARAM4_ in a loop for _PARAM3_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Flash::FlashOpacity::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyStartingOpacity" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Opacity()" + ] + }, + { + "type": { + "value": "Tween::AddObjectOpacityTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"", + "GetArgumentAsNumber(\"TargetOpacity\")", + "\"easeInOutCubic\"", + "1000 * Object.Behavior::PropertyHalfPeriodTime()", + "" + ] + }, + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Opacity_Duration_Timer\"" + ] + }, + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"FlashDuration\")" + ] + }, + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyTargetOpacity" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"TargetOpacity\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashOpacity", + "type": "behavior" + }, + { + "description": "Tween behavior (required)", + "name": "TweenBehavior", + "supplementaryInformation": "Tween::TweenBehavior", + "type": "behavior" + }, + { + "description": "Duration of the flashing, in seconds", + "longDescription": "Use \"0\" to keep flashing until stopped.", + "name": "FlashDuration", + "type": "expression" + }, + { + "description": "Target opacity", + "name": "TargetOpacity", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if an object is flashing opacity.", + "fullName": "Is object flashing opacity", + "functionType": "Condition", + "name": "IsFlashing", + "sentence": "_PARAM0_ is flashing opacity", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashColor::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashOpacity", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Flash::FlashOpacity::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashOpacity", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Stop flashing opacity of an object.", + "fullName": "Stop flashing opacity", + "functionType": "Action", + "name": "Stop", + "sentence": "Stop flashing opacity of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashOpacity::IsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Duration_Timer\"" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToStartingOpacity\"" + ] + }, + { + "type": { + "value": "Opacity" + }, + "parameters": [ + "Object", + "=", + "Object.Behavior::PropertyStartingOpacity()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashOpacity", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Tween Behavior (required)", + "description": "", + "group": "", + "extraInformation": [ + "Tween::TweenBehavior" + ], + "hidden": false, + "name": "TweenBehavior" + }, + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Half period (time between flashes), in seconds", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "HalfPeriodTime" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsFlashing" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Flash duration", + "description": "Use \"0\" to keep flashing until stopped", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "FlashDuration" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "Target opacity (Range: 0 - 255)", + "description": "Opacity will fade between the starting value and a target value", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TargetOpacity" + }, + { + "value": "", + "type": "Number", + "unit": "Dimensionless", + "label": "Starting opacity", + "description": "Opacity will fade between the starting value and a target value", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "StartingOpacity" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Make the object flash an effect for a period of time.", + "fullName": "Flash effect", + "name": "FlashEffect", + "objectType": "Sprite", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashEffect::IsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Alternate states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Timer\"", + ">", + "Object.Behavior::PropertyHalfPeriodTime()" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Timer\"" + ] + }, + { + "type": { + "value": "Flash::ToggleEffect" + }, + "parameters": [ + "", + "Object", + "Object.Behavior::PropertyEffectName()", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Stop flashing", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashEffect::PropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Duration_Timer\"", + ">", + "Object.Behavior::PropertyFlashDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashEffect::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashEffect", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Make an object flash an effect for a period of time.", + "fullName": "Flash effect", + "functionType": "Action", + "name": "Flash", + "sentence": "Make _PARAM0_ flash the effect _PARAM3_ for _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Stop flashing existing effects if the effect name changed" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashEffect::IsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "Flash::FlashEffect::PropertyEffectName" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "GetArgumentAsString(\"EffectName\")" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashEffect::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Flash::FlashEffect::IsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "IsEffectEnabled" + }, + "parameters": [ + "Object", + "GetArgumentAsString(\"EffectName\")" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__FlashColor_StartingState", + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "IsEffectEnabled" + }, + "parameters": [ + "Object", + "GetArgumentAsString(\"EffectName\")" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__FlashColor_StartingState", + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Flash::ToggleEffect" + }, + "parameters": [ + "", + "Object", + "GetArgumentAsString(\"EffectName\")", + "" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Timer\"" + ] + }, + { + "type": { + "value": "Flash::FlashEffect::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Duration_Timer\"" + ] + }, + { + "type": { + "value": "Flash::FlashEffect::SetPropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"FlashDuration\")" + ] + }, + { + "type": { + "value": "Flash::FlashEffect::SetPropertyEffectName" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"EffectName\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashEffect", + "type": "behavior" + }, + { + "description": "Duration of the flashing, in seconds", + "longDescription": "Use \"0\" to keep flashing until stopped.", + "name": "FlashDuration", + "type": "expression" + }, + { + "description": "Name of effect", + "name": "EffectName", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Check if an object is flashing an effect.", + "fullName": "Is object flashing an effect", + "functionType": "Condition", + "name": "IsFlashing", + "sentence": "_PARAM0_ is flashing an effect", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashEffect::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashEffect", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Flash::FlashEffect::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashEffect", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Stop flashing an effect of an object.", + "fullName": "Stop flashing an effect", + "functionType": "Action", + "name": "Stop", + "sentence": "Stop flashing an effect on _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashColor::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashEffect::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Timer\"" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Duration_Timer\"" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__FlashEffect_StartingState", + "True" + ] + } + ], + "actions": [ + { + "type": { + "value": "EnableEffect" + }, + "parameters": [ + "Object", + "Object.Behavior::PropertyEffectName()", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__FlashEffect_StartingState", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "EnableEffect" + }, + "parameters": [ + "Object", + "Object.Behavior::PropertyEffectName()", + "" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashEffect", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Half period (time between flashes), in seconds", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "HalfPeriodTime" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsFlashing" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Flash duration", + "description": "Use \"0\" to keep flashing until stopped", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "FlashDuration" + }, + { + "value": "", + "type": "String", + "label": "Name of effect", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "EffectName" + } + ], + "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.4.0", + "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": [], + "eventsFunctions": [ + { + "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, stickerBehaviorName) => {", + " const behavior = stickerObject.getBehavior(stickerBehaviorName);", + " return behavior.basisObject === basisObject;", + " },", + " stickerObjectsLists,", + " basisObjectsLists,", + " false,", + " stickerBehaviorName", + ");" + ], + "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::JsCode", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const object = objects[0];", + "const behavior = object.getBehavior(behaviorName);", + "", + "// Set up the scene sticker objects list - if not done already.", + "runtimeScene.__allStickers = runtimeScene.__allStickers || new Set();", + "", + "// Set up the behavior extra methods - if not done already.", + "const prototype = Object.getPrototypeOf(behavior);", + "if (!prototype.updateRelativeCoordinates) {", + " // Unstick from deleted objects.", + " gdjs.registerObjectDeletedFromSceneCallback(function (runtimeScene, deletedObject) {", + " const allStickers = runtimeScene.__allStickers;", + " if (!allStickers) return;", + "", + " for (const sticker of allStickers) {", + " if (sticker.basisObject === deletedObject) {", + " if (sticker._getIsDestroyedWithParent()) {", + " sticker.owner.deleteFromScene(runtimeScene);", + " }", + " sticker.basisObject = null;", + " }", + " }", + " });", + "", + " /**", + " * 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", + " */", + " prototype.updateRelativeCoordinates = function (basisObject) {", + " const object = this.owner;", + "", + " // Update relative coordinates", + " this.relativeX = object.getX() - this.basisOldX;", + " this.relativeY = object.getY() - this.basisOldY;", + " if (!this._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 = basisObject.getWidth();", + " this.basisOriginalHeight = basisObject.getHeight();", + " this.basisOriginalAngle = basisObject.getAngle();", + " }", + " }", + "", + " /**", + " * Copy the coordinates to use it the next frame.", + " * @param basisObject {gdjs.RuntimeObject}", + " */", + " prototype.updateOldCoordinates = function (basisObject) {", + " const object = this.owner;", + "", + " this.ownerOldX = object.getX();", + " this.ownerOldY = object.getY();", + "", + " this.basisOldX = basisObject.getX();", + " this.basisOldY = basisObject.getY();", + "", + " if (!this._getOnlyFollowPosition()) {", + " this.ownerOldAngle = object.getAngle();", + " this.ownerOldWidth = object.getWidth();", + " this.ownerOldHeight = object.getHeight();", + "", + " this.basisOldAngle = basisObject.getAngle();", + " this.basisOldWidth = basisObject.getWidth();", + " this.basisOldHeight = basisObject.getHeight();", + " this.basisOldCenterXInScene = basisObject.getCenterXInScene();", + " this.basisOldCenterYInScene = basisObject.getCenterYInScene();", + " }", + " }", + " /**", + " * Follow the basisObject (called in doStepPostEvents).", + " * ", + " * This method is also called by children to ensure", + " * parents are updated first.", + " */", + " prototype.followBasisObject = function () {", + " if (this.followingDoneThisFrame) {", + " return;", + " }", + " this.followingDoneThisFrame = true;", + " /** @type {gdjs.RuntimeObject} */", + " 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.", + " if (basisObject.hasBehavior(behaviorName)) {", + " const basisBehavior = basisObject.getBehavior(behaviorName);", + " if (basisBehavior.type === this.type) {", + " // Follow parents 1st to avoid frame delays", + " basisBehavior.followBasisObject();", + " }", + " }", + "", + " const object = this.owner;", + "", + " if (this._getOnlyFollowPosition()) {", + " if (object.getX() !== this.ownerOldX", + " || object.getY() !== this.ownerOldY) {", + " this.updateRelativeCoordinates(basisObject);", + " }", + "", + " 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(basisObject);", + " }", + "", + " // 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.setPosition(", + " basisObject.getX() + this.relativeRotatedX * basisObject.getWidth(),", + " basisObject.getY() + 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(basisObject);", + " }", + " }", + "}", + "", + "// Register this object as a sticker.", + "runtimeScene.__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.followingDoneThisFrame = false;" + ], + "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.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;", + "const basisObject = basisObjects[0];", + "", + "const behavior = object.getBehavior(behaviorName);", + "", + "behavior.basisObject = basisObject;", + "behavior.updateOldCoordinates(basisObject);", + "behavior.updateRelativeCoordinates(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);", + "", + "behavior.basisObject = null;" + ], + "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);", + "", + "if (runtimeScene.__allStickers)", + " runtimeScene.__allStickers.delete(behavior);", + "" + ], + "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": [], + "hidden": false, + "name": "OnlyFollowPosition" + }, + { + "value": "", + "type": "Boolean", + "label": "Destroy when the object it's stuck on is destroyed", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "IsDestroyedWithParent" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Visual effect", + "extensionNamespace": "", + "fullName": "3D tween (experimental)", + "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 animate scale and rotation of 3d models.", + "version": "0.0.2", + "description": "Change models proportions and orientation over time to make smooth animations.", + "origin": { + "identifier": "Tween3D", + "name": "gdevelop-extension-store" + }, + "tags": [ + "3d", + "tween", + "smooth", + "interpolation", + "wobble" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "the stretch on Z axis. The object volume is conseved. A stretch of 2 make the object apear 2 time longer on Z in proportion to the dimension 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": [] + }, + { + "description": "Change the stretch on Z axis. The object volume is conseved. A stretch of 2 make the object apear 2 time longer on Z in proportion to the dimension on X and Y.", + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "StretchZ", + "name": "SetStretchZ", + "private": true, + "sentence": "Change the stretch on Z axis of ", + "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 conseved. A stretch of 2 make the object apear 2 time longer on Y in proportion to the dimension 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": [] + }, + { + "description": "Change the stretch on Z axis. The object volume is conseved. A stretch of 2 make the object apear 2 time longer on Z in proportion to the dimension on X and Y.", + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "StretchY", + "name": "SetStretchY", + "private": true, + "sentence": "Change the stretch on Z axis of ", + "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": [] + }, + { + "description": "Change the stretch on Z axis. The object volume is conseved. A stretch of 2 make the object apear 2 time longer on Z in proportion to the dimension on X and Y.", + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "ScaleVolume", + "name": "SetScaleVolume", + "private": true, + "sentence": "Change the stretch on Z axis of ", + "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 animate scale and rotation of 3d models.", + "fullName": "3D tween (experimental)", + "name": "Tween3D", + "objectType": "", + "eventsFunctions": [ + { + "description": "the stretch on Z axis. The object volume is conseved. A stretch of 2 make the object apear 2 time longer on Z in proportion to the dimension 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": [] + }, + { + "description": "Change the stretch on Z axis. The object volume is conseved. A stretch of 2 make the object apear 2 time longer on Z in proportion to the dimension on X and Y.", + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "StretchZ", + "name": "SetStretchZ", + "sentence": "Change the stretch on Z axis of ", + "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 conseved. A stretch of 2 make the object apear 2 time longer on Y in proportion to the dimension 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": [] + }, + { + "description": "Change the stretch on Z axis. The object volume is conseved. A stretch of 2 make the object apear 2 time longer on Z in proportion to the dimension on X and Y.", + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "StretchY", + "name": "SetStretchY", + "sentence": "Change the stretch on Z axis of ", + "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": [] + }, + { + "description": "Change the stretch on Z axis. The object volume is conseved. A stretch of 2 make the object apear 2 time longer on Z in proportion to the dimension on X and Y.", + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "ScaleVolume", + "name": "SetScaleVolume", + "sentence": "Change the stretch on Z axis of ", + "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": "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 object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with _PARAM5_ easing 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 object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with _PARAM5_ easing 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 object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with _PARAM5_ easing 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 an object rotation X from its current value to a new one.", + "fullName": "Tween rotation X", + "functionType": "Action", + "group": "Angle", + "name": "TweenRotationX", + "sentence": "Tween the rotation X of object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with _PARAM5_ easing as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::StartTween" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsNumber(\"Duration\")", + "GetArgumentAsString(\"Easing\")", + "\"RotationX\"", + "" + ] + } + ] + } + ], + "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 rotation Y from its current value to a new one.", + "fullName": "Tween rotation Y", + "functionType": "Action", + "group": "Angle", + "name": "TweenRotationY", + "sentence": "Tween the rotation Y of object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with _PARAM5_ easing as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::StartTween" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsNumber(\"Duration\")", + "GetArgumentAsString(\"Easing\")", + "\"RotationY\"", + "" + ] + } + ] + } + ], + "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", + "=", + "\"RotationX\"", + "VariableString(_Tween3D.Identifier)", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "Object.Behavior::TweenedValue(VariableString(_Tween3D.Identifier))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Type" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RotationY\"", + "VariableString(_Tween3D.Identifier)", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "Object.Behavior::TweenedValue(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 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", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::InvalidateTweenIdentifiers" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::SetType" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"Type\")", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::SetDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Duration\")", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::SetEasing" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"Easing\")", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::SetTargetedValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Type\"", + "=", + "\"StretchZ\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::StretchZ()", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Type\"", + "=", + "\"StretchY\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::StretchY()", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Type\"", + "=", + "\"ScaleVolume\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::ScaleVolume()", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Type\"", + "=", + "\"RotationX\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Object3D::RotationX()", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Type\"", + "=", + "\"RotationY\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Object3D::RotationY()", + "GetArgumentAsString(\"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[GetArgumentAsString(\"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[GetArgumentAsString(\"TweenIdentifier\")].InitialValue", + "=", + "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 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[GetArgumentAsString(\"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": [] + }, + { + "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": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "TargetedValue", + "name": "SetTargetedValue", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].TargetedValue", + "=", + "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": "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" + ], + "hidden": false, + "name": "Object3D" + }, + { + "value": "", + "type": "Behavior", + "label": "Scalable capacity", + "description": "", + "group": "", + "extraInformation": [ + "ScalableCapability::ScalableBehavior" + ], + "hidden": false, + "name": "Scale" + } + ], + "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": [], + "hidden": false, + "name": "ScaleMin" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Maximum scale volume", + "description": "", + "group": "Scale", + "extraInformation": [], + "hidden": false, + "name": "ScaleMax" + }, + { + "value": "1", + "type": "Number", + "unit": "Second", + "label": "Cycle duration", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "PeriodDuration" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Scale cycle offset", + "description": "", + "group": "Scale", + "extraInformation": [], + "hidden": false, + "name": "ScalePeriodOffset" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Minimum stretch", + "description": "", + "group": "Stretch", + "extraInformation": [], + "hidden": false, + "name": "StretchMin" + }, + { + "value": "1.25", + "type": "Number", + "unit": "Dimensionless", + "label": "Maximum stretch", + "description": "", + "group": "Stretch", + "extraInformation": [], + "hidden": false, + "name": "StretchMax" + }, + { + "value": "-0.25", + "type": "Number", + "unit": "Second", + "label": "Stretch cycle offset", + "description": "", + "group": "Stretch", + "extraInformation": [], + "hidden": false, + "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-" + ], + "hidden": false, + "name": "Top" + }, + { + "value": "", + "type": "Behavior", + "label": "3D tween", + "description": "", + "group": "", + "extraInformation": [ + "Tween3D::Tween3D" + ], + "hidden": false, + "name": "Tween3D" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Visual effect", + "extensionNamespace": "", + "fullName": "3D particle emitter (experimental)", + "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": "1.1.0", + "description": [ + "Particle emitters can be used to display:", + "- Fire", + "- Smoke", + "- Splashes", + "- Lights", + "", + "Breaking change from 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": [], + "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::Standard", + "conditions": [ + { + "type": { + "value": "GlobalVariableAsBoolean" + }, + "parameters": [ + "_ParticleEmmiter3DExtension_ClassesDefined", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetGlobalVariableAsBoolean" + }, + "parameters": [ + "_ParticleEmmiter3DExtension_ClassesDefined", + "True" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs.__particleEmmiter3DExtension = gdjs.__particleEmmiter3DExtension || {};", + "", + "/**", + " * @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.a);", + " }", + "", + " /**", + " * @param endColor {string}", + " */", + " setEndColor(endColor) {", + " setThreeColor(endColor, this.colorOverLife.color.b);", + " }", + "", + " /**", + " * @param startOpacity {number}", + " */", + " setStartOpacity(startOpacity) {", + " setThreeOpacity(startOpacity, this.colorOverLife.color.a);", + " }", + "", + " /**", + " * @param endOpacity {number}", + " */", + " setEndOpacity(endOpacity) {", + " setThreeOpacity(endOpacity, this.colorOverLife.color.b);", + " }", + "", + " /**", + " * @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;", + " }", + " }", + "}", + "", + "gdjs.__particleEmmiter3DExtension.ParticleEmitterAdapter = ParticleEmitterAdapter;", + "", + "/**", + " * three.quarks v0.10.3 build Fri Jul 28 2023", + " * https://github.com/Alchemist0823/three.quarks#readme", + " * Copyright 2023 Alchemist0823 , MIT", + " */", + "class ParticleEmitter extends THREE.Object3D {", + " //interleavedBuffer: InterleavedBuffer;", + " constructor(system) {", + " super();", + " this.type = \"ParticleEmitter\";", + " this.system = system;", + " // this.visible = false;", + " // TODO: implement boundingVolume", + " }", + " clone() {", + " const system = this.system.clone();", + " system.emitter.copy(this, true);", + " return system.emitter;", + " }", + " dispose() {", + " }", + " // extract data from the cache hash", + " // remove metadata on each item", + " // and return as array", + " extractFromCache(cache) {", + " const values = [];", + " for (const key in cache) {", + " const data = cache[key];", + " delete data.metadata;", + " values.push(data);", + " }", + " return values;", + " }", + " toJSON(meta, options = {}) {", + " // meta is a string when called from JSON.stringify", + " const isRootObject = (meta === undefined || typeof meta === 'string');", + " const output = {};", + " // meta is a hash used to collect geometries, materials.", + " // not providing it implies that this is the root object", + " // being serialized.", + " if (isRootObject) {", + " // initialize meta obj", + " meta = {", + " geometries: {},", + " materials: {},", + " textures: {},", + " images: {},", + " shapes: {},", + " skeletons: {},", + " animations: {},", + " nodes: {}", + " };", + " output.metadata = {", + " version: 4.5,", + " type: 'Object',", + " generator: 'Object3D.toJSON'", + " };", + " }", + " // standard Object3D serialization", + " 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;", + " // object specific properties", + " // eslint-disable-next-line @typescript-eslint/no-non-null-assertion", + " 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) {", + " // eslint-disable-next-line @typescript-eslint/no-non-null-assertion", + " const geometries = this.extractFromCache(meta.geometries);", + " // eslint-disable-next-line @typescript-eslint/no-non-null-assertion", + " const materials = this.extractFromCache(meta.materials);", + " // eslint-disable-next-line @typescript-eslint/no-non-null-assertion", + " const textures = this.extractFromCache(meta.textures);", + " // eslint-disable-next-line @typescript-eslint/no-non-null-assertion", + " 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;", + " }", + " /**", + " * remove at head in O(1)", + " */", + " 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;", + " }", + " /**", + " * remove at tail in O(1)", + " */", + " 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;", + " }", + " /**", + " * add at head in O(1)", + " */", + " 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++;", + " }", + " /**", + " * add at tail in O(1)", + " */", + " 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--;", + " }", + " }", + " /**", + " * Returns an iterator over the values", + " */", + " *values() {", + " let current = this.head;", + " while (current !== null) {", + " yield current.data;", + " current = current.next;", + " }", + " }", + "}", + "", + "class SpriteParticle {", + " constructor() {", + " // CPU", + " 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;", + " // GPU", + " 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;", + " // GPU", + " this.color = new THREE.Vector4();", + " // use link list instead", + " 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 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 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;", + " }", + " // get the coefficients of the polynomial's derivatives", + " 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;", + " }", + " // calculate the slope", + " 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];", + " //return a * (p[1] - p[0]) * 3 + b * (p[2] - p[1]) * 3 + c * (p[3] - p[2]) * 3;", + " }", + " // derivative(0) = (p[1] - p[0]) * 3", + " // derivative(1) = (p[3] - p[2]) * 3", + " 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];", + " // we lerp between all points at each iteration, until we have 1 point left.", + " 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) {", + " // no shortcut: use \"de Casteljau\" iteration.", + " 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);", + " }", + "}", + "", + "class PiecewiseBezier extends PiecewiseFunction {", + " // default linear bezier", + " 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);", + " }", + "}", + "", + "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);", + "};", + "", + "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 = \"function\";", + " }", + " genColor(color, t) {", + " return color.copy(this.a).lerp(this.b, t);", + " }", + " 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 Gradient extends PiecewiseFunction {", + " // default linear bezier", + " constructor(functions = [[new ColorRange(new THREE.Vector4(0, 0, 0, 1), new THREE.Vector4(1, 1, 1, 1)), 0]]) {", + " super();", + " this.type = \"function\";", + " this.functions = functions;", + " }", + " genColor(color, t) {", + " const index = this.findFunction(t);", + " if (index === -1) {", + " return color.copy(this.functions[0][0].a);", + " }", + " return this.getFunction(index).genColor(color, (t - this.getStartX(index)) / (this.getEndX(index) - this.getStartX(index)));", + " }", + " toJSON() {", + " return {", + " type: \"Gradient\",", + " functions: this.functions.map(([range, start]) => ({ function: range.toJSON(), start: start })),", + " };", + " }", + " static fromJSON(json) {", + " return new Gradient(json.functions.map((piecewiseFunction) => ([ColorRange.fromJSON(piecewiseFunction.function), piecewiseFunction.start])));", + " }", + " clone() {", + " return new Gradient(this.functions.map(([range, start]) => ([range.clone(), start])));", + " }", + "}", + "", + "const tempColor = new THREE.Vector4();", + "// generate a random color from the start two gradients", + "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);", + " color.lerp(tempColor, memory.rand);", + " 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 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) {", + " // eslint-disable-next-line @typescript-eslint/no-non-null-assertion", + " 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(json.axis, ValueGeneratorFromJSON(json.angle));", + " }", + " clone() {", + " return new AxisAngleGenerator(this.axis.clone(), this.angle.clone());", + " }", + "}", + "", + "class EulerGenerator {", + " constructor(angleX, angleY, angleZ) {", + " this.angleX = angleX;", + " this.angleY = angleY;", + " this.angleZ = angleZ;", + " this.type = \"rotation\";", + " }", + " genValue(quat, t) {", + " // eslint-disable-next-line @typescript-eslint/no-non-null-assertion", + " return quat.setFromEuler(new THREE.Euler(this.angleX.genValue(t), this.angleY.genValue(t), this.angleZ.genValue(t)));", + " }", + " toJSON() {", + " return {", + " type: \"Euler\",", + " angleX: this.angleX.toJSON(),", + " angleY: this.angleY.toJSON(),", + " angleZ: this.angleZ.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new EulerGenerator(ValueGeneratorFromJSON(json.angleX), ValueGeneratorFromJSON(json.angleY), ValueGeneratorFromJSON(json.angleZ));", + " }", + " clone() {", + " return new EulerGenerator(this.angleX, this.angleY, this.angleZ);", + " }", + "}", + "", + "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, dynamic) {", + " this.angularVelocity = angularVelocity;", + " this.dynamic = dynamic;", + " this.type = 'RotationOverLife';", + " this.tempQuat = new THREE.Quaternion();", + " }", + " initialize(particle) {", + " if (!this.dynamic && particle instanceof SpriteParticle) {", + " particle.angularVelocity = this.angularVelocity.genValue();", + " }", + " }", + " update(particle, delta) {", + " if (!this.dynamic) {", + " if (particle instanceof SpriteParticle) {", + " particle.rotation += delta * particle.angularVelocity;", + " }", + " }", + " else {", + " particle.rotation += delta * this.angularVelocity.genValue(particle.age / particle.life);", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " angularVelocity: this.angularVelocity.toJSON(),", + " dynamic: this.dynamic,", + " };", + " }", + " static fromJSON(json) {", + " return new RotationOverLife(ValueGeneratorFromJSON(json.angularVelocity), json.dynamic);", + " }", + " frameUpdate(delta) {", + " }", + " clone() {", + " return new RotationOverLife(this.angularVelocity.clone(), this.dynamic);", + " }", + " 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.velocity.normalize().multiplyScalar(particle.startSpeed * 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) {", + " }", + " update(particle, delta) {", + " particle.uvTile = Math.floor(this.frame.genValue(particle.age / particle.life));", + " }", + " 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 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() {", + " }", + "}", + "", + "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() {", + " }", + "}", + "", + "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);", + "class EmitSubParticleSystem {", + " constructor(particleSystem, useVelocityAsBasis, subParticleSystem) {", + " this.particleSystem = particleSystem;", + " this.useVelocityAsBasis = useVelocityAsBasis;", + " this.subParticleSystem = subParticleSystem;", + " this.type = \"EmitSubParticleSystem\";", + " //private matrix_ = new Matrix4();", + " this.q_ = new THREE.Quaternion();", + " this.v_ = new THREE.Vector3();", + " this.v2_ = new THREE.Vector3();", + " if (this.subParticleSystem && this.subParticleSystem.system) {", + " this.subParticleSystem.system.onlyUsedByOther = true;", + " }", + " }", + " initialize(particle) {", + " particle.emissionState = {", + " burstIndex: 0,", + " burstWaveIndex: 0,", + " time: 0,", + " waitEmiting: 0,", + " matrix: new THREE.Matrix4(),", + " };", + " }", + " update(particle, delta) {", + " if (!this.subParticleSystem || !particle.emissionState)", + " return;", + " const m = particle.emissionState.matrix;", + " 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);", + " }", + " this.subParticleSystem.system.emit(delta, particle.emissionState, m);", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " subParticleSystem: this.subParticleSystem ? this.subParticleSystem.uuid : \"\",", + " useVelocityAsBasis: this.useVelocityAsBasis", + " };", + " }", + " static fromJSON(json, particleSystem) {", + " return new EmitSubParticleSystem(particleSystem, json.useVelocityAsBasis, json.subParticleSystem);", + " }", + " clone() {", + " return new EmitSubParticleSystem(this.particleSystem, this.useVelocityAsBasis, this.subParticleSystem);", + " }", + " reset() {", + " }", + "}", + "", + "/*", + " * A fast javascript implementation of simplex noise by Jonas Wagner", + "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]);", + "/** 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 randomOrSeed A random number generator or a seed (string|number).", + " * Defaults to Math.random (random irreproducible initialization).", + " */", + " 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;", + " }", + " }", + " /**", + " * Samples the noise field in 2 dimensions", + " * @param x", + " * @param 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 x", + " * @param y", + " * @param 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);", + " }", + "}", + "/**", + " * Builds a random permutation table.", + " * This is exported only for (internal) testing purposes.", + " * Do not rely on this export.", + " * @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.", + "*/", + "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", + " };", + "}", + "", + "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() {", + " }", + "}", + "", + "const IdentityQuaternion = new THREE.Quaternion();", + "class Rotation3DOverLife {", + " constructor(angularVelocity, dynamic) {", + " this.angularVelocity = angularVelocity;", + " this.dynamic = dynamic;", + " this.type = 'Rotation3DOverLife';", + " this.tempQuat = new THREE.Quaternion();", + " }", + " initialize(particle) {", + " if (!this.dynamic && particle instanceof SpriteParticle) {", + " particle.angularVelocity = new THREE.Quaternion();", + " this.angularVelocity.genValue(particle.angularVelocity);", + " }", + " }", + " update(particle, delta) {", + " if (!this.dynamic) {", + " if (particle instanceof SpriteParticle) {", + " 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(),", + " dynamic: this.dynamic,", + " };", + " }", + " static fromJSON(json) {", + " return new Rotation3DOverLife(RotationGeneratorFromJSON(json.angularVelocity), json.dynamic);", + " }", + " frameUpdate(delta) {", + " }", + " clone() {", + " return new Rotation3DOverLife(this.angularVelocity.clone(), this.dynamic);", + " }", + " 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) {", + " 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.add(this._temp);", + " }", + " 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 Noise {", + " constructor(frequency, power) {", + " this.frequency = frequency;", + " this.power = power;", + " this.type = 'Noise';", + " this.generator = new SimplexNoise();", + " this.duration = 0;", + " this.temp = new THREE.Vector3();", + " }", + " initialize(particle) {", + " particle.startTime = this.duration;", + " }", + " update(particle, delta) {", + " this.temp.set(this.generator.noise2D(particle.startTime * this.frequency.x, particle.life / particle.age * this.frequency.x), this.generator.noise2D(particle.startTime * this.frequency.y + 100.25, particle.life / particle.age * this.frequency.y + 100.154), this.generator.noise2D(particle.startTime * this.frequency.z + 200.89, particle.life / particle.age * this.frequency.z + 200.1)).multiply(this.power);", + " particle.position.addScaledVector(this.temp, delta);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " frequency: [this.frequency.x, this.frequency.y, this.frequency.z],", + " power: [this.power.x, this.power.y, this.power.z],", + " };", + " }", + " frameUpdate(delta) {", + " this.duration += delta;", + " }", + " static fromJSON(json) {", + " return new Noise(new THREE.Vector3(json.frequency[0], json.frequency[1], json.frequency[2]), new THREE.Vector3(json.power[0], json.power[1], json.power[2]));", + " }", + " clone() {", + " return new Noise(this.frequency.clone(), this.power.clone());", + " }", + " reset() {", + " }", + "}", + "", + "const BehaviorTypes = {", + " \"ApplyForce\": { type: \"ApplyForce\", constructor: ApplyForce, params: [[\"direction\", \"vec3\"], [\"magnitude\", \"value\"]], loadJSON: ApplyForce.fromJSON },", + " \"Noise\": { type: \"Noise\", constructor: Noise, params: [[\"frequency\", \"vec3\"], [\"power\", \"vec3\"]], 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\"], [\"dynamic\", \"boolean\"]], loadJSON: RotationOverLife.fromJSON },", + " \"Rotation3DOverLife\": { type: \"Rotation3DOverLife\", constructor: Rotation3DOverLife, params: [[\"angularVelocity\", \"rotationFunc\"], [\"dynamic\", \"boolean\"]], loadJSON: Rotation3DOverLife.fromJSON },", + " \"SizeOverLife\": { type: \"SizeOverLife\", constructor: SizeOverLife, params: [[\"size\", \"valueFunc\"]], loadJSON: SizeOverLife.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\"]], loadJSON: EmitSubParticleSystem.fromJSON },", + "};", + "function BehaviorFromJSON(json, particleSystem) {", + " return BehaviorTypes[json.type].loadJSON(json, particleSystem);", + "}", + "", + "class ConeEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d;", + " this.type = \"cone\";", + " 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;", + " }", + " initialize(p) {", + " const u = Math.random();", + " 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);", + " //const v = Math.random();", + " p.position.multiplyScalar(this.radius);", + " }", + " toJSON() {", + " return {", + " type: \"cone\",", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " angle: this.angle,", + " };", + " }", + " static fromJSON(json) {", + " return new ConeEmitter(json);", + " }", + " clone() {", + " return new ConeEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " angle: this.angle,", + " });", + " }", + "}", + "", + "class DonutEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d;", + " this.type = \"donut\";", + " 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;", + " }", + " initialize(p) {", + " const u = Math.random();", + " const rand = THREE.MathUtils.lerp(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);", + " //const v = Math.random();", + " p.position.multiplyScalar(this.radius);", + " }", + " toJSON() {", + " return {", + " type: \"donut\",", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " angle: this.angle", + " };", + " }", + " static fromJSON(json) {", + " return new DonutEmitter(json);", + " }", + " clone() {", + " return new DonutEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " angle: this.angle,", + " });", + " }", + "}", + "", + "class PointEmitter {", + " constructor() {", + " this.type = \"point\";", + " }", + " 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;", + " this.type = \"sphere\";", + " 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;", + " }", + " initialize(p) {", + " const u = Math.random();", + " 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 r = Math.cbrt(rand);", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " const sinPhi = Math.sin(phi);", + " const cosPhi = Math.cos(phi);", + " p.position.x = r * sinPhi * cosTheta;", + " p.position.y = r * sinPhi * sinTheta;", + " p.position.z = r * cosPhi;", + " p.velocity.setScalar(0).addScaledVector(p.position, p.startSpeed);", + " p.position.multiplyScalar(this.radius);", + " }", + " toJSON() {", + " return {", + " type: \"sphere\",", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " };", + " }", + " static fromJSON(json) {", + " return new SphereEmitter(json);", + " }", + " clone() {", + " return new SphereEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " });", + " }", + "}", + "", + "class MeshSurfaceEmitter {", + " get geometry() {", + " return this._geometry;", + " }", + " set geometry(geometry) {", + " this._geometry = geometry;", + " if (geometry === undefined) {", + " return;", + " }", + " if (typeof geometry === \"string\") {", + " return;", + " }", + " // optimization", + " /*if (mesh.userData.triangleIndexToArea) {", + " this._triangleIndexToArea = mesh.userData.triangleIndexToArea;", + " return;", + " }*/", + " const tri = new THREE.Triangle();", + " this._triangleIndexToArea.length = 0;", + " let area = 0;", + " if (!geometry.getIndex()) {", + " return;", + " }", + " // eslint-disable-next-line @typescript-eslint/no-non-null-assertion", + " 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;", + " }", + " }", + " //const area = this._triangleIndexToArea[left + 1] - this._triangleIndexToArea[left];", + " //const percent = (target - this._triangleIndexToArea[left]) / area;", + " let u1 = Math.random();", + " let u2 = Math.random();", + " if (u1 + u2 > 1) {", + " u1 = 1 - u1;", + " u2 = 1 - u2;", + " }", + " // eslint-disable-next-line @typescript-eslint/no-non-null-assertion", + " const index1 = geometry.getIndex().array[left * 3];", + " // eslint-disable-next-line @typescript-eslint/no-non-null-assertion", + " const index2 = geometry.getIndex().array[left * 3 + 1];", + " // eslint-disable-next-line @typescript-eslint/no-non-null-assertion", + " 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);", + " // velocity based on tri normal", + " this._tempA.copy(this._tempB).cross(this._tempC).normalize();", + " p.velocity.copy(this._tempA).normalize().multiplyScalar(p.startSpeed);", + " /*p.position.applyMatrix4(this._mesh.matrixWorld);", + " p.velocity.applyMatrix3(this._mesh.normalMatrix);*/", + " }", + " 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);", + " }", + "}", + "", + "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,", + " });", + " }", + "}", + "", + "const EmitterShapes = {", + " \"cone\": { type: \"cone\", params: [[\"radius\", \"number\"], [\"arc\", \"radian\"], [\"thickness\", \"number\"], [\"angle\", \"radian\"]], constructor: ConeEmitter, loadJSON: ConeEmitter.fromJSON },", + " \"donut\": { type: \"donut\", params: [[\"radius\", \"number\"], [\"arc\", \"radian\"], [\"thickness\", \"number\"], [\"angle\", \"radian\"]], 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\"]], constructor: SphereEmitter, loadJSON: SphereEmitter.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);", + "}", + "", + "(function (RenderMode) {", + " RenderMode[RenderMode[\"BillBoard\"] = 0] = \"BillBoard\";", + " RenderMode[RenderMode[\"StretchedBillBoard\"] = 1] = \"StretchedBillBoard\";", + " RenderMode[RenderMode[\"Mesh\"] = 2] = \"Mesh\";", + " RenderMode[RenderMode[\"Trail\"] = 3] = \"Trail\";", + "})(gdjs.__particleEmmiter3DExtension.RenderMode || (gdjs.__particleEmmiter3DExtension.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;", + " this.settings = {", + " instancingGeometry: settings.instancingGeometry,", + " renderMode: settings.renderMode,", + " renderOrder: settings.renderOrder,", + " material: settings.material,", + " 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 = new THREE.Quaternion();", + "const tempV = new THREE.Vector3();", + "const tempV2 = new THREE.Vector3();", + "new THREE.Vector3();", + "const PREWARM_FPS = 60;", + "const DEFAULT_GEOMETRY = new THREE.PlaneGeometry(1, 1, 1, 1);", + "/**", + " * ParticleSystem represents a system that generates and controls particles with similar attributes.", + " *", + " * @class", + " */", + "class ParticleSystem {", + " set time(time) {", + " this.emissionState.time = time;", + " }", + " get time() {", + " return this.emissionState.time;", + " }", + " // currently if you change the layers setting, you need manually set this.neededToUpdateRender = true;", + " get layers() {", + " return this.rendererSettings.layers;", + " }", + " get texture() {", + " return this.rendererSettings.material.map;", + " }", + " set texture(texture) {", + " this.rendererSettings.material.map = texture;", + " this.neededToUpdateRender = true;", + " //this.emitter.material.uniforms.map.value = texture;", + " }", + " 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;", + " //this.emitter.material.uniforms.tileCount.value.x = u;", + " }", + " 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 != gdjs.__particleEmmiter3DExtension.RenderMode.Trail && renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) ||", + " (this.rendererSettings.renderMode == gdjs.__particleEmmiter3DExtension.RenderMode.Trail && renderMode !== gdjs.__particleEmmiter3DExtension.RenderMode.Trail)) {", + " this.restart();", + " this.particles.length = 0;", + " }", + " if (this.rendererSettings.renderMode !== renderMode) {", + " switch (renderMode) {", + " case gdjs.__particleEmmiter3DExtension.RenderMode.Trail:", + " this.rendererEmitterSettings = {", + " startLength: new ConstantValue(30),", + " followLocalOrigin: false,", + " };", + " break;", + " case gdjs.__particleEmmiter3DExtension.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 gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard:", + " case gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard:", + " this.rendererEmitterSettings = {};", + " if (this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " this.startRotation = new ConstantValue(0);", + " }", + " break;", + " }", + " }", + " this.rendererSettings.renderMode = renderMode;", + " this.neededToUpdateRender = true;", + " //this.emitter.rebuildMaterial();", + " }", + " get renderOrder() {", + " return this.rendererSettings.renderOrder;", + " }", + " set renderOrder(renderOrder) {", + " this.rendererSettings.renderOrder = renderOrder;", + " this.neededToUpdateRender = true;", + " //this.emitter.rebuildMaterial();", + " }", + " 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;", + " this.temp = new THREE.Vector3();", + " this.travelDistance = 0;", + " this.normalMatrix = new THREE.Matrix3();", + " 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.startLength = parameters.startLength ?? new ConstantValue(30);", + " 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.speedFactor = (_p = parameters.speedFactor) !== null && _p !== void 0 ? _p : 0;", + " this.rendererEmitterSettings = (_q = parameters.rendererEmitterSettings) !== null && _q !== void 0 ? _q : {};", + " this.rendererSettings = {", + " instancingGeometry: (_r = parameters.instancingGeometry) !== null && _r !== void 0 ? _r : DEFAULT_GEOMETRY,", + " renderMode: (_s = parameters.renderMode) !== null && _s !== void 0 ? _s : gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard,", + " renderOrder: (_t = parameters.renderOrder) !== null && _t !== void 0 ? _t : 0,", + " material: parameters.material,", + " uTileCount: (_u = parameters.uTileCount) !== null && _u !== void 0 ? _u : 1,", + " vTileCount: (_v = parameters.vTileCount) !== null && _v !== void 0 ? _v : 1,", + " layers: (_w = parameters.layers) !== null && _w !== void 0 ? _w : 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,", + " };", + " this.emitEnded = false;", + " this.markForDestroy = false;", + " this.prewarmed = false;", + " }", + " pause() {", + " this.paused = true;", + " }", + " play() {", + " this.paused = false;", + " }", + " spawn(count, emissionState, matrix) {", + " tempQ.setFromRotationMatrix(matrix);", + " const translation = tempV;", + " const quaternion = tempQ;", + " const scale = tempV2;", + " matrix.decompose(translation, quaternion, scale);", + " for (let i = 0; i < count; i++) {", + " this.particleNum++;", + " while (this.particles.length < this.particleNum) {", + " if (this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) {", + " this.particles.push(new TrailParticle());", + " }", + " else {", + " this.particles.push(new SpriteParticle());", + " }", + " }", + " const particle = this.particles[this.particleNum - 1];", + " this.startColor.genColor(particle.startColor, Math.random());", + " 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());", + " particle.size = particle.startSize;", + " if (this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh ||", + " this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard ||", + " this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard) {", + " const sprite = particle;", + " if (this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.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 === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) {", + " const trail = particle;", + " trail.length = this.rendererEmitterSettings.startLength.genValue(emissionState.time / this.duration);", + " trail.reset();", + " }", + " this.emitterShape.initialize(particle);", + " if (this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.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, 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;", + " }", + " //firstTimeUpdate = true;", + " update(delta) {", + " /*if (this.firstTimeUpdate) {", + " this.renderer.addSystem(this);", + " this.firstTimeUpdate = false;", + " }*/", + " 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 (this.neededToUpdateRender) {", + " if (this._renderer)", + " this._renderer.updateSystem(this);", + " this.neededToUpdateRender = false;", + " }", + " if (!this.onlyUsedByOther) {", + " this.emit(delta, this.emissionState, this.emitter.matrixWorld);", + " }", + " // simulate", + " 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) {", + " // eslint-disable-next-line @typescript-eslint/no-non-null-assertion", + " this.particles[i].position.copy(this.particles[i].localPosition);", + " if (this.particles[i].parentMatrix) {", + " // eslint-disable-next-line @typescript-eslint/no-non-null-assertion", + " 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 === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) {", + " for (let i = 0; i < this.particleNum; i++) {", + " const particle = this.particles[i];", + " particle.update();", + " }", + " }", + " // particle die", + " 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);", + " // spawn", + " const totalSpawn = Math.ceil(emissionState.waitEmiting);", + " this.spawn(totalSpawn, emissionState, emitterMatrix);", + " emissionState.waitEmiting -= totalSpawn;", + " // spawn burst", + " 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;", + " this.spawn(count, emissionState, emitterMatrix);", + " }", + " emissionState.burstIndex++;", + " }", + " if (!this.emitEnded) {", + " emissionState.waitEmiting += delta * this.emissionOverTime.genValue(emissionState.time / this.duration);", + " if (this.previousWorldPos != undefined) {", + " this.emitter.getWorldPosition(this.temp);", + " this.travelDistance += this.previousWorldPos.distanceTo(this.temp);", + " const emitPerMeter = this.emissionOverDistance.genValue(emissionState.time / this.duration);", + " if (this.travelDistance * emitPerMeter > 0) {", + " const count = Math.floor(this.travelDistance * emitPerMeter);", + " this.travelDistance -= count / emitPerMeter;", + " emissionState.waitEmiting += count;", + " }", + " }", + " }", + " if (this.previousWorldPos === undefined)", + " this.previousWorldPos = new THREE.Vector3();", + " this.emitter.getWorldPosition(this.previousWorldPos);", + " emissionState.time += delta;", + " }", + " toJSON(meta, options = {}) {", + " const isRootObject = meta === undefined || typeof meta === 'string';", + " if (isRootObject) {", + " // initialize meta obj", + " 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,", + " };", + " }", + " }", + " // TODO: support URL", + " let rendererSettingsJSON;", + " if (this.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) {", + " rendererSettingsJSON = {", + " startLength: this.rendererEmitterSettings.startLength.toJSON(),", + " followLocalOrigin: this.rendererEmitterSettings.followLocalOrigin,", + " };", + " }", + " else if (this.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " rendererSettingsJSON = {};", + " /*;*/", + " }", + " 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,", + " onlyUsedByOther: this.onlyUsedByOther,", + " instancingGeometry: this.rendererSettings.instancingGeometry.uuid,", + " renderOrder: this.renderOrder,", + " renderMode: this.renderMode,", + " rendererEmitterSettings: rendererSettingsJSON,", + " speedFactor: this.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard ? this.speedFactor : 0,", + " //texture: this.texture.uuid,", + " 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;", + " const shape = EmitterFromJSON(json.shape, meta);", + " let rendererEmitterSettings;", + " if (json.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) {", + " rendererEmitterSettings = {", + " startLength: json.rendererEmitterSettings.startLength != undefined", + " ? ValueGeneratorFromJSON(json.rendererEmitterSettings.startLength)", + " : new ConstantValue(30),", + " followLocalOrigin: json.rendererEmitterSettings.followLocalOrigin,", + " };", + " }", + " else if (json.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " rendererEmitterSettings = {};", + " }", + " 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: json.emissionBursts,", + " onlyUsedByOther: json.onlyUsedByOther,", + " instancingGeometry: meta.geometries[json.instancingGeometry],", + " renderMode: json.renderMode,", + " rendererEmitterSettings: rendererEmitterSettings,", + " renderOrder: json.renderOrder,", + " speedFactor: json.speedFactor,", + " layers: layers,", + " material: json.material", + " ? meta.materials[json.material]", + " : json.texture", + " ? new THREE.MeshBasicMaterial({", + " map: meta.textures[json.texture],", + " transparent: (_a = json.transparent) !== null && _a !== void 0 ? _a : 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 === gdjs.__particleEmmiter3DExtension.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,", + " speedFactor: this.speedFactor,", + " material: this.rendererSettings.material,", + " startTileIndex: this.startTileIndex,", + " uTileCount: this.uTileCount,", + " vTileCount: this.vTileCount,", + " behaviors: newBehaviors,", + " worldSpace: this.worldSpace,", + " layers: layers,", + " });", + " }", + "}", + "", + "var particle_frag = /* glsl */ `", + "", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "void main() {", + "", + "#include ", + "", + "vec3 outgoingLight = vec3( 0.0 );", + "vec4 diffuseColor = vColor;", + "", + "#include ", + "", + "#ifdef USE_MAP", + "vec4 texelColor = texture2D( map, vUv);", + "diffuseColor *= texelColor;", + "#endif", + "", + "outgoingLight = diffuseColor.rgb;", + "", + "gl_FragColor = vec4( outgoingLight, diffuseColor.a );", + "", + "#include ", + "", + "}", + "`;", + "/*", + " gl_FragColor = vec4(vUv.x, vUv.y, 1.0, 1.0);", + "", + " #ifdef USE_MAP", + " vec4 texelColor = texture2D( map, vUv);", + " diffuseColor *= texelColor;", + " #endif", + "", + " outgoingLight = diffuseColor.rgb;", + "", + " gl_FragColor = vec4( outgoingLight, diffuseColor.a );", + "*/", + "", + "var particle_physics_frag = /* glsl */ `", + "#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 particle_vert = /* glsl */ `", + "#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() {", + "", + "#ifdef UV_TILE", + " vUv = vec2((mod(uvTile, tileCount.x) + uv.x) * (1.0 / tileCount.x), ((tileCount.y - floor(uvTile / tileCount.x) - 1.0) + uv.y) * (1.0 / tileCount.y));", + "#else", + " #include ", + "#endif", + "", + "vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );", + "", + "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;", + "", + "mvPosition.xy += rotatedPosition;", + "", + "vColor = color;", + "", + "gl_Position = projectionMatrix * mvPosition;", + "", + "#include ", + "#include ", + "", + "}", + "`;", + "/*", + " #ifndef USE_SIZEATTENUATION", + " bool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );", + " if ( isPerspective ) computedSize *= - mvPosition.z;", + " #endif", + " */", + "", + "var local_particle_vert = /* glsl */ `", + "#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() {", + "", + "#ifdef UV_TILE", + " vUv = vec2((mod(uvTile, tileCount.x) + uv.x) * (1.0 / tileCount.x), ((tileCount.y - floor(uvTile / tileCount.x) - 1.0) + uv.y) * (1.0 / tileCount.y));", + "#else", + " #include ", + "#endif", + "", + "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 ));", + "", + "vColor = color;", + "", + "gl_Position = projectionMatrix * mvPosition;", + "", + "#include ", + "#include ", + "", + "}", + "`;", + "", + "var local_particle_physics_vert = /* glsl */ `", + "#define STANDARD", + "varying vec3 vViewPosition;", + "#ifdef USE_TRANSMISSION", + "varying 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() {", + "#ifdef UV_TILE", + " vUv = vec2((mod(uvTile, tileCount.x) + uv.x) * (1.0 / tileCount.x), ((tileCount.y - floor(uvTile / tileCount.x) - 1.0) + uv.y) * (1.0 / tileCount.y));", + "#else", + " #include ", + "#endif", + "", + "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);", + " ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "// replace defaultnormal_vertex", + "vec3 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", + "", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "// replace include ", + "vec4 mvPosition = vec4( transformed, 1.0 );", + "mvPosition = modelViewMatrix * (particleMatrix * mvPosition);", + "gl_Position = projectionMatrix * mvPosition;", + "", + "#include ", + "#include ", + "", + "vViewPosition = - mvPosition.xyz;", + "", + "#include ", + "#include ", + "#include ", + "#ifdef USE_TRANSMISSION", + "vWorldPosition = worldPosition.xyz;", + "#endif", + "}", + "`;", + "", + "var stretched_bb_particle_vert = /* glsl */ `", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "attribute vec3 offset;", + "attribute float rotation;", + "attribute float size;", + "attribute vec3 velocity;", + "attribute float uvTile;", + "", + "#ifdef UV_TILE", + "uniform vec2 tileCount;", + "#endif", + "", + "uniform float speedFactor;", + "", + "void main() {", + "", + "#ifdef UV_TILE", + " vUv = vec2((mod(uvTile, tileCount.x) + uv.x) * (1.0 / tileCount.x), ((tileCount.y - floor(uvTile / tileCount.x) - 1.0) + uv.y) * (1.0 / tileCount.y));", + "#else", + " #include ", + "#endif", + "", + "vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );", + "vec3 viewVelocity = normalMatrix * velocity;", + "", + "vec3 scaledPos = vec3(position.xy * size, position.z);", + "mvPosition.xyz += scaledPos + dot(scaledPos, viewVelocity) * viewVelocity / length(viewVelocity) * speedFactor;", + "", + "vColor = color;", + "", + "gl_Position = projectionMatrix * mvPosition;", + "", + "#include ", + "#include ", + "", + "}", + "`;", + "/*", + "", + " vec3 instancePos = vec3(position.xy * size, position.z);", + " instancePos += dot(instancePos, viewVelocity) * viewVelocity * speedFactor;", + " mvPosition.xyz += instancePos;", + "", + " vColor = color; //vec4(1, 1, 1, 1); //color; //length(viewVelocity) * 0.1", + "", + " #ifndef USE_SIZEATTENUATION", + " bool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );", + " if ( isPerspective ) computedSize *= - mvPosition.z;", + " #endif", + " */", + "", + "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);", + " /*", + " clone() {", + " let system = this.system.clone();", + " return system.emitter as any;", + " }*/", + " 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();", + " // TODO: implement boundingVolume", + " }", + " 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 === gdjs.__particleEmmiter3DExtension.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 === gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard ||", + " this.settings.renderMode === gdjs.__particleEmmiter3DExtension.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 === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard) {", + " this.velocityBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 3), 3);", + " 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')); //new InterleavedBufferAttribute(this.interleavedBuffer, 3, 0, false));", + " this.geometry.setAttribute('uv', this.settings.instancingGeometry.getAttribute('uv')); //new InterleavedBufferAttribute(this.interleavedBuffer, 2, 3, false));", + " 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: /*@__PURE__*/ new THREE.Color(0x000000) },", + " roughness: { value: 1.0 },", + " metalness: { value: 0.0 },", + " envMapIntensity: { value: 1 }, // temporary", + " },", + " ]);", + " 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;", + " }", + " }", + " else {", + " uniforms = {};", + " uniforms['map'] = new THREE.Uniform(this.settings.material.map);", + " }", + " if (this.settings.material.map) {", + " defines['USE_MAP'] = '';", + " defines['USE_UV'] = '';", + " defines['UV_TILE'] = '';", + " const uTileCount = this.settings.uTileCount;", + " const vTileCount = this.settings.vTileCount;", + " defines['MAP_UV'] = getMaterialUVChannelName(this.settings.material.map.channel);", + " uniforms['uvTransform'] = new THREE.Uniform(new THREE.Matrix3().copy(this.settings.material.map.matrix));", + " uniforms['tileCount'] = new THREE.Uniform(new THREE.Vector2(uTileCount, vTileCount));", + " }", + " defines['USE_COLOR_ALPHA'] = '';", + " let needLights = false;", + " if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard || this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " let vertexShader;", + " let fragmentShader;", + " if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.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;", + " }", + " 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,", + " lights: needLights,", + " });", + " }", + " else if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.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,", + " });", + " }", + " 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 === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " //this.quaternion_.setFromAxisAngle(UP, particle.rotation as number);", + " 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 === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard ||", + " this.settings.renderMode === gdjs.__particleEmmiter3DExtension.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 === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard && this.velocityBuffer) {", + " const speedFactor = system.speedFactor;", + " 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.setXYZ(index, vec.x * speedFactor, vec.y * speedFactor, vec.z * speedFactor);", + " }", + " }", + " });", + " 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 === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard && this.velocityBuffer) {", + " this.velocityBuffer.updateRange.count = index * 3;", + " this.velocityBuffer.needsUpdate = true;", + " }", + " if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " this.rotationBuffer.updateRange.count = index * 4;", + " this.rotationBuffer.needsUpdate = true;", + " }", + " else if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard ||", + " this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard) {", + " this.rotationBuffer.updateRange.count = index;", + " this.rotationBuffer.needsUpdate = true;", + " }", + " }", + " }", + " dispose() {", + " this.geometry.dispose();", + " }", + "}", + "", + "var trail_frag = /* glsl */ `", + "", + "#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", + "c *= texture2D( map, vUv * repeat );", + "#endif", + "if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUv * repeat ).a;", + "if( c.a < alphaTest ) discard;", + "gl_FragColor = c;", + "", + "#include ", + "#include ", + "}`;", + "", + "var trail_vert = /* glsl */ `", + "#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() {", + "", + "#include ", + "", + "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;", + "", + "#include ", + "#include ", + "", + "vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", + "", + "#include ", + "}`;", + "", + "new THREE.Vector3(0, 0, 1);", + "class TrailBatch extends VFXBatch {", + " constructor(settings) {", + " super(settings);", + " /*", + " clone() {", + " let system = this.system.clone();", + " return system.emitter as any;", + " }*/", + " 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();", + " // TODO: implement boundingVolume", + " }", + " 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.renderMode === gdjs.__particleEmmiter3DExtension.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);", + " 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 {", + " this.widthBuffer.setX(index, (current.size * (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z))) / 3);", + " this.widthBuffer.setX(index + 1, (current.size * (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z))) / 3);", + " }", + " }", + " 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.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 gdjs.__particleEmmiter3DExtension.RenderMode.Trail:", + " batch = new TrailBatch(settings);", + " break;", + " case gdjs.__particleEmmiter3DExtension.RenderMode.Mesh:", + " case gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard:", + " case gdjs.__particleEmmiter3DExtension.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);", + " }", + " /*const settings = system.getRendererSettings();", + " for (let i = 0; i < this.batches.length; i++) {", + " if (BatchedParticleRenderer.equals(this.batches[i].settings, settings)) {", + " this.batches[i].removeSystem(system);", + " return;", + " }", + " }*/", + " }", + " 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();", + " }", + " }", + "}", + "", + "// deprecated", + "const BatchedParticleRenderer = BatchedRenderer;", + "", + "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) {", + " // Create an empty canvas element", + " const canvas = document.createElement(\"canvas\");", + " canvas.width = img.width;", + " canvas.height = img.height;", + " // Copy the image contents to the canvas", + " 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));", + " }", + " }", + " }", + " //return data;", + " // Get the data-URL formatted image", + " // Firefox supports PNG and JPEG. You could check img.src to", + " // guess the original format, but be aware the using \"image/jpg\"", + " // will re-encode the image.", + " //var dataURL = canvas.toDataURL(\"image/png\");", + " //return dataURL.replace(/^data:image\\/(png|jpg);base64,/, \"\");", + " }", + "}", + "", + "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 QuarksLoader extends THREE.ObjectLoader {", + " /*manager: LoadingManager;", + " crossOrigin: string = \"anonymous\";", + " path?: string;", + " resourcePath: string;", + "*/", + " constructor(manager) {", + " super(manager);", + " //this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;", + " //this.resourcePath = '';", + " }", + " 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;", + " /*if (shape instanceof MeshSurfaceEmitter) {", + " shape.geometry = objectsMap[shape.geometry as any] as Mesh;", + " }*/", + " 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;", + " }", + " // @ts-ignore", + " 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) { // @ts-ignore", + " 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) {", + " // @ts-ignore", + " object.addLevel(child, level.distance);", + " }", + " }", + " }", + " // @ts-ignore", + " 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];", + " }", + " }", + " }", + "}", + "", + "gdjs.__particleEmmiter3DExtension.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\";", + "})(gdjs.__particleEmmiter3DExtension.NodeValueType || (gdjs.__particleEmmiter3DExtension.NodeValueType = {}));", + "const genDefaultForNodeValueType = (type) => {", + " switch (type) {", + " case gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean:", + " return false;", + " case gdjs.__particleEmmiter3DExtension.NodeValueType.Number:", + " return 0;", + " case gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2:", + " return new THREE.Vector2();", + " case gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3:", + " return new THREE.Vector3();", + " case gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4:", + " return new THREE.Vector4();", + " case gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType:", + " return 0;", + " }", + "};", + "", + "class Node {", + " constructor(type) {", + " this.inputs = [];", + " this.outputs = [];", + " this.data = {};", + " // display", + " this.position = new THREE.Vector2();", + " // execution", + " this.outputValues = [];", + " this.id = \"\" + Math.round(Math.random() * 100000); //TODO use real random", + " this.type = type;", + " for (let i = 0; i < type.inputTypes.length; i++) {", + " this.inputs.push(undefined);", + " }", + " for (let i = 0; i < type.outputTypes.length; i++) {", + " this.outputs.push(undefined);", + " this.outputValues.push(genDefaultForNodeValueType(type.outputTypes[i]));", + " }", + " }", + "}", + "class Wire {", + " constructor(input, inputIndex, output, outputIndex) {", + " this.input = input;", + " this.inputIndex = inputIndex;", + " this.input.outputs[inputIndex] = this;", + " this.output = output;", + " this.outputIndex = outputIndex;", + " this.output.inputs[outputIndex] = this;", + " }", + "}", + "", + "class Interpreter {", + " constructor() {", + " this.visited = new Set();", + " Interpreter.Instance = this;", + " }", + " traverse(node) {", + " if (this.context_ === undefined) {", + " throw new Error(\"context is undefined\");", + " }", + " if (this.graph_ === undefined) {", + " throw new Error(\"graph is undefined\");", + " }", + " this.visited.add(node.id);", + " const inputValues = [];", + " for (let i = 0; i < node.inputs.length; i++) {", + " if (node.inputs[i] instanceof Wire) {", + " const inputNode = node.inputs[i].input;", + " //if (inputNode) {", + " if (!this.visited.has(inputNode.id)) {", + " this.traverse(inputNode);", + " }", + " inputValues.push(inputNode.outputValues[node.inputs[i].inputIndex]);", + " /*} else {", + " throw new Error(`Node ${node.id} has not inputs`);", + " }*/", + " }", + " else {", + " inputValues.push(node.inputs[i].getValue(this.context_));", + " }", + " }", + " // calculation", + " node.type.func(this.context_, inputValues, node.outputValues);", + " this.graph_.nodesInOrder.push(node);", + " }", + " executeCompiledGraph() {", + " if (this.context_ === undefined) {", + " throw new Error(\"context is undefined\");", + " }", + " if (this.graph_ === undefined) {", + " throw new Error(\"graph is undefined\");", + " }", + " const nodes = this.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(this.context_));", + " }", + " else {", + " throw new Error(`miss input for node ${node.id}`);", + " }", + " }", + " node.type.func(this.context_, inputValues, node.outputValues);", + " }", + " }", + " run(graph, context) {", + " this.graph_ = graph;", + " this.context_ = context;", + " if (graph.compiled) {", + " this.executeCompiledGraph();", + " }", + " else {", + " graph.nodesInOrder.length = 0;", + " this.visited.clear();", + " for (let i = 0; i < graph.outputNodes.length; i++) {", + " const node = graph.outputNodes[i];", + " this.traverse(node);", + " }", + " graph.compiled = true;", + " }", + " }", + "}", + "", + "class NodeType {", + " constructor(name, func, inputTypes, outputTypes) {", + " this.inputTypes = [];", + " this.outputTypes = [];", + " this.name = name;", + " this.func = func;", + " this.inputTypes = inputTypes;", + " this.outputTypes = outputTypes;", + " }", + "}", + "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, (context, inputs, outputs) => {", + " context.inputs = inputs;", + " context.outputs = outputs;", + " Interpreter.Instance.run(nodeGraph, context);", + " }, inputTypes, outputTypes);", + " this.nodeGraph = nodeGraph;", + " }", + "}", + "", + "const NodeTypes = {", + " \"add\": new NodeType(\"add\", (context, inputs, outputs) => {", + " if (typeof inputs[0] === 'number') {", + " outputs[0] = inputs[0] + inputs[1];", + " }", + " else if (inputs[0] instanceof THREE.Vector3 || inputs[0] instanceof THREE.Vector2 || inputs[0] instanceof THREE.Vector4) {", + " outputs[0].addVectors(inputs[0], inputs[1]);", + " }", + " }, [gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType, gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType], [gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType]),", + " \"sub\": new NodeType(\"sub\", (context, inputs, outputs) => {", + " if (typeof inputs[0] === 'number') {", + " outputs[0] = inputs[0] - inputs[1];", + " }", + " else if (inputs[0] instanceof THREE.Vector3 || inputs[0] instanceof THREE.Vector2 || inputs[0] instanceof THREE.Vector4) {", + " outputs[0].subVectors(inputs[0], inputs[1]);", + " }", + " }, [gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType, gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType], [gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType]),", + " \"mul\": new NodeType(\"mul\", (context, inputs, outputs) => {", + " if (typeof inputs[0] === 'number') {", + " outputs[0] = inputs[0] * inputs[1];", + " }", + " else if (inputs[0] instanceof THREE.Vector3 || inputs[0] instanceof THREE.Vector2 || inputs[0] instanceof THREE.Vector4) {", + " outputs[0].multiplyVectors(inputs[0], inputs[1]);", + " }", + " }, [gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType, gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType], [gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType]),", + " \"div\": new NodeType(\"div\", (context, inputs, outputs) => {", + " if (typeof inputs[0] === 'number') {", + " outputs[0] = inputs[0] / inputs[1];", + " }", + " else if (inputs[0] instanceof THREE.Vector3 || inputs[0] instanceof THREE.Vector2 || inputs[0] instanceof THREE.Vector4) {", + " outputs[0].copy(inputs[0]).divide(inputs[1]);", + " }", + " }, [gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType, gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType], [gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType]),", + " \"curve\": new NodeType(\"curve\", (context, inputs, outputs) => {", + " //outputs[0] = inputs[0] + inputs[1];", + " }, [], []),", + " \"vrand\": new NodeType(\"vrand\", (context, inputs, outputs) => {", + " //outputs[0] = inputs[0] + inputs[1];", + " }, [], []),", + " \"curveSample\": new NodeType(\"curveSample\", (context, inputs, outputs) => {", + " //outputs[0] = inputs[0] + inputs[1];", + " }, [], []),", + " \"random\": new NodeType(\"random\", (context, inputs, outputs) => {", + " outputs[0] = Math.random() * (inputs[1] - inputs[0]) + inputs[0];", + " }, [gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number]),", + " \"input\": new NodeType(\"input\", (context, inputs, outputs) => {", + " outputs[0] = inputs[0];", + " }, [gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType], [gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType]),", + " \"output\": new NodeType(\"output\", (context, inputs, outputs) => {", + " outputs[0] = inputs[0];", + " }, [gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType], [gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType]),", + "};", + "", + "class NodeGraph {", + " constructor(name) {", + " this.inputNodes = [];", + " this.outputNodes = [];", + " this.allNodes = new Map();", + " this.wires = [];", + " this.compiled = false;", + " this.nodesInOrder = [];", + " this.version = \"1.0\";", + " this.id = \"\" + Math.round(Math.random() * 100000); //TODO use real random", + " this.name = name;", + " }", + " addWire(wire) {", + " this.wires.push(wire);", + " }", + " addNode(node) {", + " //this.nodes.push(node);", + " this.allNodes.set(node.id, node);", + " if (node.type === NodeTypes['input']) {", + " this.inputNodes.push(node);", + " }", + " else if (node.type === NodeTypes['output']) {", + " this.outputNodes.push(node);", + " }", + " }", + " getNode(id) {", + " return this.allNodes.get(id);", + " }", + " deleteNode(node) {", + " /*let index = this.nodes.indexOf(node);", + " if (index != -1) {", + " this.nodes[index] = this.nodes[this.nodes.length - 1];", + " this.nodes.pop();", + " }*/", + " this.allNodes.delete(node.id);", + " }", + " deleteWire(wire) {", + " wire.input.outputs[wire.inputIndex] = undefined;", + " wire.output.inputs[wire.outputIndex] = undefined;", + " const index = this.wires.indexOf(wire);", + " if (index != -1) {", + " this.wires[index] = this.wires[this.wires.length - 1];", + " this.wires.pop();", + " }", + " }", + " toJSON() {", + " throw new Error(\"not implemented\");", + " }", + " clone() {", + " throw new Error(\"not implemented\");", + " }", + "}", + "", + "gdjs.__particleEmmiter3DExtension.ApplyCollision = ApplyCollision;", + "gdjs.__particleEmmiter3DExtension.ApplyForce = ApplyForce;", + "gdjs.__particleEmmiter3DExtension.ApplySequences = ApplySequences;", + "gdjs.__particleEmmiter3DExtension.AxisAngleGenerator = AxisAngleGenerator;", + "gdjs.__particleEmmiter3DExtension.BatchedParticleRenderer = BatchedParticleRenderer;", + "gdjs.__particleEmmiter3DExtension.BatchedRenderer = BatchedRenderer;", + "gdjs.__particleEmmiter3DExtension.BehaviorFromJSON = BehaviorFromJSON;", + "gdjs.__particleEmmiter3DExtension.BehaviorTypes = BehaviorTypes;", + "gdjs.__particleEmmiter3DExtension.Bezier = Bezier;", + "gdjs.__particleEmmiter3DExtension.ChangeEmitDirection = ChangeEmitDirection;", + "gdjs.__particleEmmiter3DExtension.ColorGeneratorFromJSON = ColorGeneratorFromJSON;", + "gdjs.__particleEmmiter3DExtension.ColorOverLife = ColorOverLife;", + "gdjs.__particleEmmiter3DExtension.ColorRange = ColorRange;", + "gdjs.__particleEmmiter3DExtension.ConeEmitter = ConeEmitter;", + "gdjs.__particleEmmiter3DExtension.ConstantColor = ConstantColor;", + "gdjs.__particleEmmiter3DExtension.ConstantValue = ConstantValue;", + "gdjs.__particleEmmiter3DExtension.DonutEmitter = DonutEmitter;", + "gdjs.__particleEmmiter3DExtension.EmitSubParticleSystem = EmitSubParticleSystem;", + "gdjs.__particleEmmiter3DExtension.EmitterFromJSON = EmitterFromJSON;", + "gdjs.__particleEmmiter3DExtension.EmitterShapes = EmitterShapes;", + "gdjs.__particleEmmiter3DExtension.EulerGenerator = EulerGenerator;", + "gdjs.__particleEmmiter3DExtension.ForceOverLife = ForceOverLife;", + "gdjs.__particleEmmiter3DExtension.FrameOverLife = FrameOverLife;", + "gdjs.__particleEmmiter3DExtension.GeneratorFromJSON = GeneratorFromJSON;", + "gdjs.__particleEmmiter3DExtension.Gradient = Gradient;", + "gdjs.__particleEmmiter3DExtension.GraphNodeType = GraphNodeType;", + "gdjs.__particleEmmiter3DExtension.GravityForce = GravityForce;", + "gdjs.__particleEmmiter3DExtension.GridEmitter = GridEmitter;", + "gdjs.__particleEmmiter3DExtension.Interpreter = Interpreter;", + "gdjs.__particleEmmiter3DExtension.IntervalValue = IntervalValue;", + "gdjs.__particleEmmiter3DExtension.MeshSurfaceEmitter = MeshSurfaceEmitter;", + "gdjs.__particleEmmiter3DExtension.Node = Node;", + "gdjs.__particleEmmiter3DExtension.NodeGraph = NodeGraph;", + "gdjs.__particleEmmiter3DExtension.NodeType = NodeType;", + "gdjs.__particleEmmiter3DExtension.NodeTypes = NodeTypes;", + "gdjs.__particleEmmiter3DExtension.Noise = Noise;", + "gdjs.__particleEmmiter3DExtension.OrbitOverLife = OrbitOverLife;", + "gdjs.__particleEmmiter3DExtension.ParticleEmitter = ParticleEmitter;", + "gdjs.__particleEmmiter3DExtension.ParticleSystem = ParticleSystem;", + "gdjs.__particleEmmiter3DExtension.PiecewiseBezier = PiecewiseBezier;", + "gdjs.__particleEmmiter3DExtension.PiecewiseFunction = PiecewiseFunction;", + "gdjs.__particleEmmiter3DExtension.Plugins = Plugins;", + "gdjs.__particleEmmiter3DExtension.PointEmitter = PointEmitter;", + "gdjs.__particleEmmiter3DExtension.QuarksLoader = QuarksLoader;", + "gdjs.__particleEmmiter3DExtension.RandomColor = RandomColor;", + "gdjs.__particleEmmiter3DExtension.RandomColorBetweenGradient = RandomColorBetweenGradient;", + "gdjs.__particleEmmiter3DExtension.RandomQuatGenerator = RandomQuatGenerator;", + "gdjs.__particleEmmiter3DExtension.RecordState = RecordState;", + "gdjs.__particleEmmiter3DExtension.Rotation3DOverLife = Rotation3DOverLife;", + "gdjs.__particleEmmiter3DExtension.RotationGeneratorFromJSON = RotationGeneratorFromJSON;", + "gdjs.__particleEmmiter3DExtension.RotationOverLife = RotationOverLife;", + "gdjs.__particleEmmiter3DExtension.SequencerFromJSON = SequencerFromJSON;", + "gdjs.__particleEmmiter3DExtension.SizeOverLife = SizeOverLife;", + "gdjs.__particleEmmiter3DExtension.SpeedOverLife = SpeedOverLife;", + "gdjs.__particleEmmiter3DExtension.SphereEmitter = SphereEmitter;", + "gdjs.__particleEmmiter3DExtension.SpriteBatch = SpriteBatch;", + "gdjs.__particleEmmiter3DExtension.SpriteParticle = SpriteParticle;", + "gdjs.__particleEmmiter3DExtension.TextureSequencer = TextureSequencer;", + "gdjs.__particleEmmiter3DExtension.TrailBatch = TrailBatch;", + "gdjs.__particleEmmiter3DExtension.TrailParticle = TrailParticle;", + "gdjs.__particleEmmiter3DExtension.TurbulenceField = TurbulenceField;", + "gdjs.__particleEmmiter3DExtension.VFXBatch = VFXBatch;", + "gdjs.__particleEmmiter3DExtension.ValueGeneratorFromJSON = ValueGeneratorFromJSON;", + "gdjs.__particleEmmiter3DExtension.WidthOverLength = WidthOverLength;", + "gdjs.__particleEmmiter3DExtension.Wire = Wire;", + "gdjs.__particleEmmiter3DExtension.genDefaultForNodeValueType = genDefaultForNodeValueType;", + "gdjs.__particleEmmiter3DExtension.getPhysicsResolver = getPhysicsResolver;", + "gdjs.__particleEmmiter3DExtension.loadPlugin = loadPlugin;", + "gdjs.__particleEmmiter3DExtension.setPhysicsResolver = setPhysicsResolver;", + "gdjs.__particleEmmiter3DExtension.unloadPlugin = 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": [ + { + "defaultName": "ParticleEmitter", + "description": "Display a large number of particles to create visual effects.", + "fullName": "3D particle emitter", + "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 ColorRange = gdjs.__particleEmmiter3DExtension.ColorRange;", + "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 = gdjs.__particleEmmiter3DExtension.ParticleEmitterAdapter;", + "", + "/** @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: 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 ColorRange(", + " new THREE.Vector4(1, 0.3882312, 0.125, 1),", + " new THREE.Vector4(1, 0.826827, 0.3014706, 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.rotation.order = 'ZYX';", + "particleSystem.emitter.name = object.getName() + object.getNameId();", + "", + "object.__particleEmitterAdapter = new ParticleEmitterAdapter(particleSystem, colorOverLife, sizeOverLife, applyForce);", + "object.__particleSystem = particleSystem;", + "", + "const layer = gameScene.getLayer(object.getLayer());", + "layer.getRenderer().add3DRendererObject(particleSystem.emitter);", + "const ParticleEmitter3D = Object.getPrototypeOf(object);", + "if (!ParticleEmitter3D.__isDefined) {", + " ParticleEmitter3D.__isDefined = true;", + " ParticleEmitter3D.get3DRendererObject = function() {", + " return this.__particleSystem.emitter;", + " };", + "}", + "", + "// 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", + "" + ] + } + ] + } + ], + "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--;" + ], + "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": [ + "const object = objects[0];", + "// Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.", + "const gameScene = object.getRuntimeScene();", + "const layer = gameScene.getLayer(object.getLayer());", + "", + "const emitter = object.__particleSystem.emitter;", + "emitter.position.x = object.getX();", + "emitter.position.y = -object.getY();", + "", + "emitter.rotation.z = -object.getAngle() * Math.PI / 180;", + "", + "// 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 (elevation)", + "functionType": "ExpressionAndCondition", + "group": "Position", + "name": "Z", + "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", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyZ" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "", + "object.__particleSystem.emitter.position.z = eventsFunctionContext.getArgument(\"Value\");" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "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", + "functionType": "ExpressionAndCondition", + "group": "Angle", + "name": "RotationX", + "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", + "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", + "functionType": "ExpressionAndCondition", + "group": "Angle", + "name": "RotationY", + "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", + "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": [], + "hidden": false, + "name": "StartColor" + }, + { + "value": "255;255;0", + "type": "Color", + "label": "End color", + "description": "", + "group": "Color", + "extraInformation": [], + "hidden": false, + "name": "EndColor" + }, + { + "value": "255", + "type": "Number", + "unit": "Dimensionless", + "label": "Start opacity", + "description": "", + "group": "Color", + "extraInformation": [], + "hidden": false, + "name": "StartOpacity" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "End opacity", + "description": "", + "group": "Color", + "extraInformation": [], + "hidden": false, + "name": "EndOpacity" + }, + { + "value": "50", + "type": "Number", + "label": "Flow of particles (particles per second)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "Flow" + }, + { + "value": "10", + "type": "Number", + "unit": "Pixel", + "label": "Start min size", + "description": "", + "group": "Size", + "extraInformation": [], + "hidden": false, + "name": "StartSizeMin" + }, + { + "value": "20", + "type": "Number", + "unit": "Pixel", + "label": "Start max size", + "description": "", + "group": "Size", + "extraInformation": [], + "hidden": false, + "name": "StartSizeMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "End scale", + "description": "", + "group": "Size", + "extraInformation": [], + "hidden": false, + "name": "EndScale" + }, + { + "value": "100", + "type": "Number", + "unit": "PixelSpeed", + "label": "Start min speed", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "StartSpeedMin" + }, + { + "value": "100", + "type": "Number", + "unit": "PixelSpeed", + "label": "Start max speed", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "StartSpeedMax" + }, + { + "value": "1", + "type": "Number", + "unit": "Second", + "label": "Min lifespan", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "LifespanMin" + }, + { + "value": "2", + "type": "Number", + "unit": "Second", + "label": "Max lifespan", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "LifespanMax" + }, + { + "value": "5", + "type": "Number", + "unit": "Second", + "label": "Emission duration", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "Duration" + }, + { + "value": "", + "type": "Boolean", + "label": "Particles move with the emitter", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "AreParticlesRelative" + }, + { + "value": "30", + "type": "Number", + "unit": "DegreeAngle", + "label": "Spay cone angle", + "description": "", + "group": "Position", + "extraInformation": [], + "hidden": false, + "name": "SpayConeAngle" + }, + { + "value": "Additive", + "type": "Choice", + "label": "Blending", + "description": "", + "group": "Color", + "extraInformation": [ + "Normal", + "Additive", + "Subtractive", + "Multiply", + "None" + ], + "hidden": false, + "name": "Blending" + }, + { + "value": "Y-", + "type": "Choice", + "label": "Gravity top", + "description": "", + "group": "Speed", + "extraInformation": [ + "Y-", + "Z+" + ], + "hidden": false, + "name": "GravityTop" + }, + { + "value": "0", + "type": "Number", + "unit": "PixelAcceleration", + "label": "Gravity", + "description": "", + "group": "Speed", + "extraInformation": [], + "hidden": false, + "name": "Gravity" + }, + { + "value": "true", + "type": "Boolean", + "label": "Delete when emission ends", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "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": "", + "group": "Position", + "extraInformation": [], + "hidden": false, + "name": "Z" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation on X axis", + "description": "", + "group": "Position", + "extraInformation": [], + "hidden": false, + "name": "RotationX" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation on Y axis", + "description": "", + "group": "Position", + "extraInformation": [], + "hidden": false, + "name": "RotationY" + } + ], + "objects": [ + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Particle", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "Image", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + } + ] + } + ] + }, + { + "author": "", + "category": "Input", + "extensionNamespace": "", + "fullName": "Behavior Remapper", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWFscGhhLXctYm94LW91dGxpbmUiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOSwxN0EyLDIgMCAwLDEgNywxNVY3SDlWMTVIMTFWOEgxM1YxNUgxNVY3SDE3VjE1QTIsMiAwIDAsMSAxNSwxN0g5TTUsM0gxOUEyLDIgMCAwLDEgMjEsNVYxOUEyLDIgMCAwLDEgMTksMjFINUEyLDIgMCAwLDEgMywxOVY1QTIsMiAwIDAsMSA1LDNNNSw1VjE5SDE5VjVINVoiIC8+PC9zdmc+", + "name": "BehaviorRemapper", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/alpha-w-box-outline.svg", + "shortDescription": "Quickly remap Behavior controls to different keys. ", + "version": "1.0.0", + "description": [ + "Make sure to disable default controls unless you want two keys to do the same action.", + "", + "Actions have two versions. `custom` allow the movement keys to be changed to what ever you would like. `presets` provide a common key-bindings that can be selected from a list.", + "", + "### Available Presets:", + "", + "##### `WASD`", + "-\tW: Up", + "-\tA: Left", + "-\tS: Down", + "-\tD: Right", + "-\tSpace: Jump", + "", + "##### `ZQSD`", + "-\tZ: Up", + "-\tQ: Left", + "-\tS: Down", + "-\tD: Right", + "-\tSpace: Jump", + "", + "##### `Numpad` (Num lock must be disabled)", + "-\tNumpad Up: Up", + "-\tNumpad Left: Left", + "-\tNumpad Down: Down", + "-\tNumpad Right: Right", + "-\tNumpad Return/Enter: Jump", + "", + "##### `IJKL`", + "-\tI: Up", + "-\tJ: Left", + "-\tK: Down", + "-\tL: Right", + "-\tReturn/Enter: Jump", + "" + ], + "origin": { + "identifier": "BehaviorRemapper", + "name": "gdevelop-extension-store" + }, + "tags": [ + "remapper", + "key", + "bindings", + "presets", + "platformer", + "top-down" + ], + "authorIds": [ + "AlZ3D1xkH0QDao7T37VZZUeYNpn1" + ], + "dependencies": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Allows for the controls of a Top-Down behavior to be re-mapped via a single action.", + "fullName": "Remap Top-down", + "name": "RemapForTopdown", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyUp()" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "Topdown" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyLeft()" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "Topdown" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyRight()" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "Topdown" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyDown()" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "Topdown" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BehaviorRemapper::RemapForTopdown", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Remaps Top-Down behavior controls to a custom control scheme.", + "fullName": "Remap Top-Down controls to a custom scheme", + "functionType": "Action", + "name": "SetCustom", + "sentence": "Remap controls of _PARAM0_: Up: _PARAM2_, Left: _PARAM3_, Down: _PARAM4_, Right: _PARAM5_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyUp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"up\")" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyLeft" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"left\")" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyRight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"right\")" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyDown" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"down\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BehaviorRemapper::RemapForTopdown", + "type": "behavior" + }, + { + "description": "Up key", + "name": "up", + "type": "key" + }, + { + "description": "Left key", + "name": "left", + "type": "key" + }, + { + "description": "Down key", + "name": "down", + "type": "key" + }, + { + "description": "Right key", + "name": "right", + "type": "key" + } + ], + "objectGroups": [] + }, + { + "description": "Remaps Top-Down behavior controls to a preset control scheme.", + "fullName": "Remap Top-Down controls to a preset", + "functionType": "Action", + "name": "SetPreset", + "sentence": "Remap controls of _PARAM0_ to preset _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "QWERTY bindings" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StrEqual" + }, + "parameters": [ + "GetArgumentAsString(\"options\")", + "=", + "\"WASD\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyUp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"w\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyLeft" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"a\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyDown" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"s\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyRight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"d\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "AZERTY bindings" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StrEqual" + }, + "parameters": [ + "GetArgumentAsString(\"options\")", + "=", + "\"ZQSD\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyUp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"z\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyLeft" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"q\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyDown" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"s\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyDown" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"d\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Numpad bindings" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StrEqual" + }, + "parameters": [ + "GetArgumentAsString(\"options\")", + "=", + "\"Numpad\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyUp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"NumpadUp\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyLeft" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"NumpadLeft\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyDown" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"NumpadDown\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyRight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"NumpadRight\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "QWERTY player 2 bindings " + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StrEqual" + }, + "parameters": [ + "GetArgumentAsString(\"options\")", + "=", + "\"IJKL\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyUp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"i\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyLeft" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"j\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyDown" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"k\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForTopdown::SetPropertyRight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"l\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BehaviorRemapper::RemapForTopdown", + "type": "behavior" + }, + { + "description": "Preset name", + "name": "options", + "supplementaryInformation": "[\"WASD\",\"ZQSD\",\"Numpad\",\"IJKL\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "w", + "type": "String", + "label": "Up key", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "Up" + }, + { + "value": "a", + "type": "String", + "label": "Left key", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "Left" + }, + { + "value": "d", + "type": "String", + "label": "Right key", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "Right" + }, + { + "value": "s", + "type": "String", + "label": "Down key", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "Down" + }, + { + "value": "", + "type": "Behavior", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" + ], + "hidden": false, + "name": "Topdown" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Allows for the controls of a platformer behavior to be re-mapped via a single action.", + "fullName": "Remap Platformer controls", + "name": "RemapForPlatformer", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyUp()" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "Platformer" + ] + }, + { + "type": { + "value": "PlatformBehavior::SimulateLadderKey" + }, + "parameters": [ + "Object", + "Platformer" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyLeft()" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "Platformer" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyRight()" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "Platformer" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyDown()" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "Platformer" + ] + }, + { + "type": { + "value": "PlatformBehavior::SimulateReleaseLadderKey" + }, + "parameters": [ + "Object", + "Platformer" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyJump()" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "Platformer" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BehaviorRemapper::RemapForPlatformer", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Remaps Platformer behavior controls to a custom control scheme.", + "fullName": "Remap Platformer controls to a custom scheme", + "functionType": "Action", + "name": "SetCustom", + "sentence": "Remap controls of _PARAM0_: Up: _PARAM2_, Left: _PARAM3_, Down: _PARAM4_, Right: _PARAM5_, Jump: _PARAM6_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyUp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"up\")" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyLeft" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"left\")" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyRight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"right\")" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyDown" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"down\")" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyJump" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"jump\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BehaviorRemapper::RemapForPlatformer", + "type": "behavior" + }, + { + "description": "Up key", + "name": "up", + "type": "key" + }, + { + "description": "Left key", + "name": "left", + "type": "key" + }, + { + "description": "Down key", + "name": "down", + "type": "key" + }, + { + "description": "Right key", + "name": "right", + "type": "key" + }, + { + "description": "Jump key", + "name": "jump", + "type": "key" + } + ], + "objectGroups": [] + }, + { + "description": "Remaps Platformer behavior controls to a preset control scheme.", + "fullName": "Remap Platformer controls to a preset", + "functionType": "Action", + "name": "SetPreset", + "sentence": "Remap controls of _PARAM0_ to preset _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "QWERTY bindings" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StrEqual" + }, + "parameters": [ + "GetArgumentAsString(\"options\")", + "=", + "\"WASD\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyUp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"w\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyLeft" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"a\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyDown" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"s\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyRight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"d\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyJump" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Space\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "AZERTY bindings" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StrEqual" + }, + "parameters": [ + "GetArgumentAsString(\"options\")", + "=", + "\"ZQSD\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyUp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"z\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyLeft" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"q\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyDown" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"s\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyRight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"d\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyJump" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Space\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Numpad bindings" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StrEqual" + }, + "parameters": [ + "GetArgumentAsString(\"options\")", + "=", + "\"Numpad\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyUp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"NumpadUp\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyLeft" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"NumpadLeft\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyDown" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"NumpadDown\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyRight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"NumpadRight\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyJump" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"NumpadReturn\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "QWERTY player 2 bindings " + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StrEqual" + }, + "parameters": [ + "GetArgumentAsString(\"options\")", + "=", + "\"IJKL\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyUp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"i\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyLeft" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"j\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyDown" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"k\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyRight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"l\"" + ] + }, + { + "type": { + "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyJump" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Return\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BehaviorRemapper::RemapForPlatformer", + "type": "behavior" + }, + { + "description": "Preset name", + "name": "options", + "supplementaryInformation": "[\"WASD\",\"ZQSD\",\"Numpad\",\"IJKL\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "String", + "label": "Up key", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "Up" + }, + { + "value": "", + "type": "String", + "label": "Left key", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "Left" + }, + { + "value": "", + "type": "String", + "label": "Down key", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "Down" + }, + { + "value": "", + "type": "String", + "label": "Right key", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "Right" + }, + { + "value": "", + "type": "String", + "label": "Jump key", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "Jump" + }, + { + "value": "", + "type": "Behavior", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "PlatformBehavior::PlatformerObjectBehavior" + ], + "hidden": false, + "name": "Platformer" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Movement", + "extensionNamespace": "", + "fullName": "Top-down corner sliding", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXN1YmRpcmVjdG9yeS1hcnJvdy1yaWdodCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xOSwxNUwxMywyMUwxMS41OCwxOS41OEwxNS4xNywxNkg0VjRINlYxNEgxNS4xN0wxMS41OCwxMC40MkwxMyw5TDE5LDE1WiIgLz48L3N2Zz4=", + "name": "TopDownCornerSliding", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/f1e89ff4f907ed2245e2d4ad2d5f52f9e1bb6d0127aa370d44cc77462e5be8e3_subdirectory-arrow-right.svg", + "shortDescription": "Slide on corners of rectangular obstacles.", + "version": "0.1.0", + "description": [ + "In top-down games, players may have to go though gaps the same size as their avatar. This is almost impossible to do without any assistance. This extension makes objects slide on obstacles to lead them in the right direction.", + "", + "It can be used for:", + "* Bomberman-like games ([open the project online](https://editor.gdevelop.io/?project=example://goose-bomberman))", + "" + ], + "tags": [ + "top down", + "movement", + "grid", + "align" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Define JavaScript classes for top-down.", + "fullName": "Define JavaScript classes for top-down", + "functionType": "Action", + "name": "DefineJavaScriptForTopDown", + "private": true, + "sentence": "Define JavaScript classes for top-down", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GlobalVariableAsBoolean" + }, + "parameters": [ + "__pixelPerfect.TopDownClassesDefined", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetGlobalVariableAsBoolean" + }, + "parameters": [ + "__pixelPerfect.TopDownClassesDefined", + "True" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "// TODO Remove this when afterPositionUpdate is added to the hook interface.", + "gdjs.TopDownMovementRuntimeBehavior.prototype.actuallyDoStepPreEvents = gdjs.TopDownMovementRuntimeBehavior.prototype.doStepPreEvents;", + "gdjs.TopDownMovementRuntimeBehavior.prototype.doStepPreEvents = function (instanceContainer) {", + " this.actuallyDoStepPreEvents(instanceContainer);", + "", + " for (const topDownMovementHook of this._topDownMovementHooks) {", + " topDownMovementHook.afterPositionUpdateTODO(null);", + " }", + "}", + "", + "const deltasX = [1, 1, 0, -1, -1, -1, 0, 1];", + "const deltasY = [0, 1, 1, 1, 0, -1, -1, -1];", + "const temporaryPointForTransformations = [0, 0];", + "const epsilon = 0.015625;", + "", + "/**", + " * {number} a", + " * {number} b", + " * {return {boolean}}", + " */", + "const almostEquals = function (a, b) {", + " return b - epsilon < a && a < b + epsilon;", + "}", + "", + "const CornerSlider = /** @class */ (function () {", + "", + " /**", + " * @param {gdjs.RuntimeInstanceContainer} instanceContainer", + " * @param {gdjs.RuntimeBehavior} behavior", + " * @param {gdjs.TopDownMovementRuntimeBehavior} topDownBehavior", + " */", + " function CornerSlider(instanceContainer, behavior, topDownBehavior) {", + " this.instanceContainer = instanceContainer;", + " this.behavior = behavior;", + " this.topDownBehavior = topDownBehavior;", + "", + " topDownBehavior.registerHook(this);", + "", + " /**", + " * Obstacles near the object, updated with _updatePotentialCollidingObjects.", + " * @type {Obstacle[]}", + " */", + " this.potentialCollidingObjects = [];", + " /** @type {gdjs.RuntimeObject[]} */", + " this.collidingObjects = [];", + " this.obstacleManager = ObstacleManager.getManager(instanceContainer);", + "", + " // Remember the decision to bypass an obstacle...", + " this.lastAnyObstacle = false;", + " this.needToCheckBypassWay = true;", + "", + " // ...and the context of that decision", + " this.lastAssistanceDirection = -1;", + " this.lastDirection = -1;", + "", + " /** @type {FloatPoint} */", + " this.transformedPosition = [0, 0];", + " /** @type {gdjs.AABB} */", + " this.relativeHitBoxesAABB = { min: [0, 0], max: [0, 0] };", + " /** @type {gdjs.AABB} */", + " this.absoluteHitBoxesAABB = { min: [0, 0], max: [0, 0] };", + " this.hitBoxesAABBUpToDate = false;", + " this.oldWidth = 0;", + " this.oldHeight = 0;", + " this.previousX = 0;", + " this.previousY = 0;", + "", + " /** @type {AssistanceResult} */", + " this.result = new AssistanceResult();", + " }", + "", + " /**", + " * Return the direction to use instead of the direction given in", + " * parameter.", + " * @param {gdjs.TopDownMovementRuntimeBehavior.TopDownMovementHookContext} context", + " * @return {number}", + " */", + " CornerSlider.prototype.overrideDirection = function (context) {", + " let direction = context.getDirection();", + " if (!this.behavior.activated()) {", + " return direction;", + " }", + "", + " const object = this.topDownBehavior.owner;", + " // Check if the object has moved", + " // To avoid to loop on the transform and its inverse", + " // because of float approximation.", + " const position = temporaryPointForTransformations;", + " // TODO Handle isometry", + " // if (this.topDownBehavior._basisTransformation) {", + " // this.topDownBehavior._basisTransformation.toScreen(", + " // this.transformedPosition,", + " // position", + " // );", + " // } else {", + " position[0] = this.transformedPosition[0];", + " position[1] = this.transformedPosition[1];", + " // }", + " if (object.getX() !== position[0] || object.getY() !== position[1]) {", + " position[0] = object.getX();", + " position[1] = object.getY();", + " // TODO Handle isometry", + " // if (this.topDownBehavior._basisTransformation) {", + " // this.topDownBehavior._basisTransformation.toWorld(", + " // position,", + " // this.transformedPosition", + " // );", + " // } else {", + " this.transformedPosition[0] = position[0];", + " this.transformedPosition[1] = position[1];", + " // }", + " }", + "", + " const stickIsUsed =", + " this.topDownBehavior._stickForce !== 0 && direction === -1;", + " let inputDirection = 0;", + " if (stickIsUsed) {", + " inputDirection = this.getStickDirection();", + " } else {", + " inputDirection = direction;", + " }", + " const assistanceDirection = this.suggestDirection(", + " inputDirection", + " );", + " if (assistanceDirection !== -1) {", + " if (stickIsUsed) {", + " this.topDownBehavior._stickAngle = assistanceDirection * 45;", + " }", + " return assistanceDirection;", + " }", + " return direction;", + " }", + "", + " /**", + " * Called before the acceleration and new direction is applied to the", + " * velocity.", + " * @param {gdjs.TopDownMovementRuntimeBehavior.TopDownMovementHookContext} context", + " */", + " CornerSlider.prototype.beforeSpeedUpdate = function (context) { }", + "", + " /**", + " * Called before the velocity is applied to the object position and", + " * angle.", + " */", + " CornerSlider.prototype.beforePositionUpdate = function () {", + " if (!this.behavior.activated()) {", + " return;", + " }", + "", + " const object = this.topDownBehavior.owner;", + " this.previousX = object.getX();", + " this.previousY = object.getY();", + " }", + "", + " // TODO Rename this methode to the new hook interface method.", + " CornerSlider.prototype.afterPositionUpdateTODO = function () {", + " if (!this.behavior.activated()) {", + " return;", + " }", + "", + " const object = this.topDownBehavior.owner;", + " const point = temporaryPointForTransformations;", + " point[0] = object.getX() - this.previousX;", + " point[1] = object.getY() - this.previousY;", + " // TODO Handle isometry", + " // if (this.topDownBehavior._basisTransformation) {", + " // this.topDownBehavior._basisTransformation.toWorld(point, point);", + " // }", + " this.shift(point[0], point[1]);", + "", + " this.applyCollision();", + "", + " const position = temporaryPointForTransformations;", + "", + " // TODO Handle isometry", + " // if (this.topDownBehavior._basisTransformation) {", + " // this.topDownBehavior._basisTransformation.toScreen(", + " // this.transformedPosition,", + " // position", + " // );", + " // } else {", + " position[0] = this.transformedPosition[0];", + " position[1] = this.transformedPosition[1];", + " // }", + " object.setX(position[0]);", + " object.setY(position[1]);", + " }", + "", + " CornerSlider.prototype.getStickDirection = function () {", + " let direction =", + " (this.topDownBehavior._stickAngle +", + " this.topDownBehavior._movementAngleOffset) /", + " 45;", + " direction = direction - Math.floor(direction / 8) * 8;", + " for (let strait = 0; strait < 8; strait += 2) {", + " if (strait - 0.125 < direction && direction < strait + 0.125) {", + " direction = strait;", + " }", + " if (strait + 0.125 <= direction && direction <= strait + 2 - 0.125) {", + " direction = strait + 1;", + " }", + " }", + " if (8 - 0.125 < direction) {", + " direction = 0;", + " }", + " return direction;", + " }", + "", + " /** Analyze the real intent of the player instead of applying the input blindly.", + " * @param {integer} direction", + " * @returns {integer} a direction that matches the player intents.", + " */", + " CornerSlider.prototype.suggestDirection = function (direction) {", + " this.needToCheckBypassWay =", + " this.needToCheckBypassWay || direction !== this.lastDirection;", + "", + " if (direction === -1) {", + " return this.noAssistance();", + " }", + "", + " const object = this.topDownBehavior.owner;", + " if (", + " object.getWidth() !== this.oldWidth ||", + " object.getHeight() !== this.oldHeight", + " ) {", + " this.hitBoxesAABBUpToDate = false;", + " this.oldWidth = object.getWidth();", + " this.oldHeight = object.getHeight();", + " }", + "", + " // Compute the list of the objects that will be used", + " const timeDelta = object.getElapsedTime(this.instanceContainer) / 1000;", + " this.updatePotentialCollidingObjects(", + " 1 + this.topDownBehavior.getMaxSpeed() * timeDelta", + " );", + "", + " const downKey = 1 <= direction && direction <= 3;", + " const leftKey = 3 <= direction && direction <= 5;", + " const upKey = 5 <= direction && direction <= 7;", + " const rightKey = direction <= 1 || 7 <= direction;", + "", + " // Used to align the player when the assistance make him bypass an obstacle", + " let stopMinX = Number.MAX_VALUE;", + " let stopMinY = Number.MAX_VALUE;", + " let stopMaxX = -Number.MAX_VALUE;", + " let stopMaxY = -Number.MAX_VALUE;", + " let isBypassX = false;", + " let isBypassY = false;", + "", + " // Incites of how the player should be assisted", + " let assistanceLeft = 0;", + " let assistanceRight = 0;", + " let assistanceUp = 0;", + " let assistanceDown = 0;", + "", + " // the actual decision", + " let assistanceDirection = -1;", + "", + " const objectAABB = this.getHitBoxesAABB();", + " const minX = objectAABB.min[0];", + " const minY = objectAABB.min[1];", + " const maxX = objectAABB.max[0];", + " const maxY = objectAABB.max[1];", + " const width = maxX - minX;", + " const height = maxY - minY;", + "", + " // This affectation has no meaning, it will be override.", + " /** @type {gdjs.AABB | null} */", + " let bypassedObstacleAABB = null;", + "", + " this.collidingObjects.length = 0;", + " this.collidingObjects.push(object);", + "", + " for (var i = 0; i < this.potentialCollidingObjects.length; ++i) {", + " const obstacleBehavior = this.potentialCollidingObjects[i];", + " const corner = obstacleBehavior.behavior._getSlidingCornerSize();", + " const obstacle = obstacleBehavior.owner;", + " if (obstacle === object) {", + " continue;", + " }", + "", + " const obstacleAABB = obstacleBehavior.getHitBoxesAABB();", + " const obstacleMinX = obstacleAABB.min[0];", + " const obstacleMinY = obstacleAABB.min[1];", + " const obstacleMaxX = obstacleAABB.max[0];", + " const obstacleMaxY = obstacleAABB.max[1];", + "", + " const deltaX = deltasX[direction];", + " const deltaY = deltasY[direction];", + " // Extends the box in the player direction", + " if (", + " Math.max(maxX, Math.floor(maxX + deltaX)) > obstacleMinX &&", + " Math.min(minX, Math.ceil(minX + deltaX)) < obstacleMaxX &&", + " Math.max(maxY, Math.floor(maxY + deltaY)) > obstacleMinY &&", + " Math.min(minY, Math.ceil(minY + deltaY)) < obstacleMaxY", + " ) {", + " this.collidingObjects.push(obstacle);", + "", + " // The player is corner to corner to the obstacle.", + " // The assistance will depend on other obstacles.", + " // Both direction are set and the actual to take", + " // is decided at the end.", + " if (", + " almostEquals(maxX, obstacleMinX) &&", + " almostEquals(maxY, obstacleMinY)", + " ) {", + " assistanceRight++;", + " assistanceDown++;", + " } else if (", + " almostEquals(maxX, obstacleMinX) &&", + " almostEquals(minY, obstacleMaxY)", + " ) {", + " assistanceRight++;", + " assistanceUp++;", + " } else if (", + " almostEquals(minX, obstacleMaxX) &&", + " almostEquals(minY, obstacleMaxY)", + " ) {", + " assistanceLeft++;", + " assistanceUp++;", + " } else if (", + " almostEquals(minX, obstacleMaxX) &&", + " almostEquals(maxY, obstacleMinY)", + " ) {", + " assistanceLeft++;", + " assistanceDown++;", + " } else if (", + " (upKey && almostEquals(minY, obstacleMaxY)) ||", + " (downKey && almostEquals(maxY, obstacleMinY))", + " ) {", + " // The player is not on the corner of the obstacle.", + " // Set the assistance both ways to fall back in", + " // the same case as 2 obstacles side by side", + " // being collide with the player.", + " if (", + " (rightKey || maxX > obstacleMinX + corner) &&", + " minX < obstacleMaxX &&", + " (leftKey || minX < obstacleMaxX - corner) &&", + " maxX > obstacleMinX", + " ) {", + " assistanceLeft++;", + " assistanceRight++;", + " }", + " // The player is on the corner of the obstacle.", + " // (not the exact corner, see corner affectation)", + " else if (", + " !rightKey &&", + " obstacleMinX < maxX &&", + " maxX <= obstacleMinX + corner &&", + " // In case the cornerSize is bigger than the obstacle size,", + " // go the on the shortest side.", + " (leftKey || minX + maxX <= obstacleMinX + obstacleMaxX)", + " ) {", + " assistanceLeft++;", + " isBypassX = true;", + " if (obstacleMinX - width < stopMinX) {", + " stopMinX = obstacleMinX - width;", + " bypassedObstacleAABB = obstacleAABB;", + " }", + " } else if (", + " !leftKey &&", + " obstacleMaxX - corner <= minX &&", + " minX < obstacleMaxX &&", + " (rightKey || minX + maxX > obstacleMinX + obstacleMaxX)", + " ) {", + " assistanceRight++;", + " isBypassX = true;", + " if (obstacleMaxX > stopMaxX) {", + " stopMaxX = obstacleMaxX;", + " bypassedObstacleAABB = obstacleAABB;", + " }", + " }", + " } else if (", + " (leftKey && almostEquals(minX, obstacleMaxX)) ||", + " (rightKey && almostEquals(maxX, obstacleMinX))", + " ) {", + " // The player is not on the corner of the obstacle.", + " // Set the assistance both ways to fall back in", + " // the same case as 2 obstacles side by side", + " // being collide with the player.", + " if (", + " (downKey || maxY > obstacleMinY + corner) &&", + " minY < obstacleMaxY &&", + " (upKey || minY < obstacleMaxY - corner) &&", + " maxY > obstacleMinY", + " ) {", + " assistanceUp++;", + " assistanceDown++;", + " }", + " // The player is on the corner of the obstacle.", + " // (not the exact corner, see corner affectation)", + " else if (", + " !downKey &&", + " obstacleMinY < maxY &&", + " maxY <= obstacleMinY + corner &&", + " (upKey || minY + maxY <= obstacleMinY + obstacleMaxY)", + " ) {", + " assistanceUp++;", + " isBypassY = true;", + " if (obstacleMinY - height < stopMinY) {", + " stopMinY = obstacleMinY - height;", + " bypassedObstacleAABB = obstacleAABB;", + " }", + " } else if (", + " !upKey &&", + " obstacleMaxY - corner <= minY &&", + " minY < obstacleMaxY &&", + " (downKey || minY + maxY > obstacleMinY + obstacleMaxY)", + " ) {", + " assistanceDown++;", + " isBypassY = true;", + " if (obstacleMaxY > stopMaxY) {", + " stopMaxY = obstacleMaxY;", + " bypassedObstacleAABB = obstacleAABB;", + " }", + " }", + " }", + " }", + " }", + "", + " // This may happen when the player is in the corner of 2 perpendicular walls.", + " // No assistance is needed.", + " if (", + " assistanceLeft &&", + " assistanceRight &&", + " assistanceUp &&", + " assistanceDown", + " ) {", + " return this.noAssistance();", + " }", + " // This may happen when the player goes in diagonal against a wall.", + " // Make him follow the wall. This allows player to keep full speed.", + " //", + " // When he collided a square from the wall corner to corner,", + " // a 3rd assistance may be true but it fall back in the same case.", + " else if (assistanceLeft && assistanceRight) {", + " isBypassX = false;", + " if (leftKey && !rightKey) {", + " assistanceDirection = 4;", + " } else if (rightKey && !leftKey) {", + " assistanceDirection = 0;", + " } else {", + " // Contradictory decisions are dismissed.", + " //", + " // This can happen, for instance, with a wall composed of squares.", + " // Taken separately from one to another, a square could be bypass one the right", + " // and the next one on the left even though they are side by side", + " // and the player can't actually go between them.", + " return this.noAssistance();", + " }", + " } else if (assistanceUp && assistanceDown) {", + " isBypassY = false;", + " if (upKey && !downKey) {", + " assistanceDirection = 6;", + " } else if (downKey && !upKey) {", + " assistanceDirection = 2;", + " } else {", + " // see previous comment", + " return this.noAssistance();", + " }", + " }", + " // The player goes in diagonal and is corner to corner with the obstacle.", + " // (but not against a wall, this time)", + " // The velocity is used to decide.", + " // This may only happen after an alignment.", + " // (see \"Alignment:\" comment)", + " else if (assistanceRight && assistanceDown) {", + " if (", + " (downKey && !rightKey) ||", + " (downKey === rightKey && assistanceDown > assistanceRight) ||", + " (assistanceDown === assistanceRight &&", + " this.topDownBehavior._yVelocity > 0 &&", + " Math.abs(this.topDownBehavior._xVelocity) <", + " Math.abs(this.topDownBehavior._yVelocity))", + " ) {", + " assistanceDirection = 2;", + " } else {", + " assistanceDirection = 0;", + " }", + " } else if (assistanceLeft && assistanceDown) {", + " if (", + " (downKey && !leftKey) ||", + " (downKey === leftKey && assistanceDown > assistanceLeft) ||", + " (assistanceDown === assistanceLeft &&", + " this.topDownBehavior._yVelocity > 0 &&", + " Math.abs(this.topDownBehavior._xVelocity) <", + " Math.abs(this.topDownBehavior._yVelocity))", + " ) {", + " assistanceDirection = 2;", + " } else {", + " assistanceDirection = 4;", + " }", + " } else if (assistanceLeft && assistanceUp) {", + " if (", + " (upKey && !leftKey) ||", + " (upKey === leftKey && assistanceUp > assistanceLeft) ||", + " (assistanceUp === assistanceLeft &&", + " this.topDownBehavior._yVelocity < 0 &&", + " Math.abs(this.topDownBehavior._xVelocity) <", + " Math.abs(this.topDownBehavior._yVelocity))", + " ) {", + " assistanceDirection = 6;", + " } else {", + " assistanceDirection = 4;", + " }", + " } else if (assistanceRight && assistanceUp) {", + " if (", + " (upKey && !rightKey) ||", + " (upKey === rightKey && assistanceUp > assistanceRight) ||", + " (assistanceUp === assistanceRight &&", + " this.topDownBehavior._yVelocity < 0 &&", + " Math.abs(this.topDownBehavior._xVelocity) <", + " Math.abs(this.topDownBehavior._yVelocity))", + " ) {", + " assistanceDirection = 6;", + " } else {", + " assistanceDirection = 0;", + " }", + " } else {", + " // Slide on the corner of an obstacle to bypass it.", + " // Every tricky cases are already handled .", + " if (assistanceLeft) {", + " assistanceDirection = 4;", + " } else if (assistanceRight) {", + " assistanceDirection = 0;", + " } else if (assistanceUp) {", + " assistanceDirection = 6;", + " } else if (assistanceDown) {", + " assistanceDirection = 2;", + " } else {", + " return this.noAssistance();", + " }", + " }", + "", + " // Check if there is any obstacle in the way.", + " //", + " // There must be no obstacle to go at least", + " // as far in the direction the player chose", + " // as the assistance must take to align the player.", + " //", + " // Because, if the assistance moves the player by 32 pixels", + " // before been able to go in the right direction", + " // and can only move by 4 pixels afterward", + " // that it'll sound silly.", + " this.needToCheckBypassWay =", + " this.needToCheckBypassWay ||", + " assistanceDirection !== this.lastAssistanceDirection;", + " if ((isBypassX || isBypassY) && !this.needToCheckBypassWay) {", + " // Don't check again if the player intent stays the same.", + " //", + " // Do it, for instance, if an obstacle has moved out of the way", + " // and the player releases and presses agin the key.", + " // Because, doing it automatically would seems weird.", + " if (this.lastAnyObstacle) {", + " return this.noAssistance();", + " }", + " } else if (isBypassX || isBypassY) {", + " this.lastAssistanceDirection = assistanceDirection;", + " this.lastDirection = direction;", + "", + " let anyObstacle = false;", + " // reflection symmetry: y = x", + " // 0 to 6, 2 to 4, 4 to 2, 6 to 0", + " if (direction + assistanceDirection === 6) {", + " // Because the obstacle may not be a square.", + " let cornerX = 0;", + " let cornerY = 0;", + " if (assistanceDirection === 4 || assistanceDirection === 6) {", + " cornerX = bypassedObstacleAABB.min[0];", + " cornerY = bypassedObstacleAABB.min[1];", + " } else {", + " cornerX = bypassedObstacleAABB.max[0];", + " cornerY = bypassedObstacleAABB.max[1];", + " }", + " // / cornerX \\ / 0 1 \\ / x - cornerX \\", + " // \\ cornerY / + \\ 1 0 / * \\ y - cornerY /", + " //", + " // min and max are preserved by the symmetry.", + " // The symmetry image is extended to check there is no obstacle before going into the passage.", + " const searchMinX =", + " cornerX +", + " minY -", + " cornerY +", + " epsilon +", + " (assistanceDirection === 6 ? cornerY - maxY : 0);", + " const searchMaxX =", + " cornerX +", + " maxY -", + " cornerY -", + " epsilon +", + " (assistanceDirection === 2 ? cornerY - minY : 0);", + " const searchMinY =", + " cornerY +", + " minX -", + " cornerX +", + " epsilon +", + " (assistanceDirection === 4 ? cornerX - maxX : 0);", + " const searchMaxY =", + " cornerY +", + " maxX -", + " cornerX -", + " epsilon +", + " (assistanceDirection === 0 ? cornerX - minX : 0);", + "", + " anyObstacle = this.obstacleManager.anyObstacle(", + " searchMinX,", + " searchMaxX,", + " searchMinY,", + " searchMaxY,", + " this.collidingObjects", + " );", + " }", + " // reflection symmetry: y = -x", + " // 0 to 2, 2 to 0, 4 to 6, 6 to 4", + " else if ((direction + assistanceDirection) % 8 === 2) {", + " // Because the obstacle may not be a square.", + " let cornerX = 0;", + " let cornerY = 0;", + " if (assistanceDirection === 2 || assistanceDirection === 4) {", + " cornerX = bypassedObstacleAABB.min[0];", + " cornerY = bypassedObstacleAABB.max[1];", + " } else {", + " cornerX = bypassedObstacleAABB.max[0];", + " cornerY = bypassedObstacleAABB.min[1];", + " }", + " // / cornerX \\ / 0 -1 \\ / x - cornerX \\", + " // \\ cornerY / + \\ -1 0 / * \\ y - cornerY /", + " //", + " // min and max are switched by the symmetry.", + " // The symmetry image is extended to check there is no obstacle before going into the passage.", + " const searchMinX =", + " cornerX -", + " (maxY - cornerY) +", + " epsilon +", + " (assistanceDirection === 2 ? minY - cornerY : 0);", + " const searchMaxX =", + " cornerX -", + " (minY - cornerY) -", + " epsilon +", + " (assistanceDirection === 6 ? maxY - cornerY : 0);", + " const searchMinY =", + " cornerY -", + " (maxX - cornerX) +", + " epsilon +", + " (assistanceDirection === 0 ? minX - cornerX : 0);", + " const searchMaxY =", + " cornerY -", + " (minX - cornerX) -", + " epsilon +", + " (assistanceDirection === 4 ? maxX - cornerX : 0);", + "", + " anyObstacle = this.obstacleManager.anyObstacle(", + " searchMinX,", + " searchMaxX,", + " searchMinY,", + " searchMaxY,", + " this.collidingObjects", + " );", + " }", + " this.lastAnyObstacle = anyObstacle;", + " this.needToCheckBypassWay = false;", + "", + " if (anyObstacle) {", + " return this.noAssistance();", + " }", + " }", + "", + " this.result.inputDirection = direction;", + " this.result.assistanceLeft = assistanceLeft > 0;", + " this.result.assistanceRight = assistanceRight > 0;", + " this.result.assistanceUp = assistanceUp > 0;", + " this.result.assistanceDown = assistanceDown > 0;", + " this.result.isBypassX = isBypassX;", + " this.result.isBypassY = isBypassY;", + " this.result.stopMinX = stopMinX;", + " this.result.stopMinY = stopMinY;", + " this.result.stopMaxX = stopMaxX;", + " this.result.stopMaxY = stopMaxY;", + "", + " return assistanceDirection;", + " }", + "", + " /**", + " * @return {integer}", + " */", + " CornerSlider.prototype.noAssistance = function() {", + " this.result.isBypassX = false;", + " this.result.isBypassY = false;", + "", + " return -1;", + " }", + "", + " CornerSlider.prototype.applyCollision = function() {", + " this.checkCornerStop();", + " this.separateFromObstacles();", + " // check again because the object can be pushed on the stop limit,", + " // it won't be detected on the next frame and the alignment won't be applied.", + " this.checkCornerStop();", + " }", + "", + " /**", + " * Check if the object must take a corner.", + " *", + " * When the object reach the limit of an obstacle", + " * and it should take the corner according to the player intent,", + " * it is aligned right on this limit and the velocity is set in the right direction.", + " *", + " * This avoid issues with the inertia. For instance,", + " * when the object could go between 2 obstacles,", + " * with it will just fly over the hole because of its inertia.", + " */", + " CornerSlider.prototype.checkCornerStop = function() {", + " const objectAABB = this.getHitBoxesAABB();", + " const minX = objectAABB.min[0];", + " const minY = objectAABB.min[1];", + " const object = this.topDownBehavior.owner;", + "", + " const direction = this.result.inputDirection;", + " const leftKey = 3 <= direction && direction <= 5;", + " const upKey = 5 <= direction && direction <= 7;", + "", + " // Alignment: avoid to go too far and kind of drift or oscillate in front of a hole.", + " if (", + " this.result.isBypassX &&", + " ((this.result.assistanceLeft && minX <= this.result.stopMinX) ||", + " (this.result.assistanceRight && minX >= this.result.stopMaxX))", + " ) {", + " this.shift(", + " -minX +", + " (this.result.assistanceLeft", + " ? this.result.stopMinX", + " : this.result.stopMaxX),", + " 0", + " );", + " this.topDownBehavior._yVelocity =", + " (upKey ? -1 : 1) *", + " Math.sqrt(", + " this.topDownBehavior._xVelocity *", + " this.topDownBehavior._xVelocity +", + " this.topDownBehavior._yVelocity *", + " this.topDownBehavior._yVelocity", + " );", + " this.topDownBehavior._xVelocity = 0;", + " }", + " if (", + " this.result.isBypassY &&", + " ((this.result.assistanceUp && minY <= this.result.stopMinY) ||", + " (this.result.assistanceDown && minY >= this.result.stopMaxY))", + " ) {", + " this.shift(", + " 0,", + " -minY +", + " (this.result.assistanceUp", + " ? this.result.stopMinY", + " : this.result.stopMaxY)", + " );", + " this.topDownBehavior._xVelocity =", + " (leftKey ? -1 : 1) *", + " Math.sqrt(", + " this.topDownBehavior._xVelocity *", + " this.topDownBehavior._xVelocity +", + " this.topDownBehavior._yVelocity *", + " this.topDownBehavior._yVelocity", + " );", + " this.topDownBehavior._yVelocity = 0;", + " }", + " }", + "", + " /**", + " * Separate from TopDownObstacleRuntimeBehavior instances.", + " */", + " CornerSlider.prototype.separateFromObstacles = function() {", + " const object = this.topDownBehavior.owner;", + " const objectAABB = this.getHitBoxesAABB();", + " const minX = objectAABB.min[0];", + " const minY = objectAABB.min[1];", + " const maxX = objectAABB.max[0];", + " const maxY = objectAABB.max[1];", + "", + " // Search the obstacle with the biggest intersection", + " // to separate from this one first.", + " // Because smaller collisions may shift the player", + " // in the wrong direction.", + " let maxSurface = 0;", + " /** @type {gdjs.RuntimeBehavior | null} */", + " let bestObstacleBehavior = null;", + " for (var i = 0; i < this.potentialCollidingObjects.length; ++i) {", + " const obstacleBehavior = this.potentialCollidingObjects[i];", + " if (obstacleBehavior.behavior.owner === object) {", + " continue;", + " }", + "", + " const obstacleAABB = obstacleBehavior.getHitBoxesAABB();", + " const obstacleMinX = obstacleAABB.min[0];", + " const obstacleMinY = obstacleAABB.min[1];", + " const obstacleMaxX = obstacleAABB.max[0];", + " const obstacleMaxY = obstacleAABB.max[1];", + "", + " const interMinX = Math.max(minX, obstacleMinX);", + " const interMinY = Math.max(minY, obstacleMinY);", + " const interMaxX = Math.min(maxX, obstacleMaxX);", + " const interMaxY = Math.min(maxY, obstacleMaxY);", + "", + " if (interMinX < interMaxX && interMinY < interMaxY) {", + " const surface = (interMaxX - interMinX) * (interMaxY - interMinY);", + " if (surface > maxSurface) {", + " maxSurface = surface;", + " bestObstacleBehavior = obstacleBehavior;", + " }", + " }", + " }", + " if (bestObstacleBehavior !== null) {", + " this.separateFrom(bestObstacleBehavior);", + " }", + " for (var i = 0; i < this.potentialCollidingObjects.length; ++i) {", + " const obstacleBehavior = this.potentialCollidingObjects[i];", + " const obstacle = obstacleBehavior.behavior.owner;", + " if (obstacle === object) {", + " continue;", + " }", + " this.separateFrom(obstacleBehavior);", + " }", + " }", + "", + " /**", + " * Separate object and obstacle, only object move.", + " * @param {Obstacle} obstacleBehavior", + " */", + " CornerSlider.prototype.separateFrom = function(obstacleBehavior) {", + " const objectAABB = this.getHitBoxesAABB();", + " const minX = objectAABB.min[0];", + " const minY = objectAABB.min[1];", + " const maxX = objectAABB.max[0];", + " const maxY = objectAABB.max[1];", + "", + " const obstacleAABB = obstacleBehavior.getHitBoxesAABB();", + " const obstacleMinX = obstacleAABB.min[0];", + " const obstacleMinY = obstacleAABB.min[1];", + " const obstacleMaxX = obstacleAABB.max[0];", + " const obstacleMaxY = obstacleAABB.max[1];", + "", + " const leftDistance = maxX - obstacleMinX;", + " const upDistance = maxY - obstacleMinY;", + " const rightDistance = obstacleMaxX - minX;", + " const downDistance = obstacleMaxY - minY;", + " const minDistance = Math.min(", + " leftDistance,", + " upDistance,", + " rightDistance,", + " downDistance", + " );", + "", + " if (minDistance > 0) {", + " if (leftDistance === minDistance) {", + " this.shift(-maxX + obstacleMinX, 0);", + " } else if (rightDistance === minDistance) {", + " this.shift(-minX + obstacleMaxX, 0);", + " } else if (upDistance === minDistance) {", + " this.shift(0, -maxY + obstacleMinY);", + " } else if (downDistance === minDistance) {", + " this.shift(0, -minY + obstacleMaxY);", + " }", + " }", + " }", + "", + "/**", + " * @param {float} deltaX", + " * @param {float} deltaY", + " */", + " CornerSlider.prototype.shift = function (deltaX, deltaY) {", + " this.transformedPosition[0] += deltaX;", + " this.transformedPosition[1] += deltaY;", + " }", + "", + " /**", + " * @return {gdjs.AABB}", + " */", + " CornerSlider.prototype.getHitBoxesAABB = function() {", + " if (!this.hitBoxesAABBUpToDate) {", + " const hitBoxes = this.topDownBehavior.owner.getHitBoxes();", + "", + " let minX = Number.MAX_VALUE;", + " let minY = Number.MAX_VALUE;", + " let maxX = -Number.MAX_VALUE;", + " let maxY = -Number.MAX_VALUE;", + " for (let h = 0, lenh = hitBoxes.length; h < lenh; ++h) {", + " let hitBox = hitBoxes[h];", + " for (let p = 0, lenp = hitBox.vertices.length; p < lenp; ++p) {", + " const point = this.topDownBehavior", + " ._temporaryPointForTransformations;", + " // TODO Handle isometry", + " // if (this.topDownBehavior._basisTransformation) {", + " // this.topDownBehavior._basisTransformation.toWorld(", + " // hitBox.vertices[p],", + " // point", + " // );", + " // } else {", + " point[0] = hitBox.vertices[p][0];", + " point[1] = hitBox.vertices[p][1];", + " // }", + " minX = Math.min(minX, point[0]);", + " maxX = Math.max(maxX, point[0]);", + " minY = Math.min(minY, point[1]);", + " maxY = Math.max(maxY, point[1]);", + " }", + " }", + " this.relativeHitBoxesAABB.min[0] = minX - this.transformedPosition[0];", + " this.relativeHitBoxesAABB.min[1] = minY - this.transformedPosition[1];", + " this.relativeHitBoxesAABB.max[0] = maxX - this.transformedPosition[0];", + " this.relativeHitBoxesAABB.max[1] = maxY - this.transformedPosition[1];", + "", + " this.hitBoxesAABBUpToDate = true;", + " }", + " this.absoluteHitBoxesAABB.min[0] =", + " this.relativeHitBoxesAABB.min[0] + this.transformedPosition[0];", + " this.absoluteHitBoxesAABB.min[1] =", + " this.relativeHitBoxesAABB.min[1] + this.transformedPosition[1];", + " this.absoluteHitBoxesAABB.max[0] =", + " this.relativeHitBoxesAABB.max[0] + this.transformedPosition[0];", + " this.absoluteHitBoxesAABB.max[1] =", + " this.relativeHitBoxesAABB.max[1] + this.transformedPosition[1];", + " return this.absoluteHitBoxesAABB;", + " }", + "", + " /**", + " * Update _potentialCollidingObjects member with platforms near the object.", + " * @param {float} maxMovementLength", + " */", + " CornerSlider.prototype.updatePotentialCollidingObjects = function(maxMovementLength) {", + " this.obstacleManager.getAllObstaclesAround(", + " this.getHitBoxesAABB(),", + " maxMovementLength,", + " this.potentialCollidingObjects", + " );", + " }", + "", + " return CornerSlider;", + "}());", + "", + "", + "/**", + " * TopDownMovementRuntimeBehavior represents a behavior allowing objects to", + " * follow a path computed to avoid obstacles.", + " */", + "const AssistanceResult = /** @class */ (function () {", + " function AssistanceResult() {", + " this.inputDirection = -1;", + " this.assistanceLeft = false;", + " this.assistanceRight = false;", + " this.assistanceUp = false;", + " this.assistanceDown = false;", + " this.isBypassX = false;", + " this.isBypassY = false;", + " this.stopMinX = 0;", + " this.stopMinY = 0;", + " this.stopMaxX = 0;", + " this.stopMaxY = 0;", + " }", + "", + " return AssistanceResult;", + "}());", + "", + " /**", + " * Allow to store a behavior in a RBush (spatial data structure).", + " * Because this duplicates the AABB, this ensures the RBush AABB", + " * stays the same even if the underlying object is moved", + " * (in which case the behavior is responsible for removing/adding", + " * back/updating this BehaviorRBushAABB).", + " */", + " const ObstacleRBushAABB = /** @class */ (function () {", + " /**", + " * @param {Obstacle} obstacle", + " */", + " function ObstacleRBushAABB(obstacle) {", + " this.obstacle = obstacle;", + " this.minX = 0;", + " this.minY = 0;", + " this.maxX = 0;", + " this.maxY = 0;", + " this.updateAABBFromOwner();", + " }", + "", + " ObstacleRBushAABB.prototype.updateAABBFromOwner = function () {", + " const aabb = this.obstacle.getHitBoxesAABB();", + " this.minX = aabb.min[0];", + " this.minY = aabb.min[1];", + " this.maxX = aabb.max[0];", + " this.maxY = aabb.max[1];", + " }", + "", + " return ObstacleRBushAABB;", + "}());", + "", + "/**", + " * An obstacle manager for fast spacial search.", + " */", + "const ObstacleManager = /** @class */ (function () {", + " /**", + " * Create a manager.", + " */", + " function ObstacleManager() {", + " this.obstacleRBush = new rbush();", + " }", + "", + " /**", + " * Get the obstacle manager of an instance container.", + " * @param {gdjs.RuntimeInstanceContainer} instanceContainer", + " * @return {ObstacleManager}", + " */", + " ObstacleManager.getManager = function (instanceContainer) {", + " if (!instanceContainer.__topDownCornerSlidingExtension) {", + " instanceContainer.__topDownCornerSlidingExtension = {};", + " }", + " if (!instanceContainer.__topDownCornerSlidingExtension.manager) {", + " // Create the shared manager if necessary.", + " instanceContainer.__topDownCornerSlidingExtension.manager = new ObstacleManager();", + " }", + " return instanceContainer.__topDownCornerSlidingExtension.manager;", + " };", + "", + " /**", + " * Register an obstacle.", + " * @param {Obstacle} obstacle", + " */", + " ObstacleManager.prototype.addObstacle = function (obstacle) {", + " obstacle.currentRBushAABB.updateAABBFromOwner();", + " this.obstacleRBush.insert(obstacle.currentRBushAABB);", + " }", + "", + " /**", + " * Unregister an obstacle.", + " * @param {Obstacle} obstacle", + " */", + " ObstacleManager.prototype.removeObstacle = function (obstacle) {", + " this.obstacleRBush.remove(obstacle.currentRBushAABB);", + " }", + "", + " /**", + " * Returns all the boids around the specified boid.", + " * @param {gdjs.AABB} aabb", + " * @param {number} maxMovementLength", + " * @param {Obstacle[]} result the returned array.", + " * @return {Obstacle[]} An array with all obstacles near the object.", + " */", + " ObstacleManager.prototype.getAllObstaclesAround = function (aabb, maxMovementLength, result) {", + " const searchArea = gdjs.staticObject(", + " ObstacleManager.prototype.getAllObstaclesAround", + " );", + " searchArea.minX = aabb.min[0] - maxMovementLength;", + " searchArea.minY = aabb.min[1] - maxMovementLength;", + " searchArea.maxX = aabb.max[0] + maxMovementLength;", + " searchArea.maxY = aabb.max[1] + maxMovementLength;", + " /** @type {ObstacleRBushAABB[]} */", + " const nearbyObstacles = this.obstacleRBush.search(searchArea);", + "", + " result.length = 0;", + " for (let i = 0; i < nearbyObstacles.length; i++) {", + " const obstacle = nearbyObstacles[i].obstacle;", + " result.push(obstacle);", + " }", + "", + " return result;", + " }", + "", + " /**", + " * Returns true if there is any obstacle intersecting the area.", + " * @param {number} minX", + " * @param {number} maxX", + " * @param {number} minY", + " * @param {number} maxY", + " * @param {gdjs.RuntimeObject[]} excluded", + " * @return {boolean}", + " */", + " ObstacleManager.prototype.anyObstacle = function (", + " minX,", + " maxX,", + " minY,", + " maxY,", + " excluded", + " ) {", + " const searchArea = gdjs.staticObject(", + " ObstacleManager.prototype.anyObstacle", + " );", + " // @ts-ignore", + " searchArea.minX = minX;", + " // @ts-ignore", + " searchArea.minY = minY;", + " // @ts-ignore", + " searchArea.maxX = maxX;", + " // @ts-ignore", + " searchArea.maxY = maxY;", + " /** @type {ObstacleRBushAABB[]} */", + " const nearbyObstacles = this.obstacleRBush.search(searchArea);", + "", + " for (let i = 0; i < nearbyObstacles.length; i++) {", + " if (!excluded.includes(nearbyObstacles[i].obstacle.behavior.owner)) {", + " return true;", + " }", + " }", + " return false;", + " }", + "", + " return ObstacleManager;", + "}());", + "", + "/**", + " * NavMeshPathfindingObstacleRuntimeBehavior represents a behavior allowing objects to be", + " * considered as a obstacle by objects having Pathfinding Behavior.", + " */", + "const Obstacle = /** @class */ (function () {", + " /**", + " * ", + " * @param {gdjs.RuntimeInstanceContainer} instanceContainer", + " * @param {gdjs.RuntimeBehavior} behavior", + " */", + " function Obstacle(instanceContainer, behavior) {", + " this.oldX = 0;", + " this.oldY = 0;", + " this.oldWidth = 0;", + " this.oldHeight = 0;", + " this.registeredInManager = false;", + " this.behavior = behavior;", + " this.manager = ObstacleManager.getManager(instanceContainer);", + " // Note that we can't use getX(), getWidth()... of owner here:", + " // The owner is not yet fully constructed.", + " /** @type {gdjs.AABB} */", + " this.hitBoxesAABB = { min: [0, 0], max: [0, 0] };", + " this.hitBoxesAABBUpToDate = false;", + " ", + " /** @type {FloatPoint} */", + " this.point = [0, 0];", + " this.currentRBushAABB = new ObstacleRBushAABB(this);", + " }", + " Obstacle.prototype.onCreated = function () {", + " this.manager.addObstacle(this);", + " this.registeredInManager = true;", + " };", + " Obstacle.prototype.onDestroy = function () {", + " if (this.manager && this.registeredInManager) {", + " this.manager.removeObstacle(this);", + " }", + " };", + " Obstacle.prototype.doStepPreEvents = function (instanceContainer) {", + " var owner = this.behavior.owner;", + " // Make sure the obstacle is or is not in the obstacles manager.", + " if (!this.behavior.activated() && this.registeredInManager) {", + " this.manager.removeObstacle(this);", + " this.registeredInManager = false;", + " }", + " else {", + " if (this.behavior.activated() && !this.registeredInManager) {", + " this.manager.addObstacle(this);", + " this.registeredInManager = true;", + " }", + " }", + " // Track changes in size or position", + " if (this.oldX !== owner.getX() ||", + " this.oldY !== owner.getY() ||", + " this.oldWidth !== owner.getWidth() ||", + " this.oldHeight !== owner.getHeight()) {", + " this.hitBoxesAABBUpToDate = false;", + " if (this.registeredInManager) {", + " this.manager.removeObstacle(this);", + " this.manager.addObstacle(this);", + " }", + " this.oldX = owner.getX();", + " this.oldY = owner.getY();", + " this.oldWidth = owner.getWidth();", + " this.oldHeight = owner.getHeight();", + " }", + " };", + " Obstacle.prototype.doStepPostEvents = function (instanceContainer) { };", + " Obstacle.prototype.onActivate = function () {", + " if (this.registeredInManager) {", + " return;", + " }", + " this.manager.addObstacle(this);", + " this.registeredInManager = true;", + " };", + " Obstacle.prototype.onDeActivate = function () {", + " if (!this.registeredInManager) {", + " return;", + " }", + " this.manager.removeObstacle(this);", + " this.registeredInManager = false;", + " };", + "", + " /**", + " * @return {gdjs.AABB}", + " */", + " Obstacle.prototype.getHitBoxesAABB = function() {", + " if (!this.hitBoxesAABBUpToDate) {", + " const hitBoxes = this.behavior.owner.getHitBoxes();", + "", + " let minX = Number.MAX_VALUE;", + " let minY = Number.MAX_VALUE;", + " let maxX = -Number.MAX_VALUE;", + " let maxY = -Number.MAX_VALUE;", + " for (let h = 0, lenh = hitBoxes.length; h < lenh; ++h) {", + " let hitBox = hitBoxes[h];", + " for (let p = 0, lenp = hitBox.vertices.length; p < lenp; ++p) {", + " const point = this.point;", + " // TODO Handle Isometry", + " //this._basisTransformation.toWorld(hitBox.vertices[p], point);", + " point[0] = hitBox.vertices[p][0];", + " point[1] = hitBox.vertices[p][1];", + "", + " minX = Math.min(minX, point[0]);", + " maxX = Math.max(maxX, point[0]);", + " minY = Math.min(minY, point[1]);", + " maxY = Math.max(maxY, point[1]);", + " }", + " }", + " this.hitBoxesAABB.min[0] = minX;", + " this.hitBoxesAABB.min[1] = minY;", + " this.hitBoxesAABB.max[0] = maxX;", + " this.hitBoxesAABB.max[1] = maxY;", + "", + " this.hitBoxesAABBUpToDate = true;", + " }", + " return this.hitBoxesAABB;", + " }", + "", + " return Obstacle;", + "}());", + "", + "gdjs.__topDownCornerSlidingExtension = gdjs.__topDownCornerSlidingExtension || {};", + "gdjs.__topDownCornerSlidingExtension.CornerSlider = CornerSlider;", + "gdjs.__topDownCornerSlidingExtension.Obstacle = Obstacle;", + "", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ] + } + ], + "parameters": [], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Slide on corners of rectangular obstacles.", + "fullName": "Top-down corner slider", + "name": "TopDownCornerSlider", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TopDownCornerSliding::DefineJavaScriptForTopDown" + }, + "parameters": [ + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const object = objects[0];\r", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", + "const behavior = object.getBehavior(behaviorName);\r", + "\r", + "/** @type {gdjs.TopDownMovementRuntimeBehavior} */\r", + "const topDownBehavior = object.getBehavior(behavior._getTopDownMovement());\r", + "\r", + "behavior.__topDownCornerSlidingExtension = behavior.__topDownCornerSlidingExtension || {};\r", + "behavior.__topDownCornerSlidingExtension.cornerSlider = new gdjs.__topDownCornerSlidingExtension.CornerSlider(runtimeScene, behavior, topDownBehavior);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TopDownCornerSliding::TopDownCornerSlider", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Top-down movement behavior", + "description": "", + "group": "", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" + ], + "hidden": false, + "name": "TopDownMovement" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Flag objects as obstacles for top-down characters.", + "fullName": "Top-down corner slider obstacle", + "name": "TopDownCornerSliderObstacle", + "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": "TopDownCornerSliding::DefineJavaScriptForTopDown" + }, + "parameters": [ + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", + "const behavior = object.getBehavior(behaviorName);\r", + "\r", + "behavior.__topDownCornerSlidingExtension = behavior.__topDownCornerSlidingExtension || {};\r", + "behavior.__topDownCornerSlidingExtension.obstacle =\r", + " new gdjs.__topDownCornerSlidingExtension.Obstacle(runtimeScene, behavior);\r", + "behavior.__topDownCornerSlidingExtension.obstacle.onCreated(runtimeScene, behavior);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TopDownCornerSliding::TopDownCornerSliderObstacle", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", + "const behavior = object.getBehavior(behaviorName);\r", + "\r", + "behavior.__topDownCornerSlidingExtension.obstacle.doStepPreEvents(runtimeScene);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TopDownCornerSliding::TopDownCornerSliderObstacle", + "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);", + "", + "behavior.__topDownCornerSlidingExtension.obstacle.onActivate(runtimeScene);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TopDownCornerSliding::TopDownCornerSliderObstacle", + "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);", + "", + "behavior.__topDownCornerSlidingExtension.obstacle.onDeActivate(runtimeScene);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TopDownCornerSliding::TopDownCornerSliderObstacle", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDestroy", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "", + "behavior.__topDownCornerSlidingExtension.obstacle.onDestroy(runtimeScene);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TopDownCornerSliding::TopDownCornerSliderObstacle", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Sliding corner size", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "SlidingCornerSize" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "Bouh", + "category": "Input", + "extensionNamespace": "", + "fullName": "Gamepads (controllers)", + "helpPath": "/all-features/gamepad", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWdhbWVwYWQtdmFyaWFudC1vdXRsaW5lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTYsOUg4VjExSDEwVjEzSDhWMTVINlYxM0g0VjExSDZWOU0xOC41LDlBMS41LDEuNSAwIDAsMSAyMCwxMC41QTEuNSwxLjUgMCAwLDEgMTguNSwxMkExLjUsMS41IDAgMCwxIDE3LDEwLjVBMS41LDEuNSAwIDAsMSAxOC41LDlNMTUuNSwxMkExLjUsMS41IDAgMCwxIDE3LDEzLjVBMS41LDEuNSAwIDAsMSAxNS41LDE1QTEuNSwxLjUgMCAwLDEgMTQsMTMuNUExLjUsMS41IDAgMCwxIDE1LjUsMTJNMTcsNUE3LDcgMCAwLDEgMjQsMTJBNyw3IDAgMCwxIDE3LDE5QzE1LjA0LDE5IDEzLjI3LDE4LjIgMTIsMTYuOUMxMC43MywxOC4yIDguOTYsMTkgNywxOUE3LDcgMCAwLDEgMCwxMkE3LDcgMCAwLDEgNyw1SDE3TTcsN0E1LDUgMCAwLDAgMiwxMkE1LDUgMCAwLDAgNywxN0M4LjY0LDE3IDEwLjA5LDE2LjIxIDExLDE1SDEzQzEzLjkxLDE2LjIxIDE1LjM2LDE3IDE3LDE3QTUsNSAwIDAsMCAyMiwxMkE1LDUgMCAwLDAgMTcsN0g3WiIgLz48L3N2Zz4=", + "name": "Gamepads", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/gamepad-variant-outline.svg", + "shortDescription": "Add support for gamepads (or other controllers) to your game, giving access to information such as button presses, axis positions, trigger pressure, etc...", + "version": "0.5.0", + "description": [ + "Add support for gamepads (or other controllers).", + "", + "It gives access to:", + "- button presses", + "- axis positions and force", + "- trigger pressure", + "- configurable deadzone", + "- vibration", + "- automatic mappers for platformer characters and top-down movement", + "", + "The Bomberman-like example handles 4 players with gamepads ([open the project online](https://editor.gdevelop.io/?project=example://goose-bomberman))." + ], + "origin": { + "identifier": "Gamepads", + "name": "gdevelop-extension-store" + }, + "tags": [ + "controllers", + "gamepads", + "joysticks", + "axis", + "xbox", + "ps4" + ], + "authorIds": [ + "2OwwM8ToR9dx9RJ2sAKTcrLmCB92", + "taRwmWxwAFYFL9yyBwB3cwBw0BO2", + "mnImQKdn8nQxwzkS5D6a1JB27V23" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Get the value of the pressure on a gamepad trigger.", + "fullName": "Pressure on a gamepad trigger", + "functionType": "Expression", + "name": "TriggerPressure", + "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const trigger = eventsFunctionContext.getArgument(\"trigger\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in expression: \"Pressure on a gamepad trigger\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (trigger != \"LT\" && trigger != \"RT\" && trigger != \"L2\" && trigger != \"R2\") {\r", + " console.error('Parameter trigger is not valid in expression: \"Pressure on a gamepad trigger\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "switch (trigger) {\r", + " case 'LT':\r", + " case 'L2':\r", + " eventsFunctionContext.returnValue = gamepad.buttons[6].value;\r", + " break;\r", + "\r", + " case 'RT':\r", + " case 'R2':\r", + " eventsFunctionContext.returnValue = gamepad.buttons[7].value;\r", + " break;\r", + "\r", + " default:\r", + " eventsFunctionContext.returnValue = -1;\r", + " break;\r", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Trigger button", + "name": "trigger", + "supplementaryInformation": "[\"LT\",\"RT\",\"L2\",\"R2\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Get the force value of a gamepad stick.\n0 is stick on default position, 1 is at the maximum.", + "fullName": "Value of a stick force", + "functionType": "Expression", + "name": "StickForce", + "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick force\"');\r", + " return;\r", + "}\r", + "\r", + "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a stick force\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId)), 0, 1);\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId)), 0, 1);\r", + " break;\r", + "\r", + " default:\r", + " eventsFunctionContext.returnValue = -1;\r", + " break;\r", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Get the rotation value of a gamepad stick.\nIf the deadzone value is high, the angle value is rounded to main axes, left, left, up, down.\nAn zero deadzone value give a total freedom on the angle value.", + "fullName": "Value of a stick rotation", + "functionType": "Expression", + "name": "StickRotationValue", + "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick rotation\"');\r", + " return;\r", + "}\r", + "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a stick rotation\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId));\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId));\r", + " break;\r", + "\r", + " default:\r", + " eventsFunctionContext.returnValue = -1;\r", + " break;\r", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Get the value of axis of a gamepad stick.", + "fullName": "Value of a gamepad axis", + "functionType": "Expression", + "name": "AxisValue", + "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (stick != \"LEFT\" && stick != \"RIGHT\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (direction != \"UP\" && direction != \"DOWN\" && direction != \"LEFT\" && direction != \"RIGHT\" && direction != \"HORIZONTAL\" && direction != \"VERTICAL\") {\r", + " console.error('Parameter direction is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let parameterError = false;\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", + " }\r", + " break;\r", + "\r", + " case \"HORIZONTAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", + " break;\r", + "\r", + " case \"VERTICAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", + " break;\r", + "\r", + " default:\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", + " }\r", + " break;\r", + "\r", + " case \"HORIZONTAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", + " break;\r", + "\r", + " case \"VERTICAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", + " break;\r", + "\r", + " default:\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " break;\r", + "}\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + }, + { + "description": "Direction", + "name": "direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"Horizontal\",\"Vertical\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Test if a button is released on a gamepad. Buttons can be:\n* Xbox: \"A\", \"B\", \"X\", \"Y\", \"LB\", \"RB\", \"LT\", \"RT\", \"BACK\", \"START\",\n* PS4: \"CROSS\", \"SQUARE\", \"CIRCLE\", \"TRIANGLE\", \"L1\", \"L2\", \"R1\", \"R2\", \"SHARE\", \"OPTIONS\", \"PS_BUTTON\", \"CLICK_TOUCHPAD\",\n* Other: \"UP\", \"DOWN\", \"LEFT\", \"RIGHT\", \"CLICK_STICK_LEFT\", \"CLICK_STICK_RIGHT\".", + "fullName": "Gamepad button released", + "functionType": "Condition", + "name": "C_Button_released", + "sentence": "Button _PARAM2_ of gamepad _PARAM1_ is released", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Gamepad button released\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (button === \"\") {\r", + " console.error('Parameter button is not valid in condition: \"Gamepad button released\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let buttonId;\r", + "\r", + "switch (button) {\r", + " case 'A':\r", + " case 'CROSS':\r", + " buttonId = 0;\r", + " break;\r", + " case 'B':\r", + " case 'CIRCLE':\r", + " buttonId = 1;\r", + " break;\r", + " case 'X':\r", + " case 'SQUARE':\r", + " buttonId = 2;\r", + " break;\r", + " case 'Y':\r", + " case 'TRIANGLE':\r", + " buttonId = 3;\r", + " break;\r", + " case 'LB':\r", + " case 'L1':\r", + " buttonId = 4;\r", + " break;\r", + " case 'RB':\r", + " case 'R1':\r", + " buttonId = 5;\r", + " break;\r", + " case 'LT':\r", + " case 'L2':\r", + " buttonId = 6;\r", + " break;\r", + " case 'RT':\r", + " case 'R2':\r", + " buttonId = 7;\r", + " break;\r", + "\r", + " case 'UP':\r", + " buttonId = 12;\r", + " break;\r", + " case 'DOWN':\r", + " buttonId = 13;\r", + " break;\r", + " case 'LEFT':\r", + " buttonId = 14;\r", + " break;\r", + " case 'RIGHT':\r", + " buttonId = 15;\r", + " break;\r", + "\r", + " case 'BACK':\r", + " case 'SHARE':\r", + " buttonId = 8;\r", + " break;\r", + " case 'START':\r", + " case 'OPTIONS':\r", + " buttonId = 9;\r", + " break;\r", + "\r", + " case 'CLICK_STICK_LEFT':\r", + " buttonId = 10;\r", + " break;\r", + " case 'CLICK_STICK_RIGHT':\r", + " buttonId = 11;\r", + " break;\r", + "\r", + " //PS4\r", + " case 'PS_BUTTON':\r", + " buttonId = 16;\r", + " break;\r", + " case 'CLICK_TOUCHPAD':\r", + " buttonId = 17;\r", + " break;\r", + "\r", + " default:\r", + " console.error('The button: ' + button + ' in condition: \"Gamepad button released\" is not valid.');\r", + " break;\r", + "}\r", + "\r", + "if (buttonId === undefined) {\r", + " console.error('There is no buttons valid in condition: \"Gamepad button released\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", + " console.error('Buttons on the gamepad are not accessible in condition: \"Gamepad button released\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "//Define default value on pressed button or use previous value\r", + "gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] || { pressed: false };\r", + "\r", + "//Get state of button at previous frame\r", + "const previousStateButton = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed;\r", + "\r", + "//When previousStateButton is true and actual button state is not pressed\r", + "//Player have release the button\r", + "if (previousStateButton === true && gamepad.buttons[buttonId].pressed === false) {\r", + " // Save the last button used for the player \r", + " gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + " gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = true;\r", + " eventsFunctionContext.returnValue = true;\r", + "\r", + "} else {\r", + " gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = false;\r", + " eventsFunctionContext.returnValue = false;\r", + "}\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Name of the button", + "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": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the index of the last pressed button of a gamepad.", + "fullName": "Last pressed button (id)", + "functionType": "Expression", + "name": "LastButtonID", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "//Player id is not valid\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in expression: \"Last pressed button (id)\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "\r", + "//Return the last button used by the player\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].lastButtonUsed;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if any button is pressed on a gamepad.", + "fullName": "Any gamepad button pressed", + "functionType": "Condition", + "name": "C_Any_Button_pressed", + "sentence": "Any button of gamepad _PARAM1_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Any gamepad button pressed\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let buttonId;\r", + "for (let i = 0; i < gamepad.buttons.length; i++) { //For each buttons\r", + " if (gamepad.buttons[i].pressed) { //One of them is pressed\r", + " buttonId = i; //Save the button pressed\r", + " break;\r", + " }\r", + "}\r", + "\r", + "if (buttonId === undefined) {\r", + " // No buttons are pressed.\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", + " console.error('Buttons on the gamepad are not accessible in condition: \"Any gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "//When a button is pressed, save the button in lastButtonUsed for each players\r", + "if (gamepad.buttons[buttonId].pressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + "eventsFunctionContext.returnValue = gamepad.buttons[buttonId].pressed;\r", + "\r", + "\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the last button pressed. \nButtons for Xbox and PS4 can be:\n* Xbox: \"A\", \"B\", \"X\", \"Y\", \"LB\", \"RB\", \"LT\", \"RT\", \"BACK\", \"START\",\n* PS4: \"CROSS\", \"SQUARE\", \"CIRCLE\", \"TRIANGLE\", \"L1\", \"L2\", \"R1\", \"R2\", \"SHARE\", \"OPTIONS\", \"PS_BUTTON\", \"CLICK_TOUCHPAD\",\n* Both: \"UP\", \"DOWN\", \"LEFT\", \"RIGHT\", \"CLICK_STICK_LEFT\", \"CLICK_STICK_RIGHT\".", + "fullName": "Last pressed button (string)", + "functionType": "StringExpression", + "name": "LastButtonString", + "sentence": "Button _PARAM2_ of gamepad _PARAM1_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in string expression: \"Last pressed button (LastButtonString)\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (controllerType === \"\") {\r", + " console.error('Parameter controller type is not valid in string expression: \"Last pressed button (LastButtonString)\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "if (gamepad !== null) { //Gamepad exist\r", + " //Get last btn id\r", + " const lastButtonUsedID = gdjs._extensionController.players[playerId].lastButtonUsed;\r", + "\r", + " //Return last button as string \r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getInputString(controllerType, lastButtonUsedID);\r", + "\r", + "} else { //Gamepad dosen't exist\r", + " console.error('Your controller is not supported or the gamepad wasn\\'t detected in string expression: \"Last pressed button (LastButtonString)\"');\r", + " eventsFunctionContext.returnValue = \"Gamepad not connected\";\r", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Controller type", + "name": "controller_type", + "supplementaryInformation": "[\"Xbox\",\"PS4\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the number of gamepads.", + "fullName": "Gamepad count", + "functionType": "Expression", + "name": "GamepadCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get the last activated controller\r", + "const controllerId = gdjs._extensionController.lastActiveController;\r", + "\r", + "// Check if controller is active\r", + "const gamepad = gamepads[controllerId];\r", + "if (gamepad == null) {\r", + " eventsFunctionContext.returnValue = 0;\r", + "} else {\r", + " // Return active controller id\r", + " eventsFunctionContext.returnValue = controllerId + 1;\r", + "}\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Check if a button is pressed on a gamepad. \nButtons can be:\n* Xbox: \"A\", \"B\", \"X\", \"Y\", \"LB\", \"RB\", \"LT\", \"RT\", \"BACK\", \"START\",\n* PS4: \"CROSS\", \"SQUARE\", \"CIRCLE\", \"TRIANGLE\", \"L1\", \"L2\", \"R1\", \"R2\", \"SHARE\", \"OPTIONS\", \"PS_BUTTON\", \"CLICK_TOUCHPAD\",\n* Other: \"UP\", \"DOWN\", \"LEFT\", \"RIGHT\", \"CLICK_STICK_LEFT\", \"CLICK_STICK_RIGHT\".", + "fullName": "Gamepad button pressed", + "functionType": "Condition", + "name": "C_Button_pressed", + "sentence": "Button _PARAM2_ of gamepad _PARAM1_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Gamepad button pressed\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (button === \"\") {\r", + " console.error('Parameter button is not valid in condition: \"Gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let buttonId;\r", + "\r", + "switch (button) {\r", + " case 'A':\r", + " case 'CROSS':\r", + " buttonId = 0;\r", + " break;\r", + " case 'B':\r", + " case 'CIRCLE':\r", + " buttonId = 1;\r", + " break;\r", + " case 'X':\r", + " case 'SQUARE':\r", + " buttonId = 2;\r", + " break;\r", + " case 'Y':\r", + " case 'TRIANGLE':\r", + " buttonId = 3;\r", + " break;\r", + " case 'LB':\r", + " case 'L1':\r", + " buttonId = 4;\r", + " break;\r", + " case 'RB':\r", + " case 'R1':\r", + " buttonId = 5;\r", + " break;\r", + " case 'LT':\r", + " case 'L2':\r", + " buttonId = 6;\r", + " break;\r", + " case 'RT':\r", + " case 'R2':\r", + " buttonId = 7;\r", + " break;\r", + "\r", + " case 'UP':\r", + " buttonId = 12;\r", + " break;\r", + " case 'DOWN':\r", + " buttonId = 13;\r", + " break;\r", + " case 'LEFT':\r", + " buttonId = 14;\r", + " break;\r", + " case 'RIGHT':\r", + " buttonId = 15;\r", + " break;\r", + "\r", + " case 'BACK':\r", + " case 'SHARE':\r", + " buttonId = 8;\r", + " break;\r", + " case 'START':\r", + " case 'OPTIONS':\r", + " buttonId = 9;\r", + " break;\r", + "\r", + " case 'CLICK_STICK_LEFT':\r", + " buttonId = 10;\r", + " break;\r", + " case 'CLICK_STICK_RIGHT':\r", + " buttonId = 11;\r", + " break;\r", + "\r", + " //PS4\r", + " case 'PS_BUTTON':\r", + " buttonId = 16;\r", + " break;\r", + " case 'CLICK_TOUCHPAD':\r", + " buttonId = 17;\r", + " break;\r", + "\r", + " default:\r", + " console.error('The button: ' + button + ' in condition: \"Gamepad button pressed\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + "}\r", + "\r", + "\r", + "\r", + "if (buttonId === undefined) {\r", + " console.error('There is no buttons valid in condition: \"Gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", + " console.error('Buttons on the gamepad are not accessible in condition: \"Gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "//When a button is pressed, save the button in lastButtonUsed for each players\r", + "if (gamepad.buttons[buttonId].pressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + "eventsFunctionContext.returnValue = gamepad.buttons[buttonId].pressed;\r", + "\r", + "\r", + "\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Name of the button", + "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": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the value of the deadzone applied to a gamepad sticks, between 0 and 1.", + "fullName": "Gamepad deadzone for sticks", + "functionType": "Expression", + "name": "Deadzone", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in expression: \"Gamepad deadzone for sticks\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "///Return the deadzone value for a given player\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].deadzone;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set the deadzone for sticks of the gamepad. 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). Deadzone is between 0 and 1, and is by default 0.2.", + "fullName": "Set gamepad deadzone for sticks", + "functionType": "Action", + "name": "A_Set_deadzone", + "sentence": "Set deadzone for sticks on gamepad: _PARAM1_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const newDeadzone = eventsFunctionContext.getArgument(\"deadzone\");\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in action: \"Set gamepad deadzone for sticks\", is not valid, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "\r", + "// clamp the newDeadzone in range [0, 1].\r", + "// https://github.com/4ian/GDevelop-extensions/pull/33#issuecomment-618224857\r", + "gdjs._extensionController.players[playerId].deadzone = gdjs.evtTools.common.clamp(newDeadzone, 0, 1);\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Deadzone for sticks, 0.2 by default (0 to 1)", + "name": "deadzone", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a stick of a gamepad is pushed in a given direction.", + "fullName": "Gamepad stick pushed (axis)", + "functionType": "Condition", + "name": "C_Axis_pushed", + "sentence": "_PARAM2_ stick of gamepad _PARAM1_ is pushed in direction _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Gamepad stick pushed (axis)\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (stick != \"LEFT\" && stick != \"RIGHT\") {\r", + " console.error('Parameter stick in condition: \"Gamepad stick pushed (axis)\", is not valid, must be LEFT or RIGHT');\r", + " return;\r", + "}\r", + "if (direction != \"UP\" && direction != \"DOWN\" && direction != \"LEFT\" && direction != \"RIGHT\" && direction != \"ANY\") {\r", + " console.error('Parameter deadzone in condition: \"Gamepad stick pushed (axis)\", is not valid, must be UP, DOWN, LEFT or RIGHT');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) {\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "\r", + "//Define in onFirstSceneLoaded function\r", + "const getNormalizedAxisValue = gdjs._extensionController.getNormalizedAxisValue;\r", + "\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'ANY':\r", + " if ( getNormalizedAxisValue(gamepad.axes[0], playerId) < 0\r", + " || getNormalizedAxisValue(gamepad.axes[0], playerId) > 0\r", + " || getNormalizedAxisValue(gamepad.axes[1], playerId) < 0 \r", + " || getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " console.error('The value Direction on stick Left on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'ANY':\r", + " if ( getNormalizedAxisValue(gamepad.axes[2], playerId) < 0\r", + " || getNormalizedAxisValue(gamepad.axes[2], playerId) > 0\r", + " || getNormalizedAxisValue(gamepad.axes[3], playerId) < 0 \r", + " || getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " console.error('The value Direction on stick Right on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " console.error('The value Stick on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + "}\r", + "\r", + "eventsFunctionContext.returnValue = false;\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + }, + { + "description": "Direction", + "name": "direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"Any\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the number of connected gamepads.", + "fullName": "Connected gamepads number", + "functionType": "Expression", + "name": "ConnectedGamepadsCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "// Gamepads can be disconnected and become null, so we have to filter them.\r", + "eventsFunctionContext.returnValue = Object.keys(gamepads).filter(key => !!gamepads[key]).length;\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Return a string containing informations about the specified gamepad.", + "fullName": "Gamepad type", + "functionType": "StringExpression", + "name": "GamepadType", + "sentence": "Player _PARAM1_ use _PARAM2_ controller", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameter", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in string expression: \"Gamepad type\", is not valid number, must be between 0 and 4');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "eventsFunctionContext.returnValue = (gamepad && gamepad.id) ? gamepad.id : \"No information for player \" + (playerId + 1)", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the specified gamepad has the specified information in its description. Useful to know if the gamepad is a Xbox or PS4 controller.", + "fullName": "Gamepad type", + "functionType": "Condition", + "name": "C_Controller_type", + "sentence": "Gamepad _PARAM1_ is a _PARAM2_ controller", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", + "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in condition: \"Gamepad type\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "if (controllerType === \"\") {", + " console.error('Parameter type in condition: \"Gamepad type\", is not a string.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "", + "if (controllerType == \"XBOX\") {", + " eventsFunctionContext.returnValue = gdjs._extensionController.isXbox(gamepad);", + "} else {", + " eventsFunctionContext.returnValue = gamepad ? gamepad.id.toUpperCase().indexOf(controllerType) !== -1 : false;", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Type: \"Xbox\", \"PS4\", \"Steam\" or \"PS3\" (among other)", + "name": "controller_type", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a gamepad is connected.", + "fullName": "Gamepad connected", + "functionType": "Condition", + "name": "C_Controller_X_is_connected", + "sentence": "Gamepad _PARAM1_ is plugged and connected", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameter", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in condition: \"Gamepad connected\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "", + "// If gamepad was disconnected it will be null (so this will return false)", + "// If gamepad was never connected it will be undefined (so this will return false)", + "eventsFunctionContext.returnValue = !!gamepads[playerId];" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Generate a vibration on the specified controller. Might only work if the game is running in a recent web browser.", + "fullName": "Gamepad vibration", + "functionType": "Action", + "name": "A_Vibrate_controller", + "sentence": "Make gamepad _PARAM1_ vibrate for _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "//Vibration work only on game in browser.", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", + "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in action: \"Gamepad connected\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "if (gamepad && gamepad.vibrationActuator) {", + " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", + " startDelay: 0,", + " duration: duration * 1000,", + " weakMagnitude: 1.0,", + " strongMagnitude: 1.0", + " });", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + }, + { + "description": "Time of the vibration, in seconds (optional, default value is 1)", + "name": "Duration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Generate an advanced vibration on the specified controller. Incompatible with Firefox.", + "fullName": "Advanced gamepad vibration", + "functionType": "Action", + "name": "A_Advanced_Vibration_Controller", + "sentence": "Make gamepad _PARAM1_ vibrate for _PARAM2_ seconds with the vibration magnitude of _PARAM3_ and _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "//Vibration work only on game in browser.", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", + "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", + "const strongRumbleMagnitude = eventsFunctionContext.getArgument(\"StrongMagnitude\");", + "const weakRumbleMagnitude = eventsFunctionContext.getArgument(\"WeakMagnitude\");", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "if (weakRumbleMagnitude < 0 || weakRumbleMagnitude > 1) {", + " console.error('Parameter weakRumble identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "if (strongRumbleMagnitude < 0 || strongRumbleMagnitude > 1) {", + " console.error('Parameter strongRumble identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug the controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "if (gamepad && gamepad.vibrationActuator) {", + " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", + " startDelay: 0,", + " duration: duration * 1000,", + " weakMagnitude: weakRumbleMagnitude,", + " strongMagnitude: strongRumbleMagnitude", + " });", + "}", + "", + "gdjs._extensionController.players[playerId].rumble.duration = duration;", + "gdjs._extensionController.players[playerId].rumble.elapsedTime = 0;", + "gdjs._extensionController.players[playerId].rumble.weakMagnitude = weakRumbleMagnitude;", + "gdjs._extensionController.players[playerId].rumble.strongMagnitude = strongRumbleMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + }, + { + "description": "Time of the vibration, in seconds (optional, default value is 1)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Strong rumble magnitude (from 0 to 1)", + "name": "StrongMagnitude", + "type": "expression" + }, + { + "description": "Weak rumble magnitude (from 0 to 1)", + "name": "WeakMagnitude", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change a vibration on the specified controller. Incompatible with Firefox.", + "fullName": "Change gamepad active vibration", + "functionType": "Action", + "name": "A_Change_Vibration_Magnitude", + "sentence": "Change the vibration magnitude of _PARAM2_ & _PARAM3_ on gamepad _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "//Vibration work only on game in browser.", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", + "const elapsedTime = gdjs._extensionController.players[playerId].rumble.elapsedTime || 0;", + "const originalDuration = gdjs._extensionController.players[playerId].rumble.duration || 1;", + "const strongRumbleMagnitude = eventsFunctionContext.getArgument(\"StrongMagnitude\");", + "const weakRumbleMagnitude = eventsFunctionContext.getArgument(\"WeakMagnitude\");", + "", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "if (weakRumbleMagnitude < 0 || weakRumbleMagnitude > 1) {", + " console.error('Parameter weakRumble identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "if (strongRumbleMagnitude < 0 || strongRumbleMagnitude > 1) {", + " console.error('Parameter strongRumble identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug the controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "if (originalDuration - elapsedTime <= 0) return;", + "", + "if (gamepad && gamepad.vibrationActuator) {", + " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", + " startDelay: 0,", + " duration: 1000 * (originalDuration - elapsedTime),", + " weakMagnitude: weakRumbleMagnitude,", + " strongMagnitude: strongRumbleMagnitude", + " });", + "}", + "", + "gdjs._extensionController.players[playerId].rumble.weakMagnitude = weakRumbleMagnitude;", + "gdjs._extensionController.players[playerId].rumble.strongMagnitude = strongRumbleMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + }, + { + "description": "Strong rumble magnitude (from 0 to 1)", + "name": "StrongMagnitude", + "type": "expression" + }, + { + "description": "Weak rumble magnitude (from 0 to 1)", + "name": "WeakMagnitude", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Define an new private object javascript for the gamepad extension\r", + "gdjs._extensionController = {\r", + " players: {\r", + " 0: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " 1: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " 2: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " 3: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " },\r", + " lastActiveController: -1, // Last active controller\r", + " controllerButtonNames: { //Map associating controller button ids to button names\r", + " \"XBOX\": {\r", + " 0: \"A\",\r", + " 1: \"B\",\r", + " 2: \"X\",\r", + " 3: \"Y\",\r", + " 4: \"LB\",\r", + " 5: \"RB\",\r", + " 6: \"LT\",\r", + " 7: \"RT\",\r", + " 8: \"BACK\",\r", + " 9: \"START\",\r", + " 10: \"CLICK_STICK_LEFT\",\r", + " 11: \"CLICK_STICK_RIGHT\",\r", + " 12: \"UP\",\r", + " 13: \"DOWN\",\r", + " 14: \"LEFT\",\r", + " 15: \"RIGHT\",\r", + " 16: \"NONE\",\r", + " 17: \"NONE\"\r", + " },\r", + " \"PS4\": {\r", + " 0: \"CROSS\",\r", + " 1: \"CIRCLE\",\r", + " 2: \"SQUARE\",\r", + " 3: \"TRIANGLE\",\r", + " 4: \"L1\",\r", + " 5: \"R1\",\r", + " 6: \"L2\",\r", + " 7: \"R2\",\r", + " 8: \"SHARE\",\r", + " 9: \"OPTIONS\",\r", + " 10: \"CLICK_STICK_LEFT\",\r", + " 11: \"CLICK_STICK_RIGHT\",\r", + " 12: \"UP\",\r", + " 13: \"DOWN\",\r", + " 14: \"LEFT\",\r", + " 15: \"RIGHT\",\r", + " 16: \"PS_BUTTON\",\r", + " 17: \"CLICK_TOUCHPAD\"\r", + " }\r", + " }\r", + "};\r", + "\r", + "gdjs._extensionController.getInputString = function (type, buttonId) {\r", + " const controllerButtonNames = gdjs._extensionController.controllerButtonNames;\r", + " if (controllerButtonNames[type] !== undefined) {\r", + " return controllerButtonNames[type][buttonId];\r", + " }\r", + "\r", + " return \"UNKNOWN_BUTTON\";\r", + "}\r", + "\r", + "gdjs._extensionController.axisToAngle = function (deltaX, deltaY) {\r", + " const rad = Math.atan2(deltaY, deltaX);\r", + " const deg = rad * (180 / Math.PI);\r", + " return deg;\r", + "}\r", + "\r", + "gdjs._extensionController.isXbox = function (gamepad) {\r", + " return (gamepad ? (\r", + " gamepad.id.toUpperCase().indexOf(\"XBOX\") !== -1\r", + " // \"XINPUT\" cannot be used to check if it is a xbox controller is just a generic\r", + " // name reported in Firefox corresponding to the driver being used by the controller\r", + " // https://gamefaqs.gamespot.com/boards/916373-pc/73341312?page=1\r", + " ) : false);\r", + "}\r", + "\r", + "//Returns the new value taking into account the dead zone for the player_ID given\r", + "gdjs._extensionController.getNormalizedAxisValue = function (v, player_ID) {\r", + " // gdjs._extensionController = gdjs._extensionController || { deadzone: 0.2 };\r", + "\r", + " // Anything smaller than this is assumed to be 0,0\r", + " const DEADZONE = gdjs._extensionController.players[player_ID].deadzone;\r", + "\r", + " if (Math.abs(v) < DEADZONE) {\r", + " // In the dead zone, set to 0\r", + " v = 0;\r", + "\r", + " if (v == null) {\r", + " return 0;\r", + " } else {\r", + " return v;\r", + " }\r", + "\r", + " } else {\r", + " // We're outside the dead zone, but we'd like to smooth\r", + " // this value out so it still runs nicely between 0..1.\r", + " // That is, we don't want it to jump suddenly from 0 to\r", + " // DEADZONE.\r", + "\r", + " // Remap v from\r", + " // DEADZONE..1 to 0..(1-DEADZONE)\r", + " // or from\r", + " // -1..-DEADZONE to -(1-DEADZONE)..0\r", + "\r", + " v = v - Math.sign(v) * DEADZONE;\r", + "\r", + " // Remap v from\r", + " // 0..(1-DEADZONE) to 0..1\r", + " // or from\r", + " // -(1-DEADZONE)..0 to -1..0\r", + "\r", + " return v / (1 - DEADZONE);\r", + " }\r", + "};" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onScenePostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Each time a player press a button i save the last button pressed for the next frame", + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameter", + "let countPlayers = Object.keys(gdjs._extensionController.players).length;", + "", + "//Repeat for each players", + "for (let i = 0; i < countPlayers; i++) {", + " let gamepad = gamepads[i]; // Get the gamepad of the player", + "", + " //We have to keep this condition because if the user hasn't plugged in his controller yet, we can't get the controller in the gamepad variable.", + " if (gamepad == null) {", + " continue;", + " }", + "", + " for (let b = 0; b < Object.keys(gamepad.buttons).length; b++) { //For each buttons", + " if (gamepad.buttons[b].pressed) { //One of them is pressed", + " gdjs._extensionController.players[i].lastButtonUsed = b; //Save the button pressed", + "", + " //Save the state of the button for the next frame.", + " gdjs._extensionController.players[i].previousFrameStateButtons[b] = { pressed: true };", + "", + " // Update Last Active Controller", + " gdjs._extensionController.lastActiveController = i;", + " } else {", + " gdjs._extensionController.players[i].previousFrameStateButtons[b] = { pressed: false };", + " }", + " }", + "", + "", + " gdjs._extensionController.players[i].rumble.elapsedTime += runtimeScene.getElapsedTime(runtimeScene) / 1000;", + " if (", + " gdjs._extensionController.players[i].rumble.duration - gdjs._extensionController.players[i].rumble.elapsedTime <= 0 &&", + " (gdjs._extensionController.players[i].rumble.weakMagnitude || gdjs._extensionController.players[i].rumble.strongMagnitude)", + " ) {", + " gdjs._extensionController.players[i].rumble.weakMagnitude = 0;", + " gdjs._extensionController.players[i].rumble.strongMagnitude = 0;", + " }", + "", + "", + "}", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Check if any button is released on a gamepad.", + "fullName": "Any gamepad button released", + "functionType": "Condition", + "name": "C_any_button_released", + "sentence": "Any button of gamepad _PARAM1_ is released", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + "\tconsole.error('Parameter gamepad identifier in condition: \"Any gamepad button released\", is not valid number, must be between 0 and 4.');\r", + "\treturn;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "for (let buttonId = 0; buttonId < gamepad.buttons.length; buttonId++) { //For each buttons on current frame.\r", + "\r", + "\tif (buttonId === undefined) {\r", + "\t\teventsFunctionContext.returnValue = false;\r", + "\t\treturn;\r", + "\t}\r", + "\r", + "\t//Get previous value or define value by default for the current button\r", + "\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] || { pressed: false };\r", + "\r", + "\t//Get state of the button at previous frame\r", + "\tconst previousStateButtonIsPressed = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed;\r", + "\r", + "\t//Get the state of the button on the current frame.\r", + "\tconst currentFrameStateButtonIsPressed = gamepad.buttons[buttonId].pressed;\r", + "\r", + "\t//When previousStateButtonIsPressed is true and actual button state is not pressed\r", + "\t//Player have release the button\r", + "\tif (previousStateButtonIsPressed === true && currentFrameStateButtonIsPressed === false) {\r", + "\t\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = true;\r", + "\t\teventsFunctionContext.returnValue = true;\r", + "\t\t//break;\r", + "\t\treturn;\r", + "\t} else {\r", + "\t\t//The player didn't released the button yet, the previous frame state is still true\r", + "\t\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = false;\r", + "\t\teventsFunctionContext.returnValue = false;\r", + "\t}\r", + "\r", + "\tif (currentFrameStateButtonIsPressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + "}\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the strength of the weak vibration motor on the gamepad of a player.", + "fullName": "Weak rumble magnitude", + "functionType": "Expression", + "name": "WeakVibrationMagnitude", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].rumble.weakMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the strength of the strong vibration motor on the gamepad of a player.", + "fullName": "Strong rumble magnitude", + "functionType": "Expression", + "name": "StrongVibrationMagnitude", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].rumble.strongMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Control a platformer character with a gamepad.", + "fullName": "Platformer gamepad mapper", + "name": "PlatformerGamepadMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseArrows" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Up\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + }, + { + "type": { + "value": "PlatformBehavior::SimulateLadderKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Down\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseLeftStick" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + }, + { + "type": { + "value": "PlatformBehavior::SimulateLadderKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseRightStick" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + }, + { + "type": { + "value": "PlatformBehavior::SimulateLadderKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"A or Cross\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"A\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"B or Circle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"B\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"X or Square\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"X\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Y or Triangle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Y\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LB or L1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"LB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RB or R1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"RB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LT or L2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"LT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RT or R2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"RT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::PlatformerGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Platformer character behavior", + "description": "", + "group": "", + "extraInformation": [ + "PlatformBehavior::PlatformerObjectBehavior" + ], + "hidden": false, + "name": "PlatformerCharacter" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "GamepadIdentifier" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use directional pad", + "description": "", + "group": "Controls", + "extraInformation": [], + "hidden": false, + "name": "UseArrows" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use left stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "hidden": false, + "name": "UseLeftStick" + }, + { + "value": "", + "type": "Boolean", + "label": "Use right stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "hidden": false, + "name": "UseRightStick" + }, + { + "value": "A or Cross", + "type": "Choice", + "label": "Jump button", + "description": "", + "group": "Controls", + "extraInformation": [ + "A or Cross", + "B or Circle", + "X or Square", + "Y or Triangle", + "LB or L1", + "RB or R1", + "LT or L2", + "RT or R2" + ], + "hidden": false, + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a top-down character with a gamepad.", + "fullName": "Top-down gamepad mapper", + "name": "TopDownGamepadMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseArrows" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Up\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Down\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseLeftStick" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")", + "Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")", + "sign(Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Left\"))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseRightStick" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Right\")", + "Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Right\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "sign(Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Right\"))", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::TopDownGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Top-down movement behavior", + "description": "", + "group": "", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" + ], + "hidden": false, + "name": "TopDownMovement" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "GamepadIdentifier" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use directional pad", + "description": "", + "group": "Controls", + "extraInformation": [], + "hidden": false, + "name": "UseArrows" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use left stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "hidden": false, + "name": "UseLeftStick" + }, + { + "value": "", + "type": "Boolean", + "label": "Use right stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "hidden": false, + "name": "UseRightStick" + }, + { + "value": "Analog", + "type": "Choice", + "label": "Stick mode", + "description": "", + "group": "Controls", + "extraInformation": [ + "Analog", + "360°", + "8 Directions" + ], + "hidden": false, + "name": "StickMode" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "", + "extensionNamespace": "", + "fullName": "", + "helpPath": "", + "iconUrl": "", + "name": "Respawn", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "", + "tags": [ + "" + ], + "authorIds": [], + "dependencies": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Make the object come back to its initial location", + "fullName": "Respawn", + "name": "Respawn", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "OriginY", + "=", + "Object.Y()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "OriginX", + "=", + "Object.X()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Respawn::Respawn", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Respawn to its initial location", + "fullName": "Respawn", + "functionType": "Action", + "name": "respawn", + "sentence": "_PARAM0_ respawns to its initial location", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Object", + "=", + "Object.Variable(OriginX)", + "=", + "Object.Variable(OriginY)" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "Invincible", + "=", + "1" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Invincible\"" + ] + }, + { + "type": { + "value": "UnPauseObjectTimer" + }, + "parameters": [ + "Object", + "\"Invincible\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Respawn::Respawn", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is invincible.", + "fullName": "Is the object invincible?", + "functionType": "Condition", + "name": "isInvincible", + "sentence": "_PARAM0_ is invincible", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "Invincible", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Respawn::Respawn", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PauseObjectTimer" + }, + "parameters": [ + "Object", + "\"Invincible\"" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Invincible\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectTimer" + }, + "parameters": [ + "Object", + "\"Invincible\"", + "Object.Behavior::PropertyInvincibilityTime()" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "Invincible", + "=", + "0" + ] + }, + { + "type": { + "value": "PauseObjectTimer" + }, + "parameters": [ + "Object", + "\"Invincible\"" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Invincible\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Respawn::Respawn", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "OriginY", + "=", + "Object.Y()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "OriginX", + "=", + "Object.X()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Respawn::Respawn", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "5", + "type": "Number", + "label": "The invincibility time after been respawn (in seconds).", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "InvincibilityTime" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "", + "extensionNamespace": "", + "fullName": "", + "helpPath": "", + "iconUrl": "", + "name": "Bomb", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "", + "tags": [], + "authorIds": [], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Explode a bombe into 4 lines of Explosion objects.", + "fullName": "Explode a bombe", + "functionType": "Action", + "name": "Explode", + "sentence": "_PARAM1_ explode into _PARAM2_ and _PARAM5_ and is stopped by _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Creation of the central explosion square" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Explosion", + "Bomb.X()", + "Bomb.Y()", + "\"\"" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Explosion", + "=", + "Explosion.Y() + 12" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Explosion", + "PlayerNum", + "=", + "Bomb.Variable(PlayerNum)" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "ParticleEmitter", + "Explosion.CenterX()", + "Explosion.CenterY()", + "\"\"" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Explosion" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Creation of the explosion squares on the 4 directions" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Bomb::CreateExplosionArm" + }, + "parameters": [ + "", + "Bomb", + "Explosion", + "ExplosionBehavior", + "Obstacle", + "ParticleEmitter", + "0", + "1", + "0", + "" + ] + }, + { + "type": { + "value": "Bomb::CreateExplosionArm" + }, + "parameters": [ + "", + "Bomb", + "Explosion", + "ExplosionBehavior", + "Obstacle", + "ParticleEmitter", + "180", + "-1", + "0", + "" + ] + }, + { + "type": { + "value": "Bomb::CreateExplosionArm" + }, + "parameters": [ + "", + "Bomb", + "Explosion", + "ExplosionBehavior", + "Obstacle", + "ParticleEmitter", + "90", + "0", + "1", + "" + ] + }, + { + "type": { + "value": "Bomb::CreateExplosionArm" + }, + "parameters": [ + "", + "Bomb", + "Explosion", + "ExplosionBehavior", + "Obstacle", + "ParticleEmitter", + "-90", + "0", + "-1", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Bomb", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Bomb", + "name": "Bomb", + "type": "objectList" + }, + { + "description": "Explosion", + "name": "Explosion", + "supplementaryInformation": "Sprite", + "type": "objectList" + }, + { + "description": "Explosion", + "name": "ExplosionBehavior", + "supplementaryInformation": "Bomb::ExplosionBehavior", + "type": "behavior" + }, + { + "description": "Obstacle", + "name": "Obstacle", + "type": "objectList" + }, + { + "description": "Particle Emitter", + "name": "ParticleEmitter", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Create one line of Explosion object in a given direction.", + "fullName": "Create an explosion arm", + "functionType": "Action", + "name": "CreateExplosionArm", + "private": true, + "sentence": "Create an explosion arm with _PARAM2_ and _PARAM5_ from _PARAM1_ to _PARAM4_ in the direction _PARAM6_° (_PARAM7_ ; _PARAM8_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "iteration", + "=", + "1" + ] + } + ], + "events": [ + { + "infiniteLoopWarning": true, + "type": "BuiltinCommonInstructions::While", + "whileConditions": [ + { + "type": { + "value": "VarScene" + }, + "parameters": [ + "iteration", + "<=", + "Bomb.Variable(Range)" + ] + } + ], + "conditions": [], + "actions": [ + { + "type": { + "value": "SetSceneVariableAsBoolean" + }, + "parameters": [ + "isExplosionAlreadyCreated", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Bomb::ExplosionBehavior::HasJustBeenCreated" + }, + "parameters": [ + "Explosion", + "ExplosionBehavior", + "" + ] + }, + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Explosion", + "=", + "Bomb.X() + GetArgumentAsNumber(\"ExplosionDirectionX\") * 60 * Variable(iteration)" + ] + }, + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Explosion", + "=", + "Bomb.Y() + GetArgumentAsNumber(\"ExplosionDirectionY\") * 60 * Variable(iteration)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetSceneVariableAsBoolean" + }, + "parameters": [ + "isExplosionAlreadyCreated", + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Explosion", + "Bomb.X() + GetArgumentAsNumber(\"ExplosionDirectionX\") * 60 * Variable(iteration)", + "Bomb.Y() + GetArgumentAsNumber(\"ExplosionDirectionY\") * 60 * Variable(iteration)", + "\"\"" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Explosion", + "PlayerNum", + "=", + "Bomb.Variable(PlayerNum)" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Explosion", + "DirectionX", + "=", + "GetArgumentAsNumber(\"ExplosionDirectionX\")" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Explosion", + "DirectionY", + "=", + "GetArgumentAsNumber(\"ExplosionDirectionY\")" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Explosion" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneVariableAsBoolean" + }, + "parameters": [ + "isExplosionAlreadyCreated", + "=" + ] + } + ], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "ParticleEmitter", + "Explosion.CenterX()", + "Explosion.CenterY()", + "\"\"" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "ParticleEmitter", + "Explosion.CenterX() - GetArgumentAsNumber(\"ExplosionDirectionX\") * 30", + "Explosion.CenterY() - GetArgumentAsNumber(\"ExplosionDirectionY\") * 30", + "\"\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "When an obstacle is reached, the loop is broken (by setting a big value in the iteration variable)." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionNP" + }, + "parameters": [ + "Explosion", + "Obstacle", + "", + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "iteration", + "=", + "666" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "iteration", + "+", + "1" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Bomb", + "name": "Bomb", + "type": "objectList" + }, + { + "description": "Explosion", + "name": "Explosion", + "supplementaryInformation": "Sprite", + "type": "objectList" + }, + { + "description": "Explosion", + "name": "ExplosionBehavior", + "supplementaryInformation": "Bomb::ExplosionBehavior", + "type": "behavior" + }, + { + "description": "Obstacle", + "name": "Obstacle", + "type": "objectList" + }, + { + "description": "Praticle emitter", + "name": "ParticleEmitter", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "objectList" + }, + { + "description": "Explosion direction angle", + "name": "ExplosionDirection", + "type": "expression" + }, + { + "description": "Explosion direction X", + "name": "ExplosionDirectionX", + "type": "expression" + }, + { + "description": "Explosion direction Y", + "name": "ExplosionDirectionY", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "", + "fullName": "", + "name": "BombAnimator", + "objectType": "Scene3D::Model3DObject", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scene3D::Model3DObject::SetRotationX" + }, + "parameters": [ + "Object", + "=", + "20" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "scale", + "=", + "Object.Wobble::ScaleMin()" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetScaleMin" + }, + "parameters": [ + "Object", + "Wobble", + "=", + "0.065 * Object.Variable(scale)", + "" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::TweenScaleMin" + }, + "parameters": [ + "Object", + "Wobble", + "Object.Variable(scale)", + "0.5", + "\"easeInOutQuad\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "scale", + "=", + "Object.Wobble::ScaleMax()" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetScaleMax" + }, + "parameters": [ + "Object", + "Wobble", + "=", + "0.065 * Object.Variable(scale)", + "" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::TweenScaleMax" + }, + "parameters": [ + "Object", + "Wobble", + "Object.Variable(scale)", + "0.5", + "\"easeInOutQuad\"", + "" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::TweenStretchZ" + }, + "parameters": [ + "Object", + "Tween3D", + "\"Squatch\"", + "0.5", + "0.25", + "\"linear\"", + "" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.25" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::TweenStretchZ" + }, + "parameters": [ + "Object", + "Tween3D", + "\"Unsquatch\"", + "1", + "3", + "\"elastic\"", + "" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.75" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::StopTween" + }, + "parameters": [ + "Object", + "Tween3D", + "\"Unsquatch\"", + "", + "" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Wobble\"" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scene3D::Model3DObject::SetZ" + }, + "parameters": [ + "Object", + "=", + "Object.Depth() / 2" + ] + }, + { + "type": { + "value": "Tween::AddObjectPositionZTween" + }, + "parameters": [ + "Object", + "Tween", + "\"Fell\"", + "0", + "\"linear\"", + "1000", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Bomb::BombAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D tween", + "description": "", + "group": "", + "extraInformation": [ + "Tween3D::Tween3D" + ], + "hidden": false, + "name": "Tween3D" + }, + { + "value": "", + "type": "Behavior", + "label": "2D tween", + "description": "", + "group": "", + "extraInformation": [ + "Tween::TweenBehavior" + ], + "hidden": false, + "name": "Tween" + }, + { + "value": "", + "type": "Behavior", + "label": "3D wobble", + "description": "", + "group": "", + "extraInformation": [ + "Tween3D::Wobble" + ], + "hidden": false, + "name": "Wobble" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "", + "fullName": "", + "name": "ExplosionBehavior", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"LifeTime\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Bomb::ExplosionBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"LifeTime\"", + ">", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Bomb::ExplosionBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Has just been created", + "functionType": "Condition", + "name": "HasJustBeenCreated", + "sentence": "_PARAM0_ has just been created", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"LifeTime\"", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Bomb::ExplosionBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "", + "extensionNamespace": "", + "fullName": "", + "helpPath": "", + "iconUrl": "", + "name": "Player", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "", + "tags": [], + "authorIds": [], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Create a bonus at specified position.", + "fullName": "Create bonus", + "functionType": "Action", + "name": "CreateBonus", + "sentence": "Create _PARAM1_ of type _PARAM4_ at position _PARAM2_ ; _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Bonus", + "GetArgumentAsNumber(\"PositionX\") + 5", + "GetArgumentAsNumber(\"PositionY\") + 5", + "" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Bonus", + "Type", + "=", + "GetArgumentAsNumber(\"Type\")" + ] + }, + { + "type": { + "value": "Scene3D::Cube3DObject::SetZ" + }, + "parameters": [ + "Bonus", + "=", + "Bonus.Height() / 2" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"Type\"", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Cube3DObject::SetFaceResource" + }, + "parameters": [ + "Bonus", + "\"front\"", + "BombeBonus.png" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"Type\"", + "=", + "2" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Cube3DObject::SetFaceResource" + }, + "parameters": [ + "Bonus", + "\"front\"", + "assets\\FlammeBonus.png" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Bonus", + "name": "Bonus", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "objectList" + }, + { + "description": "X position", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Y position", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Bonus type", + "name": "Type", + "supplementaryInformation": "[]", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "A player that picks up bonuses to become more powerful.", + "fullName": "Player", + "name": "Player", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Player::Player::ResetPowers" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Object" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::Player", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Pick up a bonus and gain powers.", + "fullName": "Pick up bonus", + "functionType": "Action", + "name": "PickUpBonus", + "sentence": "_PARAM0_ pick up _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Bonus", + "Type", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "BombCapacity", + "+", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Bonus", + "Type", + "=", + "2" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "Range", + "+", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The structure Bonus of the Player allow to keep up the bonuses caught by the player and their location so they can be set back when he dies." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "newIndex", + "=", + "Object.VariableChildCount(Bonus)" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "Bonus[VariableString(newIndex)][\"Number\"]", + "=", + "Bonus.Variable(Type)" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "Bonus[VariableString(newIndex)][\"X\"]", + "=", + "Bonus.X() - 5" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "Bonus[VariableString(newIndex)][\"Y\"]", + "=", + "Bonus.Y() - 5" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Bonus", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::Player", + "type": "behavior" + }, + { + "description": "Bonus", + "name": "Bonus", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "The bonus accumulated by the dead player come back to their initial locations.", + "fullName": "Give back all bonuses", + "functionType": "Action", + "name": "GiveBackBonuses", + "sentence": "_PARAM0_ give back all _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Player::Player::ResetPowers" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "iteration", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "Object.VariableChildCount(Bonus)", + "conditions": [], + "actions": [ + { + "type": { + "value": "Player::CreateBonus" + }, + "parameters": [ + "", + "Bonus", + "Object.Variable(Bonus[ToString(Variable(iteration))][\"X\"])", + "Object.Variable(Bonus[ToString(Variable(iteration))][\"Y\"])", + "Object.Variable(Bonus[ToString(Variable(iteration))][\"Number\"])", + "" + ] + }, + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "iteration", + "+", + "1" + ] + }, + { + "type": { + "value": "Bonus::BonusAnimator::PlaySpawnAnimation" + }, + "parameters": [ + "Bonus", + "BonusAnimator", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ObjectVariableClearChildren" + }, + "parameters": [ + "Object", + "Bonus" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::Player", + "type": "behavior" + }, + { + "description": "Bonus", + "name": "Bonus", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "objectListOrEmptyIfJustDeclared" + }, + { + "description": "Bonus animator", + "name": "BonusAnimator", + "supplementaryInformation": "Bonus::BonusAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Reset powers", + "functionType": "Action", + "name": "ResetPowers", + "private": true, + "sentence": "Reset powers of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "Range", + "=", + "GlobalVariable(Flame)" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "BombCapacity", + "=", + "GlobalVariable(Bomb)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::Player", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Separate players from bombs. Players can overlap a bomb when it's created but they cant walk on a bomb that is already there.", + "fullName": "Separate from bomb", + "functionType": "Action", + "name": "SeparateFromBomb", + "sentence": "Separate _PARAM0_ from _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "When the player no longer overlaps the bomb, it becomes solid for this player." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Distance" + }, + "parameters": [ + "Object", + "Bomb", + "59", + "" + ] + }, + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Bomb", + "IsOverlaping[ToString(Object.Variable(Number))]", + "True" + ] + } + ], + "actions": [ + { + "type": { + "value": "ObjectVariableRemoveChild" + }, + "parameters": [ + "Bomb", + "IsOverlaping", + "Object.VariableString(Number)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionNP" + }, + "parameters": [ + "Object", + "Bomb", + "", + "", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Bomb", + "IsOverlaping[ToString(Object.Variable(Number))]", + "True" + ] + } + ], + "actions": [ + { + "type": { + "value": "SeparateFromObjects" + }, + "parameters": [ + "Object", + "Bomb", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::Player", + "type": "behavior" + }, + { + "description": "Bomb", + "name": "Bomb", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a player can put a bomb.", + "fullName": "Can put a bomb", + "functionType": "Condition", + "name": "CanPutBomb", + "sentence": "_PARAM0_ can put a _PARAM2_ on the ground", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Check that no bomb is already on this square.\nThe negation of \"Is there at least one bomb on this square?\" is equivalent to \"Is there no bomb on this square?\".\nThis is not the same as having the negation directly on the condition because it would mean \"Is there a bomb that is not on this square?\"." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "BombPut", + "<", + "Object.Variable(BombCapacity)" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Not" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Bomb", + "10 + round((Object.X() - 10) / 60) * 60 + 30", + "round(Object.Y() / 60) * 60 + 30" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::Player", + "type": "behavior" + }, + { + "description": "Bomb", + "name": "Bomb", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "The player put a bomb in its curent square", + "fullName": "Put a bomb", + "functionType": "Action", + "name": "PutBomb", + "sentence": "_PARAM0_ put a _PARAM2_ on the ground", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Bomb", + "10 + round((Object.X() - 10) / 60) * 60", + "round(Object.Y() / 60) * 60", + "" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Bomb", + "\"Detonator\"" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "BombPut", + "+", + "1" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Bomb", + "Range", + "=", + "Object.Variable(Range)" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "BombX", + "=", + "Bomb.X()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "BombY", + "=", + "Bomb.Y()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Bomb", + "PlayerNum", + "=", + "Object.Variable(Number)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::Player", + "type": "behavior" + }, + { + "description": "Bomb", + "name": "Bomb", + "type": "objectListOrEmptyIfJustDeclared" + } + ], + "objectGroups": [] + }, + { + "description": "Allow a player to walk on a bomb created under their foot.", + "fullName": "Allow to walk on a bomb", + "functionType": "Action", + "name": "AllowToWalkOnBomb", + "sentence": "Allow _PARAM0_ to walk on a _PARAM2_ created under their foot.", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Bomb", + "IsOverlaping[ToString(Object.Variable(Number))]", + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::Player", + "type": "behavior" + }, + { + "description": "", + "name": "Bomb", + "type": "objectList" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [], + "sharedPropertyDescriptors": [] + }, + { + "description": "", + "fullName": "", + "name": "PlayerModel", + "objectType": "Scene3D::Model3DObject", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "90" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "Angle", + "=", + "90" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::PlayerModel", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Player::PlayerModel::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"CanRespawn\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Player::PlayerModel::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Alive\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Player::PlayerModel::IsPlayingDeathAnimation" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "Player::PlayerModel::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"DeathAnimation\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Player::PlayerModel::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"CanRespawn\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Player::PlayerModel::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Alive\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Model3DObject::SetRotationY" + }, + "parameters": [ + "Object", + "=", + "0" + ] + }, + { + "type": { + "value": "Scene3D::Model3DObject::SetRotationX" + }, + "parameters": [ + "Object", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "Angle", + "+", + "sign(AngleDifference(Object.Behavior::MovementAngle(), Object.Variable(Angle))) * min(abs(AngleDifference(Object.Behavior::MovementAngle(), Object.Variable(Angle))), 720 * TimeDelta())" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "Object.Variable(Angle)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scene3D::Model3DObject::TurnAroundX" + }, + "parameters": [ + "Object", + "45" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Player::PlayerModel::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"DeathAnimation\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "ExplosionDirectionX", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Model3DObject::TurnAroundX" + }, + "parameters": [ + "Object", + "-Object.Variable(ExplosionDirectionY) * 90 * TimeDelta() / 0.75" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "ExplosionDirectionY", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Model3DObject::TurnAroundY" + }, + "parameters": [ + "Object", + "Object.Variable(ExplosionDirectionX) * 90 * TimeDelta() / 0.75" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::PlayerModel", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the movementAngle of the object.", + "fullName": "MovementAngle", + "functionType": "ExpressionAndCondition", + "group": "PlayerModel configuration", + "name": "MovementAngle", + "sentence": "the movementAngle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyMovementAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::PlayerModel", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MovementAngle", + "name": "SetMovementAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Player::PlayerModel::SetPropertyMovementAngle" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::PlayerModel", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Play death animation from explosion", + "functionType": "Action", + "name": "PlayDeathAnimationFromExplosion", + "sentence": "Play death animation of _PARAM0_ according to _PARAM2_ and _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Explosion", + "DirectionX", + "=", + "0" + ] + }, + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Explosion", + "DirectionY", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "abs(Player.CenterX() - Explosion.CenterX())", + ">", + "abs(Player.CenterY() - Explosion.CenterY())" + ] + } + ], + "actions": [ + { + "type": { + "value": "Player::PlayerModel::PlayDeathAnimation" + }, + "parameters": [ + "Object", + "Behavior", + "sign(Object.CenterX() - Explosion.CenterX())", + "0", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "abs(Player.CenterX() - Explosion.CenterX())", + "<", + "abs(Player.CenterY() - Explosion.CenterY())" + ] + } + ], + "actions": [ + { + "type": { + "value": "Player::PlayerModel::PlayDeathAnimation" + }, + "parameters": [ + "Object", + "Behavior", + "0", + "sign(Player.CenterY() - Explosion.CenterY())", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Explosion", + "DirectionX", + "!=", + "0" + ] + }, + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Explosion", + "DirectionY", + "!=", + "0" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "Player::PlayerModel::PlayDeathAnimation" + }, + "parameters": [ + "Object", + "Behavior", + "Explosion.Variable(DirectionX)", + "Explosion.Variable(DirectionY)", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::PlayerModel", + "type": "behavior" + }, + { + "description": "Explosion", + "name": "Explosion", + "type": "objectList" + }, + { + "description": "Player", + "name": "Player", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "fullName": "Play death animation", + "functionType": "Action", + "name": "PlayDeathAnimation", + "private": true, + "sentence": "Play death animation of _PARAM0_ toward _PARAM2_ ; _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scene3D::Model3DObject::SetRotationY" + }, + "parameters": [ + "Object", + "=", + "0" + ] + }, + { + "type": { + "value": "Scene3D::Model3DObject::SetRotationX" + }, + "parameters": [ + "Object", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"ExplosionDirectionY\"", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectPositionXTween" + }, + "parameters": [ + "Object", + "Tween", + "\"FlyAway\"", + "Object.X() + GetArgumentAsNumber(\"ExplosionDirectionX\") * 1000", + "\"easeInQuad\"", + "750", + "" + ] + }, + { + "type": { + "value": "Tween::AddObjectPositionZTween" + }, + "parameters": [ + "Object", + "Tween", + "\"FlyAwayZ\"", + "400", + "\"easeOutQuad\"", + "750", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"ExplosionDirectionX\"", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectPositionYTween" + }, + "parameters": [ + "Object", + "Tween", + "\"FlyAway\"", + "Object.Y() + GetArgumentAsNumber(\"ExplosionDirectionY\") * 600", + "\"easeInQuad\"", + "750", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"ExplosionDirectionY\"", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectPositionZTween" + }, + "parameters": [ + "Object", + "Tween", + "\"FlyAwayZ\"", + "400", + "\"easeOutQuad\"", + "750", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"ExplosionDirectionY\"", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectPositionZTween" + }, + "parameters": [ + "Object", + "Tween", + "\"FlyAwayZ\"", + "600", + "\"easeOutQuad\"", + "750", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "ExplosionDirectionX", + "=", + "GetArgumentAsNumber(\"ExplosionDirectionX\")" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "ExplosionDirectionY", + "=", + "GetArgumentAsNumber(\"ExplosionDirectionY\")" + ] + }, + { + "type": { + "value": "Player::PlayerModel::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"DeathAnimation\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::PlayerModel", + "type": "behavior" + }, + { + "description": "Explosion direction X", + "name": "ExplosionDirectionX", + "type": "expression" + }, + { + "description": "Explosion direction Y", + "name": "ExplosionDirectionY", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "Death animation playing", + "functionType": "Condition", + "name": "IsPlayingDeathAnimation", + "private": true, + "sentence": "Death animation of _PARAM0_ is playing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween::IsPlaying" + }, + "parameters": [ + "Object", + "Tween", + "\"FlyAway\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::PlayerModel", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Can respawn", + "functionType": "Condition", + "name": "CanRespawn", + "sentence": "_PARAM0_ can respawn", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Player::PlayerModel::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"CanRespawn\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::PlayerModel", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Update position", + "functionType": "Action", + "name": "UpdatePosition", + "sentence": "Update the position of _PARAM0_ according to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Player", + "Death", + "False" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Object", + "=", + "Player.CenterX()", + "=", + "Player.CenterY() + 16" + ] + }, + { + "type": { + "value": "Scene3D::Model3DObject::SetZ" + }, + "parameters": [ + "Object", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TopDownMovementBehavior::IsMoving" + }, + "parameters": [ + "Player", + "TopDownMovement" + ] + } + ], + "actions": [ + { + "type": { + "value": "Player::PlayerModel::SetMovementAngle" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Player.TopDownMovement::Angle()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "TopDownMovementBehavior::IsMoving" + }, + "parameters": [ + "Player", + "TopDownMovement" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Model3DObject::SetAnimationName" + }, + "parameters": [ + "Object", + "=", + "\"Idle\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TopDownMovementBehavior::IsMoving" + }, + "parameters": [ + "Player", + "TopDownMovement" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Model3DObject::SetAnimationName" + }, + "parameters": [ + "Object", + "=", + "\"Run\"" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::PlayerModel", + "type": "behavior" + }, + { + "description": "Player", + "name": "Player", + "type": "objectList" + }, + { + "description": "Top-down movement", + "name": "TopDownMovement", + "supplementaryInformation": "TopDownMovementBehavior::TopDownMovementBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Play respwan animation", + "functionType": "Action", + "name": "PlayRespawnAnimation", + "sentence": "Play respwan animation of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "90" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "Angle", + "=", + "90" + ] + }, + { + "type": { + "value": "Player::PlayerModel::SetMovementAngle" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "90", + "" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::SetStretchZ" + }, + "parameters": [ + "Object", + "Tween3D", + "=", + "8", + "Object3D" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::TweenStretchZ" + }, + "parameters": [ + "Object", + "Tween3D", + "\"Unstrentch\"", + "1", + "1", + "\"elastic\"", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.75" + ] + }, + { + "type": { + "value": "Flash::Flash::Flash" + }, + "parameters": [ + "Object", + "Flash", + "4.25", + "" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Player::PlayerModel", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "MovementAngle" + }, + { + "value": "", + "type": "Behavior", + "label": "2D tween", + "description": "", + "group": "", + "extraInformation": [ + "Tween::TweenBehavior" + ], + "hidden": false, + "name": "Tween" + }, + { + "value": "Alive", + "type": "Choice", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "Alive", + "DeathAnimation", + "CanRespawn" + ], + "hidden": true, + "name": "State" + }, + { + "value": "", + "type": "Behavior", + "label": "3D tween", + "description": "", + "group": "", + "extraInformation": [ + "Tween3D::Tween3D" + ], + "hidden": false, + "name": "Tween3D" + }, + { + "value": "", + "type": "Behavior", + "label": "Flash visibility", + "description": "", + "group": "", + "extraInformation": [ + "Flash::Flash" + ], + "hidden": false, + "name": "Flash" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "", + "extensionNamespace": "", + "fullName": "", + "helpPath": "", + "iconUrl": "", + "name": "Bonus", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "", + "tags": [], + "authorIds": [], + "dependencies": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "", + "fullName": "", + "name": "BonusAnimator", + "objectType": "Scene3D::Cube3DObject", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Bonus::BonusAnimator::PlaySpawnAnimation" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Bonus::BonusAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Play spwan animation", + "functionType": "Action", + "name": "PlaySpawnAnimation", + "sentence": "Play spwan animation of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectPositionZTween" + }, + "parameters": [ + "Object", + "Tween", + "\"Jump\"", + "120", + "\"easeOutQuad\"", + "500", + "" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.5" + ] + }, + { + "type": { + "value": "Tween::AddObjectPositionZTween" + }, + "parameters": [ + "Object", + "Tween", + "\"Jump\"", + "20", + "\"easeOutBounce\"", + "1000", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "-180" + ] + }, + { + "type": { + "value": "Tween::AddObjectAngleTween" + }, + "parameters": [ + "Object", + "Tween", + "\"RotationZ\"", + "0", + "\"easeOutQuad\"", + "1000", + "" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "-160" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::TweenRotationX" + }, + "parameters": [ + "Object", + "Tween3D", + "\"ToBillboard\"", + "-20", + "1", + "\"easeOutQuad\"", + "" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "-90" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::TweenRotationY" + }, + "parameters": [ + "Object", + "Tween3D", + "\"RotationY\"", + "0", + "1", + "\"easeOutQuad\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.75" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::Shake" + }, + "parameters": [ + "Object", + "Shake3D", + "0.75", + "0", + "0.25", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Bonus::BonusAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D tween", + "description": "", + "group": "", + "extraInformation": [ + "Tween3D::Tween3D" + ], + "hidden": false, + "name": "Tween3D" + }, + { + "value": "", + "type": "Behavior", + "label": "2D tween", + "description": "", + "group": "", + "extraInformation": [ + "Tween::TweenBehavior" + ], + "hidden": false, + "name": "Tween" + }, + { + "value": "", + "type": "Behavior", + "label": "3D shake", + "description": "", + "group": "", + "extraInformation": [ + "ShakeObject3D::ShakeModel3D" + ], + "hidden": false, + "name": "Shake3D" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + } + ], + "externalLayouts": [ + { + "associatedLayout": "Game", + "name": "EmptyLevel", + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 68, + "layer": "", + "name": "Player1", + "persistentUuid": "ec337b4f-25b3-464d-8aa2-e53d451b9e82", + "width": 82, + "x": 1030, + "y": 600, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 68, + "layer": "", + "name": "Player2", + "persistentUuid": "0168e5a1-c6c6-4470-a8a9-31a2b47790e9", + "width": 82, + "x": 190, + "y": 0, + "zOrder": 5, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 68, + "layer": "", + "name": "Player3", + "persistentUuid": "dca8110e-8871-49a7-9d12-e00eaf0e8b53", + "width": 82, + "x": 190, + "y": 600, + "zOrder": 9, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 68, + "layer": "", + "name": "Player4", + "persistentUuid": "c39be22f-ce00-44f2-b33f-b70a864832df", + "width": 82, + "x": 1030, + "y": 0, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "f9511d79-0d5c-4bd1-823d-c67e20e5db99", + "width": 83, + "x": 970, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "8447b809-5714-4fd0-b129-d80317fb21aa", + "width": 83, + "x": 850, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "45258940-e06d-4e37-840c-9d08f88a7abc", + "width": 83, + "x": 970, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "7a6e25fc-db35-4c22-a9eb-97a79eabf03d", + "width": 83, + "x": 970, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "b3d20ca8-9c8c-4417-8043-31da42008db8", + "width": 83, + "x": 970, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "f170e10a-a297-4227-a30e-4f931e599260", + "width": 83, + "x": 970, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "a71e5d83-58d2-4feb-bb02-90c2813972b9", + "width": 83, + "x": 850, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "a507f518-07f8-4aaf-905d-cab8e389755b", + "width": 83, + "x": 730, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "cd461ccf-107b-4405-a2e6-144fc47d1f34", + "width": 83, + "x": 610, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "51ac8fcb-e797-422e-8d4e-9a8e67810413", + "width": 83, + "x": 490, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "44306b15-43c9-4b35-8c19-f9e974c8d29b", + "width": 83, + "x": 370, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "550042d3-c2bb-4a8a-ba63-d5175ef7ad26", + "width": 83, + "x": 250, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "f56aac1e-bac7-44a6-92e8-9866e05f8edf", + "width": 83, + "x": 250, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "63148283-d51d-4299-9e6a-5f15a5b6f77e", + "width": 83, + "x": 370, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "a329bbd6-ce1e-478d-ac66-c8f8abf85296", + "width": 83, + "x": 490, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "e7203995-374a-4007-bde7-1e30fba64e77", + "width": 83, + "x": 610, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "e45bea6b-0ec7-4bc3-adb8-c5afabbece3d", + "width": 83, + "x": 730, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "78be8892-dba5-426a-85ca-61a7ae97e02e", + "width": 83, + "x": 850, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "08cef9a2-99f8-4a6b-9636-5b42bc5683c0", + "width": 83, + "x": 850, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "bb66644a-6965-4fd6-a756-125ad5387046", + "width": 83, + "x": 730, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "d63a029c-78e3-4d6b-80ad-248e574f3146", + "width": 83, + "x": 610, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "9fdc834e-2e18-401f-b777-bdfb9b16601a", + "width": 83, + "x": 490, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "a87bb6e0-81ef-43fb-9390-95bc91794784", + "width": 83, + "x": 370, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "8a2983a3-cf56-4002-9274-1d0b46625e91", + "width": 83, + "x": 250, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "81ca95c8-539f-4e21-b401-b2c311a51cd2", + "width": 83, + "x": 250, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "70349155-be0a-474f-b891-d9611c239d67", + "width": 83, + "x": 370, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "65d4cbe0-3788-4f35-be90-57ec5ff7872d", + "width": 83, + "x": 490, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "c5575629-c2bc-49ae-8341-66158e877d21", + "width": 83, + "x": 610, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "da7b4f5b-b51e-447d-8d3d-1378e16934ac", + "width": 83, + "x": 730, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "8133a8ee-dc9b-46d8-a976-b1bb25b179cf", + "width": 83, + "x": 730, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "4c224d4e-7aa8-4da2-ac12-523944b32512", + "width": 83, + "x": 850, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "a880dcea-8e74-4a5b-a8f5-4230ff1c3e1e", + "width": 83, + "x": 610, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "8750120e-f080-435e-bd41-3cceb9ca2fa4", + "width": 83, + "x": 490, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "1dd9c236-33c4-429d-a5bd-79bb068f4288", + "width": 83, + "x": 370, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "4a003673-754e-43ac-bc93-dbc3e8624efc", + "width": 83, + "x": 250, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 40, + "height": 780, + "layer": "", + "name": "BlockRoundedLong", + "persistentUuid": "4710e1bb-9df1-4985-8b50-588142d6fa7c", + "width": 60, + "x": 160, + "y": 330, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 40, + "height": 1020, + "layer": "", + "name": "BlockRoundedLong", + "persistentUuid": "b755b54f-ceaa-49c1-a27e-552b63c122f9", + "width": 60, + "x": 640, + "y": -30, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 40, + "height": 1020, + "layer": "", + "name": "BlockRoundedLong", + "persistentUuid": "8ce4c949-925c-4223-b314-94f193182244", + "width": 60, + "x": 640, + "y": 690, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 40, + "height": 780, + "layer": "", + "name": "BlockRoundedLong", + "persistentUuid": "20734c0d-890c-4170-9d06-41df3e64828e", + "width": 60, + "x": 1120, + "y": 330, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "BlueBunny", + "persistentUuid": "0e59664b-d4d7-45df-a225-576dd3049dd1", + "width": 0, + "x": 1036, + "y": 624, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "PurpleBunny", + "persistentUuid": "a0917fc0-983f-44f6-8fe3-ae14f0398f39", + "width": 0, + "x": 244, + "y": 24, + "zOrder": 15, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "OrangeBunny", + "persistentUuid": "ff41b690-4336-4ff1-b2be-1247be2900f1", + "width": 0, + "x": 244, + "y": 624, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "PinkBunny", + "persistentUuid": "4b6723f8-7101-429b-88c4-62783fdd6a69", + "width": 0, + "x": 1036, + "y": 24, + "zOrder": 17, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0.01, + "height": 1020, + "layer": "", + "name": "New3DBox", + "persistentUuid": "28f30776-ae1d-4c25-a42f-58deaafcb161", + "width": 300, + "x": -170, + "y": -240, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0.01, + "height": 180, + "layer": "", + "name": "New3DBox", + "persistentUuid": "643e030b-9c7c-4cb0-8cff-3d1f32b54acc", + "width": 1140, + "x": 70, + "y": -240, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0.01, + "height": 1020, + "layer": "", + "name": "New3DBox", + "persistentUuid": "e7ef46d0-9be6-447f-bd25-8dd562dc8d3a", + "width": 300, + "x": 1150, + "y": -240, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": true, + "gridType": "rectangular", + "gridWidth": 60, + "gridHeight": 60, + "gridOffsetX": 10, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": true, + "zoomFactor": 0.7561452800822535, + "windowMask": false + } + }, + { + "associatedLayout": "Game", + "name": "TestLevel", + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 68, + "layer": "", + "name": "Player1", + "persistentUuid": "fb6afea8-f5bc-4b0e-bbc4-5900aed2ef63", + "width": 82, + "x": 1030, + "y": 600, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 68, + "layer": "", + "name": "Player2", + "persistentUuid": "fef840da-ee13-4b0b-b471-204c1fc10718", + "width": 82, + "x": 190, + "y": 0, + "zOrder": 5, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 68, + "layer": "", + "name": "Player3", + "persistentUuid": "ef729714-8ec8-40c8-ae75-deba82602488", + "width": 82, + "x": 190, + "y": 600, + "zOrder": 9, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 68, + "layer": "", + "name": "Player4", + "persistentUuid": "8dc2fe23-d26b-4191-8ce6-da199392145c", + "width": 82, + "x": 1030, + "y": 0, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "ec6ea1c7-7bc7-40f5-abb1-2ef4339c9512", + "width": 83, + "x": 970, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "8527c9a6-57cf-4037-9a62-8db74a07f298", + "width": 83, + "x": 850, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "29694b69-4a12-4a3f-bf97-4bb674964a96", + "width": 83, + "x": 970, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "92c92b77-f26d-43d1-8071-66a05afab425", + "width": 83, + "x": 970, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "47b11f9d-cf11-44a9-b137-bb9036143101", + "width": 83, + "x": 970, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "f28c8615-da64-443a-bd3d-73d50ff63bdf", + "width": 83, + "x": 970, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "16d0bbf7-9358-497d-816d-69e2884e6ed1", + "width": 83, + "x": 850, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "1c6221ae-1a24-4a81-ad97-6c422fc3e651", + "width": 83, + "x": 730, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "6da8ca22-7023-46c3-998c-21ca394141ac", + "width": 83, + "x": 610, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "b9d2ab87-68a1-4339-9a7f-e546945d22a8", + "width": 83, + "x": 490, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "0447b351-ac2b-4e07-a14f-b1fa4a6adca6", + "width": 83, + "x": 370, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "25dcdacf-7619-49f6-bc78-47ecf8d5180c", + "width": 83, + "x": 250, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "0b3ac2e6-c842-44d8-bb6e-c80a585eef15", + "width": 83, + "x": 250, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "e81aa626-ae76-428f-8303-9084dd6ff372", + "width": 83, + "x": 370, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "e387be87-f1a7-42a1-9781-21548978c0a5", + "width": 83, + "x": 490, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "4d28e77c-5ea9-4f02-bd5f-1507117dcbac", + "width": 83, + "x": 610, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "750416fa-4272-4ffb-9ac2-d70a3358a9a8", + "width": 83, + "x": 730, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "b8c9ce11-eedd-4721-b487-702180df1e5c", + "width": 83, + "x": 850, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "e2c3f0d7-10c0-4aa3-97a3-481e9f3af529", + "width": 83, + "x": 850, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "36cbbe6e-c83f-4267-bc97-354f1fea1522", + "width": 83, + "x": 730, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "b6da8784-9a51-4cb9-8446-e99a5abe71de", + "width": 83, + "x": 610, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "c39a6498-aded-4cdb-8bf2-f8a49934173d", + "width": 83, + "x": 490, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "b204afc7-95e8-45f6-bba8-9d68a2375ae5", + "width": 83, + "x": 370, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "8f7352ef-6ffa-4fc8-8f42-b7f395694b6b", + "width": 83, + "x": 250, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "32baf7c1-1734-488a-82c0-1167e692b9d9", + "width": 83, + "x": 250, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "51fbcefa-9511-4a70-bf7d-a49096f8c176", + "width": 83, + "x": 370, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "4c111a27-5b43-4aa2-bf65-ea3695b02d2a", + "width": 83, + "x": 490, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "0336456c-bbef-4a65-8607-7644c34f0e30", + "width": 83, + "x": 610, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "dda16088-5b3b-4a9e-a1f8-45c7956f5065", + "width": 83, + "x": 730, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "c26e63b1-18a0-4629-95ff-015abf0e3674", + "width": 83, + "x": 730, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "1e0c6d91-0d9a-4066-a2f2-d08ba58ae59a", + "width": 83, + "x": 850, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "ba846a27-c199-44c0-b8a6-f28f803f4bd5", + "width": 83, + "x": 610, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "7a61f05e-50ab-4249-8410-a0a7b9f89a41", + "width": 83, + "x": 490, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "f90e0c6a-814a-4bff-a22f-210d0f8d5a07", + "width": 83, + "x": 370, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "693c5065-ffee-47f9-a848-6973a73fb275", + "width": 83, + "x": 250, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "d1bd6fd2-2b8a-4061-82b6-02ad29a9f452", + "rotationX": 20, + "width": 0, + "x": 370, + "y": 480, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "db5f17a8-f631-403b-8b72-34e6816b0d7f", + "rotationX": 20, + "width": 0, + "x": 190, + "y": 420, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "70f11907-30b4-42f4-999c-008c2de43a3b", + "rotationX": 20, + "width": 0, + "x": 430, + "y": 420, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "22b0fecc-0d27-4565-9d33-25be22bc1783", + "rotationX": 20, + "width": 0, + "x": 430, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "27b0cb7b-615b-452f-9c0f-f0eeaebf1259", + "rotationX": 20, + "width": 0, + "x": 550, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "995de96b-fbe5-4cfb-9e26-c2b5e0497d1c", + "rotationX": 20, + "width": 0, + "x": 250, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "0a2dbdeb-7bd4-45de-8afb-ecb61ff39573", + "rotationX": 20, + "width": 0, + "x": 190, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "530701f3-adae-4daf-8fde-f7cee4810f27", + "rotationX": 20, + "width": 0, + "x": 610, + "y": 600, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "953b6b23-1d3e-4695-994e-e3075fbcbf02", + "rotationX": 20, + "width": 0, + "x": 730, + "y": 480, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "f6c657ff-b79c-4ba6-9eba-edd78466230e", + "rotationX": 20, + "width": 0, + "x": 790, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "3092dab0-6353-4f4a-bb90-4d6cd96bd0e2", + "rotationX": 20, + "width": 0, + "x": 790, + "y": 300, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "cb5ca316-2958-486c-ac3b-1d13942311bb", + "rotationX": 20, + "width": 0, + "x": 790, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "574874ce-2e5b-44ce-b407-f64e94044bed", + "rotationX": 20, + "width": 0, + "x": 850, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "3356e0ee-0d3e-49ba-bc3d-4587eaa01555", + "rotationX": 20, + "width": 0, + "x": 610, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "9ec29ae1-4d24-4a40-b703-03c2c8dc8327", + "rotationX": 20, + "width": 0, + "x": 550, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "8d985ba0-7d41-4e4b-9dbc-512128e487d4", + "rotationX": 20, + "width": 0, + "x": 490, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "66dc94e1-debe-4a9c-84cb-7eaa0d8d42c8", + "rotationX": 20, + "width": 0, + "x": 430, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "8fe1562f-52a3-48ee-8920-463a7f5f0498", + "rotationX": 20, + "width": 0, + "x": 310, + "y": 180, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "93250834-bef3-47c9-9f5f-3303855cb82f", + "rotationX": 20, + "width": 0, + "x": 550, + "y": 180, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "2a261577-96a4-4ea7-aac6-dc173da624d3", + "rotationX": 20, + "width": 0, + "x": 490, + "y": 120, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "90dcfe7f-335c-4e02-ac01-3e047bf97fcc", + "rotationX": 20, + "width": 0, + "x": 670, + "y": 180, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "db1e25d8-88bd-40f8-9845-12409b695513", + "rotationX": 20, + "width": 0, + "x": 670, + "y": 120, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "b0d6b919-7f70-4562-9a92-9ee8865a47fc", + "rotationX": 20, + "width": 0, + "x": 610, + "y": 0, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "ebf64cad-6a61-4024-95a7-d7fe36417325", + "rotationX": 20, + "width": 0, + "x": 790, + "y": 60, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "7c1e2a8e-3e17-40aa-9e2c-06b0ab6c33ce", + "rotationX": 20, + "width": 0, + "x": 910, + "y": 0, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "7b5c6d22-073f-4bd4-82c6-1be2a9cb821e", + "rotationX": 20, + "width": 0, + "x": 910, + "y": 180, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "566a8069-f8cf-4163-918c-96ff12a677fd", + "rotationX": 20, + "width": 0, + "x": 970, + "y": 120, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 40, + "height": 780, + "layer": "", + "name": "BlockRoundedLong", + "persistentUuid": "88aad7da-eae1-40ee-863b-aced495eb3b7", + "width": 60, + "x": 160, + "y": 330, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 40, + "height": 1020, + "layer": "", + "name": "BlockRoundedLong", + "persistentUuid": "4bccbfb2-ac13-4f51-834b-b86d8c3954a3", + "width": 60, + "x": 640, + "y": -30, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 40, + "height": 1020, + "layer": "", + "name": "BlockRoundedLong", + "persistentUuid": "58137fde-cba2-40c6-9abe-e2d44db1fc2d", + "width": 60, + "x": 640, + "y": 690, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 40, + "height": 780, + "layer": "", + "name": "BlockRoundedLong", + "persistentUuid": "743c15b4-fefb-4898-9c98-03c002b64331", + "width": 60, + "x": 1120, + "y": 330, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "BlueBunny", + "persistentUuid": "d215408a-951f-495f-aef7-94849aa89639", + "width": 0, + "x": 1036, + "y": 624, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "PinkBunny", + "persistentUuid": "bec5a1c6-d7cc-498d-b458-c32de613db3e", + "width": 0, + "x": 1036, + "y": 24, + "zOrder": 15, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "OrangeBunny", + "persistentUuid": "dbe90f46-ae68-4863-bde9-44f85ca2b2bd", + "width": 0, + "x": 244, + "y": 624, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "PurpleBunny", + "persistentUuid": "6aa5c9ea-48f7-4813-9359-7bddcf707535", + "width": 0, + "x": 244, + "y": 34, + "zOrder": 17, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0.01, + "height": 1020, + "layer": "", + "name": "New3DBox", + "persistentUuid": "16caa0f7-1c87-4ecb-9015-d5dc1a2b8d4a", + "width": 300, + "x": -170, + "y": -240, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0.01, + "height": 1020, + "layer": "", + "name": "New3DBox", + "persistentUuid": "26f5a6c7-785d-4dee-b46a-83b1a990e38c", + "width": 300, + "x": 1150, + "y": -240, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0.01, + "height": 180, + "layer": "", + "name": "New3DBox", + "persistentUuid": "7e1d81dc-ceb0-4627-88c4-4f23d7eb35f3", + "width": 1140, + "x": 70, + "y": -240, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": true, + "gridType": "rectangular", + "gridWidth": 60, + "gridHeight": 60, + "gridOffsetX": 10, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": true, + "zoomFactor": 0.7357437357282408, + "windowMask": false + } + }, + { + "associatedLayout": "Game", + "name": "ClassicLevel", + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 68, + "layer": "", + "name": "Player1", + "persistentUuid": "6d8912b5-6de2-4cf4-926c-2952e708a590", + "width": 82, + "x": 1030, + "y": 600, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 68, + "layer": "", + "name": "Player2", + "persistentUuid": "2b89c85e-e86a-48d5-ac4d-a90dcda0f833", + "width": 82, + "x": 190, + "y": 0, + "zOrder": 5, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 68, + "layer": "", + "name": "Player3", + "persistentUuid": "513d236d-ffbc-4367-917a-dd9eaa59ce66", + "width": 82, + "x": 190, + "y": 600, + "zOrder": 9, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 68, + "layer": "", + "name": "Player4", + "persistentUuid": "7e397593-ecf8-4d95-b0c6-ea43b45731f2", + "width": 82, + "x": 1030, + "y": 0, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "1479ec1f-6788-4270-a80b-a539ae87d4bf", + "width": 83, + "x": 970, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "0d19c4d2-3a1e-4b5e-b3a4-6bf9c0623a4b", + "width": 83, + "x": 850, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "9dffcbb9-6373-442a-9400-45906019d0ec", + "width": 83, + "x": 970, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "4db92229-60ce-4e99-8bf8-a57c742c8835", + "width": 83, + "x": 970, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "1723070a-0d1d-4d56-a682-88190aa03563", + "width": 83, + "x": 970, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "c564b69a-e20d-4c6c-a6c6-52a7b3ab33ad", + "width": 83, + "x": 970, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "f337d51c-3b06-4bdb-a706-2432af9ee882", + "width": 83, + "x": 850, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "07f03b85-3189-4763-87c3-d61cbcfa83e3", + "width": 83, + "x": 730, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "e7dd62ed-9e23-4f13-acd9-44bae16eb8df", + "width": 83, + "x": 610, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "50234579-c76d-4c30-9c22-fa6bd3804139", + "width": 83, + "x": 490, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "21862bc4-c5e5-4b37-8e1a-c3a1780ba58c", + "width": 83, + "x": 370, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "8ec9f9e8-db69-45f5-b9f9-243d510f8c5f", + "width": 83, + "x": 250, + "y": 540, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "d625ba7c-b6e8-4c0e-ad0d-1caf9b745d52", + "width": 83, + "x": 250, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "76fef138-ca6e-4c6b-9f66-2813b256933b", + "width": 83, + "x": 370, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "236b64c0-c371-473d-843c-4746400d410b", + "width": 83, + "x": 490, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "37c39a3d-9c52-4131-91ba-703066183532", + "width": 83, + "x": 610, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "37990ea9-9fa5-4767-8d74-05b6a69b8e08", + "width": 83, + "x": 730, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "76439fb7-7bb7-48ea-9666-1a5b49bd2bd5", + "width": 83, + "x": 850, + "y": 420, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "46da50ea-cb57-45be-aa88-721cf9983a92", + "width": 83, + "x": 850, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "e4dc9361-e606-4372-a8c8-d5b0f90c81b5", + "width": 83, + "x": 730, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "eff5f4d8-16d8-4f86-8a22-a22d04eedab1", + "width": 83, + "x": 610, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "616318ca-e38b-46f2-a0bd-b2c814c5ad80", + "width": 83, + "x": 490, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "1d151d32-cdc6-4b2f-9b9a-9410ca087f60", + "width": 83, + "x": 370, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "b3d797fd-c541-435f-ab15-3ea74195e056", + "width": 83, + "x": 250, + "y": 300, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "48f0b405-5553-4cd3-b38a-690e81060902", + "width": 83, + "x": 250, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "7fc9ec03-9401-4ab5-9d38-d732c436df18", + "width": 83, + "x": 370, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "abdad73f-9496-4cec-8a15-66d4bae88fbb", + "width": 83, + "x": 490, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "27d7fa1a-b6dc-4858-b634-9114e34818ce", + "width": 83, + "x": 610, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "446b1fa4-d79c-4e00-b414-e465ffa7de53", + "width": 83, + "x": 730, + "y": 180, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "3f28fda6-e818-42dc-a7d0-e56701cc2e1b", + "width": 83, + "x": 730, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "9efc7a89-6014-491c-a3b0-32ee51fc7c5b", + "width": 83, + "x": 850, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "c0975cba-1f3b-4b95-bcf3-3e820b31b128", + "width": 83, + "x": 610, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "44004448-dc47-4982-b39c-270c24bd3619", + "width": 83, + "x": 490, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "fcf82fc9-06fd-423c-b7c8-9396bd6d9f85", + "width": 83, + "x": 370, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 91, + "layer": "", + "name": "Rock", + "persistentUuid": "abc27306-06e8-4742-ae7c-9d2de7c7577a", + "width": 83, + "x": 250, + "y": 60, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "c1c631c4-4958-4b29-848b-c82369971715", + "rotationX": 20, + "width": 0, + "x": 370, + "y": 480, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "f6b2a15f-2d44-4bde-be85-e072e3b7ccf1", + "rotationX": 20, + "width": 0, + "x": 190, + "y": 420, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "2534c710-521f-43c5-9bfb-a8f50f17a796", + "rotationX": 20, + "width": 0, + "x": 430, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "ac32b782-2839-428e-b2d3-bdfc1b43f276", + "rotationX": 20, + "width": 0, + "x": 550, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "6a468f9a-53d8-48f7-b561-7f0a10eaf226", + "rotationX": 20, + "width": 0, + "x": 250, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "19bfac8e-4202-4a8e-b37a-62c745a8cafc", + "rotationX": 20, + "width": 0, + "x": 190, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "fea69ae5-d6a3-49d8-b2a7-90e123ffbef9", + "rotationX": 20, + "width": 0, + "x": 550, + "y": 600, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "ad2e9ec4-fdc6-4958-b902-4f2ca1f4a1b0", + "rotationX": 20, + "width": 0, + "x": 790, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "af6087ef-987e-4242-80df-330ca7ec050b", + "rotationX": 20, + "width": 0, + "x": 790, + "y": 300, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "8ed56622-20b4-4cf8-9870-395e08d10b1d", + "rotationX": 20, + "width": 0, + "x": 790, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "37460546-16a1-4421-a180-0907a2ee5042", + "rotationX": 20, + "width": 0, + "x": 850, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "4e1272e3-0172-44be-b8e1-8117e5a093f7", + "rotationX": 20, + "width": 0, + "x": 610, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "9443bb2e-179d-4f56-913a-b449fbec3069", + "rotationX": 20, + "width": 0, + "x": 550, + "y": 120, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "31dbd522-38d6-44b4-bb77-9b667b5f6e84", + "rotationX": 20, + "width": 0, + "x": 490, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "b252abb8-7d06-4cb3-badc-d0fb68417b8e", + "rotationX": 20, + "width": 0, + "x": 550, + "y": 180, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "eee0de66-b1dd-4f73-bfcd-184c0261c78d", + "rotationX": 20, + "width": 0, + "x": 310, + "y": 180, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "307d06ce-c89e-4697-9139-4f32509adda6", + "rotationX": 20, + "width": 0, + "x": 610, + "y": 120, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "b579160d-34f6-4f42-8932-44f4cf235259", + "rotationX": 20, + "width": 0, + "x": 670, + "y": 0, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "a617f531-6d8f-4a0c-a57e-0170d49a5f95", + "rotationX": 20, + "width": 0, + "x": 670, + "y": 180, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "90f3b608-d7c3-4a4c-8959-e738b442d8ff", + "rotationX": 20, + "width": 0, + "x": 670, + "y": 120, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "d4a409ef-613f-405d-b061-2b46e48be3e6", + "rotationX": 20, + "width": 0, + "x": 550, + "y": 0, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "b7281363-424c-4871-85d3-adfdb265a948", + "rotationX": 20, + "width": 0, + "x": 790, + "y": 60, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "3fff4a2a-6d7b-4fff-b081-ee04e0ebbb9f", + "rotationX": 20, + "width": 0, + "x": 910, + "y": 0, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "0d9edfe7-ac99-4996-805d-d53a7f86e585", + "rotationX": 20, + "width": 0, + "x": 910, + "y": 180, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "f8926e55-3667-4191-b1f9-2a14f6e5e491", + "rotationX": 20, + "width": 0, + "x": 970, + "y": 120, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 40, + "height": 780, + "layer": "", + "name": "BlockRoundedLong", + "persistentUuid": "511cc5b4-3809-46dc-8e84-9c1d9511ad24", + "width": 60, + "x": 160, + "y": 330, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 40, + "height": 1020, + "layer": "", + "name": "BlockRoundedLong", + "persistentUuid": "e43e066c-478a-49f3-ae5d-eee9d0ee539c", + "width": 60, + "x": 640, + "y": -30, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 40, + "height": 1020, + "layer": "", + "name": "BlockRoundedLong", + "persistentUuid": "9c137a7a-47c8-432e-80e3-292ba7da24dc", + "width": 60, + "x": 640, + "y": 690, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 40, + "height": 780, + "layer": "", + "name": "BlockRoundedLong", + "persistentUuid": "af27a554-7f6f-439b-9d5c-1bd4af771284", + "width": 60, + "x": 1120, + "y": 330, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "BlueBunny", + "persistentUuid": "3cc5034c-7d2b-4e8b-937f-32ee4bcd07e1", + "width": 0, + "x": 1036, + "y": 624, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "2bcbca40-081b-4340-b679-7f9d9feec415", + "rotationX": 20, + "width": 0, + "x": 190, + "y": 480, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "c445a8b1-0f9b-44d3-9182-e37f3187ea05", + "rotationX": 20, + "width": 0, + "x": 190, + "y": 120, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "28f722ae-3022-4075-a688-f66361b3e4ef", + "rotationX": 20, + "width": 0, + "x": 190, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "006a2fd6-7e85-4462-a934-4d59439fe52b", + "rotationX": 20, + "width": 0, + "x": 190, + "y": 180, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "f616b47c-c9ba-4a62-a5b3-f37cc7311fb9", + "rotationX": 20, + "width": 0, + "x": 250, + "y": 120, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "dcde3008-572a-48d1-8fdf-a038598d9072", + "rotationX": 20, + "width": 0, + "x": 370, + "y": 120, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "0fbb0454-3e45-4652-9f71-2521d2f317f6", + "rotationX": 20, + "width": 0, + "x": 370, + "y": 0, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "580bea76-8906-43cd-9356-67f43845bbd8", + "rotationX": 20, + "width": 0, + "x": 430, + "y": 60, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "01a7c20d-0950-4ca0-8230-f8585c96dec4", + "rotationX": 20, + "width": 0, + "x": 310, + "y": 60, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "b7da0120-8712-4f31-bca3-1554c490b6fc", + "rotationX": 20, + "width": 0, + "x": 310, + "y": 0, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "61cf3590-7433-4517-b16d-15d2d2ed3355", + "rotationX": 20, + "width": 0, + "x": 250, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "a58b21d0-d146-4544-b751-7366faa50b16", + "rotationX": 20, + "width": 0, + "x": 310, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "e0d3cb0a-5d30-4c91-86ab-ff5701f8bf85", + "rotationX": 20, + "width": 0, + "x": 370, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "416dc9e1-0fc5-4032-897c-5a3fb5510427", + "rotationX": 20, + "width": 0, + "x": 430, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "8a101d83-4289-4b19-aad5-619006a32bd1", + "rotationX": 20, + "width": 0, + "x": 550, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "d4bd8491-995d-47bf-87f8-dd00908d3d6b", + "rotationX": 20, + "width": 0, + "x": 670, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "015d63f8-df7e-4831-ba06-46b2f5dc526b", + "rotationX": 20, + "width": 0, + "x": 730, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "f27fecb2-ea40-4a75-a7b1-bb2592da03e7", + "rotationX": 20, + "width": 0, + "x": 910, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "f6a15154-50f2-4e58-a741-4e85d44449d5", + "rotationX": 20, + "width": 0, + "x": 970, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "f58309d9-fe3c-4e25-85e1-52e9690ab10d", + "rotationX": 20, + "width": 0, + "x": 1030, + "y": 240, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "dc6b5ea1-78d2-4204-8d34-aaee0cb95d9d", + "rotationX": 20, + "width": 0, + "x": 310, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "75cbcdf8-b44a-4fea-b53d-2bcf854f4e40", + "rotationX": 20, + "width": 0, + "x": 370, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "a6e9b351-9896-41da-99b3-883455412122", + "rotationX": 20, + "width": 0, + "x": 490, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "5ef9a6aa-e0f7-425d-9b9b-1fcaf2525fef", + "rotationX": 20, + "width": 0, + "x": 610, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "122d5281-487f-4fbd-8f40-0ab92bbe90f0", + "rotationX": 20, + "width": 0, + "x": 670, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "938f5d11-7ed0-46dc-9a99-950363680027", + "rotationX": 20, + "width": 0, + "x": 730, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "c6013de8-f842-4d93-9664-b0bf3849de49", + "rotationX": 20, + "width": 0, + "x": 850, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "7ebca086-b64e-4c0c-a755-f10e8b9b3208", + "rotationX": 20, + "width": 0, + "x": 910, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "428a25c3-eec3-4c32-98dd-5f5aab3d4643", + "rotationX": 20, + "width": 0, + "x": 970, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "6656a362-beeb-4f57-874b-b9f3222960fe", + "rotationX": 20, + "width": 0, + "x": 1030, + "y": 360, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "1c736108-d57e-440b-b20c-4d3d9e877aed", + "rotationX": 20, + "width": 0, + "x": 1030, + "y": 420, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "3747bb3f-ea7a-4518-8d91-53aa57c5478a", + "rotationX": 20, + "width": 0, + "x": 1030, + "y": 480, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "f08bc80c-9290-4500-9e29-73f564fb0bac", + "rotationX": 20, + "width": 0, + "x": 970, + "y": 480, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "68d35a6a-bce7-4008-b3ee-a62ddae2b7c4", + "rotationX": 20, + "width": 0, + "x": 910, + "y": 480, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "badfe60e-794f-4c06-9a41-7dfcfab0d96b", + "rotationX": 20, + "width": 0, + "x": 910, + "y": 420, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "fb02717a-d3fd-44e4-84fb-bb8287d907db", + "rotationX": 20, + "width": 0, + "x": 1030, + "y": 180, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "30eceaad-0cf2-424b-a153-17642e2ba6e9", + "rotationX": 20, + "width": 0, + "x": 1030, + "y": 120, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "f9c9141d-50f4-43fc-b085-2906b20ae3ec", + "rotationX": 20, + "width": 0, + "x": 910, + "y": 120, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "12565ce0-8dc5-4d1e-ba5a-fa945743a013", + "rotationX": 20, + "width": 0, + "x": 850, + "y": 0, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "748b2f3e-4136-49bf-8967-c566ac112824", + "rotationX": 20, + "width": 0, + "x": 910, + "y": 60, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "2de8459a-bcac-4a76-afce-bf8ca16d893c", + "rotationX": 20, + "width": 0, + "x": 550, + "y": 300, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "d54e027e-12cf-4ad2-8597-cd283af6281b", + "rotationX": 20, + "width": 0, + "x": 670, + "y": 300, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "7d75b0c8-fbf9-499b-bb42-f30f1cdda91a", + "rotationX": 20, + "width": 0, + "x": 550, + "y": 420, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "edf6cdc8-1df8-461b-aded-a93c2a292bbe", + "rotationX": 20, + "width": 0, + "x": 670, + "y": 420, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "5c6550e6-f096-47b6-856e-7b89b4860e4a", + "rotationX": 20, + "width": 0, + "x": 550, + "y": 480, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "805fd263-441a-4037-9da5-dd558af783bf", + "rotationX": 20, + "width": 0, + "x": 610, + "y": 480, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "221377f6-d8b7-4399-9d44-a2d3d70f80cd", + "rotationX": 20, + "width": 0, + "x": 670, + "y": 480, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "afdfe2d5-4876-4e81-b417-647eefe3fcb0", + "rotationX": 20, + "width": 0, + "x": 670, + "y": 600, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "62aa0ff3-c78a-43c7-8718-e12f6a689be0", + "rotationX": 20, + "width": 0, + "x": 790, + "y": 540, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "de80d2ff-1af1-4f2e-999c-cfa09e93b1de", + "rotationX": 20, + "width": 0, + "x": 850, + "y": 600, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "38fe563f-f78e-4b49-aaaa-9e5cced7a3bb", + "rotationX": 20, + "width": 0, + "x": 910, + "y": 600, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "ce83b2d6-a1a6-40ad-8802-59b41303ad7a", + "rotationX": 20, + "width": 0, + "x": 910, + "y": 540, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "cd6618eb-a3b9-441a-910a-1f5a923dbf9a", + "rotationX": 20, + "width": 0, + "x": 430, + "y": 540, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "15d6fa2a-1a02-4ac2-847a-5ea4c125289e", + "rotationX": 20, + "width": 0, + "x": 370, + "y": 600, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "1aee7747-bb02-431c-afed-9f58f14f3f60", + "rotationX": 20, + "width": 0, + "x": 310, + "y": 600, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "f8f398b3-5549-40c8-bc17-8e213a24642f", + "rotationX": 20, + "width": 0, + "x": 310, + "y": 540, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "2ae3aec4-6415-4dd9-b3e1-a226053b41ee", + "rotationX": 20, + "width": 0, + "x": 310, + "y": 480, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "554bfc7b-5e2a-411c-b926-2828179528a4", + "rotationX": 20, + "width": 0, + "x": 310, + "y": 420, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "56f845ea-ba61-4415-95ca-732f76bdac29", + "rotationX": 20, + "width": 0, + "x": 250, + "y": 480, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "e455858b-1882-44fb-a3c3-7afc4a4a8373", + "rotationX": 20, + "width": 0, + "x": 310, + "y": 120, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "5a9c4b4d-87b5-4740-8732-fd18ec997af0", + "rotationX": 20, + "width": 0, + "x": 310, + "y": 300, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "7844f2a9-b41f-469a-beeb-9487f22158ef", + "rotationX": 20, + "width": 0, + "x": 910, + "y": 300, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "23e69387-dcec-42dd-9766-13a7c1bd5c97", + "rotationX": 20, + "width": 0, + "x": 430, + "y": 300, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "PinkBunny", + "persistentUuid": "049d618c-239e-4c7b-b1bc-d9b9927bb44c", + "width": 0, + "x": 1036, + "y": 24, + "zOrder": 15, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0.01, + "height": 1020, + "layer": "", + "name": "New3DBox", + "persistentUuid": "a3e4f555-26a6-4473-87c4-a1d93a081265", + "width": 300, + "x": -170, + "y": -240, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0.01, + "height": 180, + "layer": "", + "name": "New3DBox", + "persistentUuid": "79f10613-cdba-497d-aec7-8b82f8db49c9", + "width": 1140, + "x": 70, + "y": -240, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0.01, + "height": 1020, + "layer": "", + "name": "New3DBox", + "persistentUuid": "5d935e32-e7d2-4524-8513-870b0239dc64", + "width": 300, + "x": 1150, + "y": -240, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "PurpleBunny", + "persistentUuid": "64524959-335e-4bc8-a0ce-dc510e61e25d", + "width": 0, + "x": 244, + "y": 24, + "zOrder": 19, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "OrangeBunny", + "persistentUuid": "3c33e146-7812-4e39-8176-31d418fc3c98", + "width": 0, + "x": 244, + "y": 624, + "zOrder": 20, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": true, + "gridType": "rectangular", + "gridWidth": 60, + "gridHeight": 60, + "gridOffsetX": 10, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": true, + "zoomFactor": 0.6749291901856892, + "windowMask": false + } + }, + { + "associatedLayout": "Game", + "name": "SoilBorders", + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 0.01, + "height": 600, + "layer": "", + "name": "SoilBorder", + "persistentUuid": "8d20a9f8-cf18-4128-be3d-1cfd173cdb5d", + "width": 60, + "x": 160, + "y": 30, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": true, + "depth": 0.01, + "height": 600, + "layer": "", + "name": "SoilBorder", + "persistentUuid": "62fee90c-a67e-40dc-91af-d2582dfd9139", + "width": 60, + "x": 1060, + "y": 30, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 0.01, + "height": 840, + "layer": "", + "name": "SoilBorder", + "persistentUuid": "1c4791e4-f359-4686-a9eb-9e8f2b90698c", + "width": 60, + "x": 610, + "y": -420, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "SoilCorner", + "persistentUuid": "161eb0d6-e83e-4497-aeac-20df2dc790f0", + "width": 0, + "x": 160, + "y": -30, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "SoilCorner", + "persistentUuid": "3d51f0c2-4353-4e6c-82a1-bcae943b0eae", + "width": 0, + "x": 1060, + "y": -30, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "SoilCorner", + "persistentUuid": "2cf8ee75-feba-4f7a-956c-05aaeb776417", + "width": 0, + "x": 1060, + "y": 630, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": -90, + "customSize": false, + "height": 0, + "layer": "", + "name": "SoilCorner", + "persistentUuid": "d3252456-292f-442a-956a-c0feb247d6dd", + "width": 0, + "x": 160, + "y": 630, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": -90, + "customSize": true, + "depth": 0.01, + "height": 840, + "layer": "", + "name": "SoilBorder", + "persistentUuid": "14ced4a4-87c6-452a-8bd6-6e8d81f5f6b8", + "width": 60, + "x": 610, + "y": 240, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": true, + "gridType": "rectangular", + "gridWidth": 30, + "gridHeight": 30, + "gridOffsetX": 10, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.3, + "snap": true, + "zoomFactor": 0.7619362677197657, + "windowMask": false + } + } + ], + "externalSourceFiles": [] +} \ No newline at end of file diff --git a/examples/3d-bomber-bunny/README.md b/examples/3d-bomber-bunny/README.md new file mode 100644 index 000000000..44e3a8aae --- /dev/null +++ b/examples/3d-bomber-bunny/README.md @@ -0,0 +1 @@ +A bomberman-like game for up to 4 players with procedural animations and particles. \ No newline at end of file diff --git a/examples/3d-bomber-bunny/TAGS.md b/examples/3d-bomber-bunny/TAGS.md new file mode 100644 index 000000000..09ba07039 --- /dev/null +++ b/examples/3d-bomber-bunny/TAGS.md @@ -0,0 +1 @@ +game, advanced \ No newline at end of file diff --git a/examples/3d-bomber-bunny/assets/BlueBunny.glb b/examples/3d-bomber-bunny/assets/BlueBunny.glb new file mode 100644 index 000000000..61c0b0094 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/BlueBunny.glb differ diff --git a/examples/3d-bomber-bunny/assets/BlueBunnyIcon.png b/examples/3d-bomber-bunny/assets/BlueBunnyIcon.png new file mode 100644 index 000000000..b39d45d36 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/BlueBunnyIcon.png differ diff --git a/examples/3d-bomber-bunny/assets/Bomb.glb b/examples/3d-bomber-bunny/assets/Bomb.glb new file mode 100644 index 000000000..0eea01124 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/Bomb.glb differ diff --git a/examples/3d-bomber-bunny/assets/Bomb.png b/examples/3d-bomber-bunny/assets/Bomb.png new file mode 100644 index 000000000..255fbe0ee Binary files /dev/null and b/examples/3d-bomber-bunny/assets/Bomb.png differ diff --git a/examples/3d-bomber-bunny/assets/BombeBonus.png b/examples/3d-bomber-bunny/assets/BombeBonus.png new file mode 100644 index 000000000..79e0677a1 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/BombeBonus.png differ diff --git a/examples/3d-bomber-bunny/assets/Cabbage.glb b/examples/3d-bomber-bunny/assets/Cabbage.glb new file mode 100644 index 000000000..2eb65a8e7 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/Cabbage.glb differ diff --git a/examples/3d-bomber-bunny/assets/ClassicLevel.png b/examples/3d-bomber-bunny/assets/ClassicLevel.png new file mode 100644 index 000000000..1eea45a58 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/ClassicLevel.png differ diff --git a/examples/3d-bomber-bunny/assets/EmptyLevel.png b/examples/3d-bomber-bunny/assets/EmptyLevel.png new file mode 100644 index 000000000..47a9c888d Binary files /dev/null and b/examples/3d-bomber-bunny/assets/EmptyLevel.png differ diff --git a/examples/3d-bomber-bunny/assets/ExplosionCentre-Anim5.png b/examples/3d-bomber-bunny/assets/ExplosionCentre-Anim5.png new file mode 100644 index 000000000..ac4e7a9d6 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/ExplosionCentre-Anim5.png differ diff --git a/examples/3d-bomber-bunny/assets/FlammeBonus.png b/examples/3d-bomber-bunny/assets/FlammeBonus.png new file mode 100644 index 000000000..8bcf5f94f Binary files /dev/null and b/examples/3d-bomber-bunny/assets/FlammeBonus.png differ diff --git a/examples/3d-bomber-bunny/assets/FlashyRock.glb b/examples/3d-bomber-bunny/assets/FlashyRock.glb new file mode 100644 index 000000000..09d937b9a Binary files /dev/null and b/examples/3d-bomber-bunny/assets/FlashyRock.glb differ diff --git a/examples/3d-bomber-bunny/assets/GreyBlock.glb b/examples/3d-bomber-bunny/assets/GreyBlock.glb new file mode 100644 index 000000000..cc5fa3a76 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/GreyBlock.glb differ diff --git a/examples/3d-bomber-bunny/assets/JoueurSelectionMask.png b/examples/3d-bomber-bunny/assets/JoueurSelectionMask.png new file mode 100644 index 000000000..1381b75ce Binary files /dev/null and b/examples/3d-bomber-bunny/assets/JoueurSelectionMask.png differ diff --git a/examples/3d-bomber-bunny/assets/New image.png b/examples/3d-bomber-bunny/assets/New image.png new file mode 100644 index 000000000..fd17c69a4 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/New image.png differ diff --git a/examples/3d-bomber-bunny/assets/NewObject.png b/examples/3d-bomber-bunny/assets/NewObject.png new file mode 100644 index 000000000..e64659d07 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/NewObject.png differ diff --git a/examples/3d-bomber-bunny/assets/NewSprite.png b/examples/3d-bomber-bunny/assets/NewSprite.png new file mode 100644 index 000000000..8406785e1 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/NewSprite.png differ diff --git a/examples/3d-bomber-bunny/assets/NiveauClassique.png b/examples/3d-bomber-bunny/assets/NiveauClassique.png new file mode 100644 index 000000000..76708d466 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/NiveauClassique.png differ diff --git a/examples/3d-bomber-bunny/assets/NiveauVide.png b/examples/3d-bomber-bunny/assets/NiveauVide.png new file mode 100644 index 000000000..38f38bbbf Binary files /dev/null and b/examples/3d-bomber-bunny/assets/NiveauVide.png differ diff --git a/examples/3d-bomber-bunny/assets/Orange.png b/examples/3d-bomber-bunny/assets/Orange.png new file mode 100644 index 000000000..56da6c303 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/Orange.png differ diff --git a/examples/3d-bomber-bunny/assets/OrangeBunny.glb b/examples/3d-bomber-bunny/assets/OrangeBunny.glb new file mode 100644 index 000000000..823aacb0f Binary files /dev/null and b/examples/3d-bomber-bunny/assets/OrangeBunny.glb differ diff --git a/examples/3d-bomber-bunny/assets/OrangeBunnyIcon.png b/examples/3d-bomber-bunny/assets/OrangeBunnyIcon.png new file mode 100644 index 000000000..ae472b336 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/OrangeBunnyIcon.png differ diff --git a/examples/3d-bomber-bunny/assets/Pink.png b/examples/3d-bomber-bunny/assets/Pink.png new file mode 100644 index 000000000..1fb004f86 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/Pink.png differ diff --git a/examples/3d-bomber-bunny/assets/PinkBunny.glb b/examples/3d-bomber-bunny/assets/PinkBunny.glb new file mode 100644 index 000000000..2c7934bf7 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/PinkBunny.glb differ diff --git a/examples/3d-bomber-bunny/assets/PinkBunnyIcon.png b/examples/3d-bomber-bunny/assets/PinkBunnyIcon.png new file mode 100644 index 000000000..ea1396967 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/PinkBunnyIcon.png differ diff --git a/examples/3d-bomber-bunny/assets/Purple.png b/examples/3d-bomber-bunny/assets/Purple.png new file mode 100644 index 000000000..72c3697f2 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/Purple.png differ diff --git a/examples/3d-bomber-bunny/assets/PurpleBunny.glb b/examples/3d-bomber-bunny/assets/PurpleBunny.glb new file mode 100644 index 000000000..5796b1967 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/PurpleBunny.glb differ diff --git a/examples/3d-bomber-bunny/assets/PurpleBunnyIcon.png b/examples/3d-bomber-bunny/assets/PurpleBunnyIcon.png new file mode 100644 index 000000000..2c01bb900 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/PurpleBunnyIcon.png differ diff --git a/examples/3d-bomber-bunny/assets/SmoothParticle.png b/examples/3d-bomber-bunny/assets/SmoothParticle.png new file mode 100644 index 000000000..871c194cc Binary files /dev/null and b/examples/3d-bomber-bunny/assets/SmoothParticle.png differ diff --git a/examples/3d-bomber-bunny/assets/Soil2.png b/examples/3d-bomber-bunny/assets/Soil2.png new file mode 100644 index 000000000..118c7f1d6 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/Soil2.png differ diff --git a/examples/3d-bomber-bunny/assets/SoilBorder.png b/examples/3d-bomber-bunny/assets/SoilBorder.png new file mode 100644 index 000000000..8b71d4c8e Binary files /dev/null and b/examples/3d-bomber-bunny/assets/SoilBorder.png differ diff --git a/examples/3d-bomber-bunny/assets/SoilCorner.png b/examples/3d-bomber-bunny/assets/SoilCorner.png new file mode 100644 index 000000000..58fc2d149 Binary files /dev/null and b/examples/3d-bomber-bunny/assets/SoilCorner.png differ diff --git a/examples/3d-bomber-bunny/assets/blockRoundedLong.glb b/examples/3d-bomber-bunny/assets/blockRoundedLong.glb new file mode 100644 index 000000000..b69a8eaef Binary files /dev/null and b/examples/3d-bomber-bunny/assets/blockRoundedLong.glb differ diff --git a/examples/3d-bomber-bunny/preview.png b/examples/3d-bomber-bunny/preview.png new file mode 100644 index 000000000..833ff9202 Binary files /dev/null and b/examples/3d-bomber-bunny/preview.png differ