From d1bb1cdecdc1350262fea231e0ea854c108d5268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 21 Nov 2025 17:37:48 +0100 Subject: [PATCH 1/2] [3D Car Coin Hunt] Put the level in the main scene --- .../3d-car-coin-hunt/3d-car-coin-hunt.json | 95403 ++++++++-------- examples/3d-car-coin-hunt/assets/FoggySky.png | Bin 3629 -> 0 bytes 2 files changed, 47645 insertions(+), 47758 deletions(-) delete mode 100644 examples/3d-car-coin-hunt/assets/FoggySky.png diff --git a/examples/3d-car-coin-hunt/3d-car-coin-hunt.json b/examples/3d-car-coin-hunt/3d-car-coin-hunt.json index e3b6f8fbc..55eea1911 100644 --- a/examples/3d-car-coin-hunt/3d-car-coin-hunt.json +++ b/examples/3d-car-coin-hunt/3d-car-coin-hunt.json @@ -1,7 +1,7 @@ { "firstLayout": "Menu", "gdVersion": { - "build": 244, + "build": 245, "major": 5, "minor": 5, "revision": 0 @@ -87,6 +87,7 @@ "playableDevices": [ "keyboard", "gamepad", + "mobile", "mobile" ], "extensionProperties": [], @@ -545,14 +546,6 @@ "name": "rotate-screen-icon.png" } }, - { - "file": "assets/FoggySky.png", - "kind": "image", - "metadata": "", - "name": "assets\\FoggySky.png", - "smoothed": true, - "userAdded": false - }, { "file": "assets/Orange Bubble Button_Hovered.png", "kind": "image", @@ -684,8 +677,7 @@ "smoothed": true, "userAdded": false } - ], - "resourceFolders": [] + ] }, "objects": [], "objectsFolderStructure": { @@ -1093,6 +1085,7 @@ "ambientLightColorB": 200, "ambientLightColorG": 200, "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 0.1, @@ -1121,6 +1114,7 @@ "ambientLightColorB": 200, "ambientLightColorG": 200, "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 3, @@ -1183,27 +1177,30 @@ ] }, { - "b": 215, + "b": 39, "disableInputWhenNotFocused": true, "mangledName": "Game", "name": "Game", - "r": 221, + "r": 39, "standardSortMethod": true, "stopSoundsOnStartup": true, "title": "", - "v": 221, + "v": 39, "uiSettings": { - "grid": false, + "grid": true, "gridType": "rectangular", "gridWidth": 128, "gridHeight": 128, + "gridDepth": 32, "gridOffsetX": 0, "gridOffsetY": 0, + "gridOffsetZ": 0, "gridColor": 10401023, - "gridAlpha": 0.8, - "snap": false, - "zoomFactor": 0.5843784410740933, - "windowMask": false + "gridAlpha": 0.5, + "snap": true, + "zoomFactor": 0.6455105703311488, + "windowMask": false, + "selectedLayer": "" }, "objectsGroups": [ { @@ -1291,14 +1288,16 @@ { "angle": 0, "customSize": false, - "height": 46, - "layer": "UI", - "name": "BestTimeText", - "persistentUuid": "30596d44-7cf8-4fee-8fdd-c76c86c9e777", - "width": 187, - "x": 5, - "y": 50, - "zOrder": 23, + "height": 159.1836734693878, + "keepRatio": true, + "layer": "", + "name": "Player", + "persistentUuid": "894bdbd1-6dc0-474b-ae8a-1ced5a9cc957", + "width": 300, + "x": -1407, + "y": 268, + "z": 10, + "zOrder": 26, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -1307,28 +1306,31 @@ "angle": 0, "customSize": false, "height": 0, - "layer": "UI", - "name": "TimeText", - "persistentUuid": "cec96115-b593-411f-93ad-8ed85b3ea2eb", + "layer": "", + "name": "Coin", + "persistentUuid": "0da5d162-ce33-441f-a8d3-ff017d2fd2d5", + "rotationY": 90, "width": 0, - "x": 5, - "y": 0, - "zOrder": 24, + "x": 1664, + "y": 371, + "z": 21, + "zOrder": 27, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { "angle": 0, - "customSize": true, - "depth": 0, - "height": 44, - "layer": "UI", - "name": "TutorialText", - "persistentUuid": "10449ac5-6445-4470-a25a-84dbe88687ba", - "width": 604, - "x": 4, - "y": 688, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "86323d49-bfee-409d-910f-fdeea6999501", + "rotationY": 90, + "width": 0, + "x": 1568, + "y": 371, + "z": 21, "zOrder": 27, "numberProperties": [], "stringProperties": [], @@ -1338,13 +1340,15 @@ "angle": 0, "customSize": false, "height": 0, - "layer": "UI", - "name": "RemainingText", - "persistentUuid": "2b76bb1d-a62d-49db-ba85-d80a0aeb0572", + "layer": "", + "name": "Coin", + "persistentUuid": "d490a1e4-922e-4837-9160-56f76758c8b6", + "rotationY": 90, "width": 0, - "x": 5, - "y": 110, - "zOrder": 41, + "x": 1472, + "y": 371, + "z": 21, + "zOrder": 27, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -1354,13 +1358,14 @@ "customSize": false, "height": 0, "layer": "", - "name": "Arrow", - "persistentUuid": "bc0dd56c-75c6-4ec9-b4d9-e392704ada45", + "name": "Coin", + "persistentUuid": "36890c73-8149-4297-981e-d83555bf4dcb", + "rotationY": 90, "width": 0, - "x": 1332, - "y": -58, - "z": 10, - "zOrder": 42, + "x": 1376, + "y": 371, + "z": 21, + "zOrder": 27, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -1370,44241 +1375,3059 @@ "customSize": false, "height": 0, "layer": "", - "name": "Dust", - "persistentUuid": "5d1a7195-aff2-40cf-bbf1-b056f8bf487a", + "name": "Coin", + "persistentUuid": "d392011b-0dab-4705-93c6-1565cede70d6", + "rotationY": 90, "width": 0, - "x": 1349, - "y": -111, - "z": 15, - "zOrder": 43, + "x": -1664, + "y": 1120, + "z": 21, + "zOrder": 27, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { "angle": 0, - "customSize": true, - "depth": 1, - "height": 256, - "layer": "Background", - "name": "Sky", - "persistentUuid": "eda3eb60-593e-49f8-9c18-f5156990bbe7", - "width": 1280, - "x": 0, - "y": 0, - "zOrder": 44, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "4e80ac91-a9c6-421d-84fb-da675ade03ca", + "rotationY": 90, + "width": 0, + "x": -1661, + "y": 1309, + "z": 21, + "zOrder": 27, "numberProperties": [], "stringProperties": [], "initialVariables": [] - } - ], - "objects": [ + }, { - "assetStoreId": "", - "name": "Dust", - "type": "ParticleEmitter3D::ParticleEmitter3D", - "variant": "", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "StartColor": "255;255;255", - "EndColor": "177;177;177", - "Blending": "Normal", - "Flow": 20, - "Duration": 123456, - "StartSizeMin": 5, - "StartSizeMax": 5, - "EndScale": 4, - "StartSpeedMin": 30, - "StartSpeedMax": 50, - "GravityTop": "Z+", - "Gravity": -30, - "EndOpacity": 0, - "StartOpacity": 220, - "SpayConeAngle": 45, - "Z": 9, - "RotationX": 0, - "LifespanMin": 0.5, - "LifespanMax": 1, - "RotationY": -22.5 - }, - "childrenContent": { - "Particle": { - "adaptCollisionMaskAutomatically": true, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Particle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "metadata": "{\"pskl\":{}}", - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": true, - "image": "assets\\Particle.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [ - [ - { - "x": 0, - "y": 0 - }, - { - "x": 32, - "y": 0 - }, - { - "x": 32, - "y": 32 - }, - { - "x": 0, - "y": 32 - } - ] - ] - } - ] - } - ] - } - ] - } - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "3f567b7d-564a-4d42-95b9-421816917e0f", + "rotationY": 90, + "width": 0, + "x": -864, + "y": 3708, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "BestTimeText", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [], - "string": "Best: 0", - "font": "Chango-Regular.ttf", - "textAlignment": "left", - "characterSize": 25, - "color": { - "b": 255, - "g": 255, - "r": 255 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Best: 0", - "font": "Chango-Regular.ttf", - "textAlignment": "left", - "verticalTextAlignment": "top", - "characterSize": 25, - "lineHeight": 0, - "color": "255;255;255" - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "84e79653-7e26-4fef-875f-5e858a03fbf9", + "rotationY": 90, + "width": 0, + "x": -1056, + "y": 3708, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "RemainingText", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [], - "string": "Remaining: 0", - "font": "Chango-Regular.ttf", - "textAlignment": "left", - "characterSize": 25, - "color": { - "b": 255, - "g": 255, - "r": 255 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Remaining: 0", - "font": "Chango-Regular.ttf", - "textAlignment": "left", - "verticalTextAlignment": "top", - "characterSize": 25, - "lineHeight": 0, - "color": "255;255;255" - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "eeda5d0e-06b7-4c85-bf36-c3092ccc8d9f", + "rotationY": 90, + "width": 0, + "x": 544, + "y": 260, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "TimeText", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [], - "string": "Time:", - "font": "Chango-Regular.ttf", - "textAlignment": "left", - "characterSize": 40, - "color": { - "b": 255, - "g": 255, - "r": 255 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Time:", - "font": "Chango-Regular.ttf", - "textAlignment": "left", - "verticalTextAlignment": "top", - "characterSize": 40, - "lineHeight": 0, - "color": "255;255;255" - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "274b66e4-c95e-4374-add9-c1db8090bf6d", + "rotationY": 90, + "width": 0, + "x": 448, + "y": 260, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "TutorialText", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [], - "string": "Arrow keys to drive. Collect all coins.", - "font": "Chango-Regular.ttf", - "textAlignment": "left", - "characterSize": 20, - "color": { - "b": 255, - "g": 255, - "r": 255 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Arrow keys to drive. Collect all coins.", - "font": "Chango-Regular.ttf", - "textAlignment": "left", - "verticalTextAlignment": "top", - "characterSize": 20, - "lineHeight": 0, - "color": "255;255;255" - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "eb1a46fb-2f6b-4f05-8932-eb9d7072b3ca", + "rotationY": 90, + "width": 0, + "x": 640, + "y": 260, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "112c69f62e03fa6df7716cc6b8f174c17857fbf71c8d3fffd16fa8fdbfa49bf1", - "name": "SteerJoystick", - "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "variant": "", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "DeadZoneRadius": 0.33 - }, - "childrenContent": { - "Border": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets\\Line light joystick border LeftRightt.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - }, - "Thumb": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "Line light joystick thumb.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - } - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "b619af0b-588c-42ab-b98e-add403b1c6f7", + "rotationY": 90, + "width": 0, + "x": 736, + "y": 260, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "112c69f62e03fa6df7716cc6b8f174c17857fbf71c8d3fffd16fa8fdbfa49bf1", - "name": "SpeedJoystick", - "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "variant": "", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "DeadZoneRadius": 0.33, - "JoystickIdentifier": "Secondary" - }, - "childrenContent": { - "Border": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets\\Line light joystick border UpDown.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - }, - "Thumb": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "Line light joystick thumb.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - } - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "464e62ae-e49a-46ec-b81c-3ffff428122b", + "rotationY": 90, + "width": 0, + "x": -192, + "y": 384, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "cddab55130dbd5a0b36f763200e876fb514aa608e1b057a136ebdb5f80006e2c", - "name": "Player", - "type": "Scene3D::Model3DObject", - "variables": [ - { - "folded": true, - "name": "Force", - "type": "number", - "value": 0 - }, - { - "folded": true, - "name": "Direction", - "type": "number", - "value": 0 - } - ], - "effects": [], - "behaviors": [ - { - "name": "AirControl3D", - "type": "AirControl3D::AirControl3D", - "Physics3D": "Physics3D", - "RotationSpeedMax": 180, - "RotationAcceleration": 720, - "RotationDeceleration": 720, - "TranslationSpeedMax": 400, - "TranslationAcceleration": 1600, - "TranslationDeceleration": 1600, - "CurrentRotationSpeed": 0, - "PreviousRotationSpeed": 0, - "CurrentForwardSpeed": 0, - "CurrentSidewaysSpeed": 0, - "PreviousForwardSpeed": 0, - "PreviousSidewaysSpeed": 0, - "HasPressedTurnLeft": false, - "HasPressedTurnRight": false, - "HasPressedTurnLeftLast": false, - "HadPressedTurnLeft": false, - "HadPressedTurnRight": false, - "HasPressedMoveForward": false, - "HasPressedMoveBackward": false, - "HadPressedMoveForward": false, - "HadPressedMoveBackward": false, - "HasPressedMoveBackwardLast": false, - "HasPressedMoveLeft": false, - "HasPressedMoveRight": false, - "HadPressedMoveLeft": false, - "HadPressedMoveRight": false, - "HasPressedMoveLeftLast": false, - "TargetedForwardSpeed": 0, - "TargetedSidewaysSpeed": 0, - "TargetedRotationSpeed": 0 - }, - { - "name": "MultiplayerObject", - "type": "Multiplayer::MultiplayerObjectBehavior", - "playerNumber": 0, - "actionOnPlayerDisconnect": "DestroyObject" - }, - { - "name": "Physics3D", - "type": "Physics3D::Physics3DBehavior", - "object3D": "Object3D", - "bodyType": "Dynamic", - "bullet": false, - "fixedRotation": false, - "shape": "Box", - "shapeOrientation": "Z", - "shapeDimensionA": 74, - "shapeDimensionB": 39, - "shapeDimensionC": 27, - "density": 1, - "friction": 10, - "restitution": 0.5, - "linearDamping": 0.1, - "angularDamping": 0.1, - "gravityScale": 6, - "layers": 17, - "masks": 17, - "shapeOffsetX": 0, - "shapeOffsetY": 0, - "shapeOffsetZ": 9, - "massCenterOffsetX": 0, - "massCenterOffsetY": 0, - "massCenterOffsetZ": -25, - "massOverride": 1500 - }, - { - "name": "PhysicsCar3D", - "type": "Physics3D::PhysicsCar3D", - "physics3D": "Physics3D", - "steerAngleMax": 70, - "beginningSteerSpeed": 140, - "endSteerSpeed": 10, - "mass": 1500, - "engineTorqueMax": 8000, - "engineSpeedMax": 6000, - "engineInertia": 0.1, - "reverseGearRatio1": -2.9, - "gearRatio1": 2.66, - "gearRatio2": 1.78, - "gearRatio3": 1.3, - "gearRatio4": 1, - "gearRatio5": 0.74, - "gearRatio6": 0, - "backWheelOffsetX": -6, - "frontWheelOffsetX": -5, - "wheelOffsetY": 0, - "wheelOffsetZ": 0, - "wheelRadius": 6, - "wheelWidth": 3, - "brakeTorqueMax": 3000, - "handBrakeTorqueMax": 6000, - "hasBackWheelDrive": false, - "hasFrontWheelDrive": true, - "pitchRollAngleMax": 89 - }, - { - "name": "PhysicsCar3DGamepadMapper", - "type": "Gamepads::PhysicsCar3DGamepadMapper", - "PhysicsCar3D": "PhysicsCar3D", - "GamepadIdentifier": 1, - "UseArrows": true, - "UseLeftStick": true, - "UseRightStick": false, - "HandBrakeButton": "B or Circle" - }, - { - "name": "PhysicsCar3DKeyboardMapper", - "type": "PhysicsCar3DKeyMapper::PhysicsCar3DKeyboardMapper", - "PhysicsCar3D": "PhysicsCar3D", - "HandBrake": "Space", - "Up": "Up", - "Left": "Left", - "Down": "Down", - "Right": "Right" - }, - { - "name": "PhysicsCar3DMultitouchMapper", - "type": "SpriteMultitouchJoystick::PhysicsCar3DMultitouchMapper", - "PhysicsCar3D": "PhysicsCar3D", - "ControllerIdentifier": 1, - "SteerJoystickIdentifier": "Primary", - "SpeedJoystickIdentifier": "Secondary", - "HandBrakeButton": "B" - }, - { - "name": "ThirdPersonCamera", - "type": "ThirdPersonCamera::ThirdPersonCamera", - "Object3D": "Object3D", - "RotationHalfwayDuration": 0.125, - "TranslationZHalfwayDuration": 0.125, - "Distance": 450, - "LateralOffset": 0, - "AheadOffset": 200, - "OffsetZ": 0, - "RotationAngleOffset": 0, - "ElevationAngleOffset": 10, - "FollowFreeAreaZMax": 0, - "FollowFreeAreaZMin": 0, - "RotationLogSpeed": 2.0247e-320, - "TranslationZLogSpeed": 2.0247e-320, - "IsCalledManually": false, - "CameraZ": 0, - "LocalOffsetY": 200, - "LocalOffsetX": 0, - "OffsetY": 200, - "ElevationHalfwayDuration": 1, - "IsElevatingWithObject": false - } - ], - "content": { - "centerLocation": "ObjectCenter", - "crossfadeDuration": 0, - "depth": 74, - "height": 74, - "isCastingShadow": true, - "isReceivingShadow": true, - "keepAspectRatio": true, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "Sedan Sports.glb", - "originLocation": "ModelOrigin", - "rotationX": 90, - "rotationY": 0, - "rotationZ": -90, - "width": 74, - "animations": [] - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "ffe78002-8cb0-45e8-953f-65648fe0bb6b", + "rotationY": 90, + "width": 0, + "x": -288, + "y": 384, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "541d82997e1d0e79b20a617cfcc249d1169d838db8512612894f18d64ea7374f", - "name": "LargeBuildingF", - "type": "Scene3D::Model3DObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Physics3D", - "type": "Physics3D::Physics3DBehavior", - "object3D": "Object3D", - "bodyType": "Static", - "bullet": false, - "fixedRotation": false, - "shape": "Box", - "shapeOrientation": "Z", - "shapeDimensionA": 0, - "shapeDimensionB": 0, - "shapeDimensionC": 0, - "density": 5, - "friction": 0.01, - "restitution": 0.01, - "linearDamping": 0.1, - "angularDamping": 0.1, - "gravityScale": 1, - "layers": 17, - "masks": 17, - "shapeOffsetX": 0, - "shapeOffsetY": 0, - "shapeOffsetZ": 0, - "massCenterOffsetX": 0, - "massCenterOffsetY": 0, - "massCenterOffsetZ": 0, - "massOverride": 0 - } - ], - "content": { - "centerLocation": "ObjectCenter", - "crossfadeDuration": 0, - "depth": 282, - "height": 128, - "isCastingShadow": true, - "isReceivingShadow": true, - "keepAspectRatio": false, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "Large Building F2.glb", - "originLocation": "ModelOrigin", - "rotationX": 90, - "rotationY": 0, - "rotationZ": 0, - "width": 384, - "animations": [] - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "d5856c94-5ca4-4e9c-ad8a-27f64107011a", + "rotationY": 90, + "width": 0, + "x": -384, + "y": 384, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "479c508ead309e45d684605c3539fd2b3a3a3a1ea8a277f102e8366873aad249", - "name": "LargeBuildingA", - "type": "Scene3D::Model3DObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Physics3D", - "type": "Physics3D::Physics3DBehavior", - "object3D": "Object3D", - "bodyType": "Static", - "bullet": false, - "fixedRotation": false, - "shape": "Box", - "shapeOrientation": "Z", - "shapeDimensionA": 0, - "shapeDimensionB": 0, - "shapeDimensionC": 0, - "density": 5, - "friction": 0.01, - "restitution": 0.01, - "linearDamping": 0.1, - "angularDamping": 0.1, - "gravityScale": 1, - "layers": 17, - "masks": 17, - "shapeOffsetX": 0, - "shapeOffsetY": 0, - "shapeOffsetZ": 0, - "massCenterOffsetX": 0, - "massCenterOffsetY": 0, - "massCenterOffsetZ": 0, - "massOverride": 0 - } - ], - "content": { - "centerLocation": "ObjectCenter", - "crossfadeDuration": 0, - "depth": 316, - "height": 256, - "isCastingShadow": true, - "isReceivingShadow": true, - "keepAspectRatio": false, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "Large Building A.glb", - "originLocation": "ModelOrigin", - "rotationX": 90, - "rotationY": 0, - "rotationZ": 0, - "width": 384, - "animations": [] - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "c6cffc5d-5845-469a-a163-11f925f31309", + "rotationY": 90, + "width": 0, + "x": -480, + "y": 384, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "fcb1a484380a00837bfc40406681f434dd57cce8bdf94694b237fc809bf7b4fb", - "name": "SuvLuxury", - "type": "Scene3D::Model3DObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Physics3D", - "type": "Physics3D::Physics3DBehavior", - "object3D": "Object3D", - "bodyType": "Dynamic", - "bullet": false, - "fixedRotation": false, - "shape": "Box", - "shapeOrientation": "Z", - "shapeDimensionA": 0, - "shapeDimensionB": 0, - "shapeDimensionC": 0, - "density": 5, - "friction": 0.5, - "restitution": 0.2, - "linearDamping": 7, - "angularDamping": 4, - "gravityScale": 1, - "layers": 17, - "masks": 17, - "shapeOffsetX": 0, - "shapeOffsetY": 0, - "shapeOffsetZ": 0, - "massCenterOffsetX": 0, - "massCenterOffsetY": 0, - "massCenterOffsetZ": 0, - "massOverride": 0 - } - ], - "content": { - "centerLocation": "ObjectCenter", - "crossfadeDuration": 0, - "depth": 84, - "height": 84, - "isCastingShadow": true, - "isReceivingShadow": true, - "keepAspectRatio": true, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "Suv Luxury5.glb", - "originLocation": "ModelOrigin", - "rotationX": 90, - "rotationY": 0, - "rotationZ": -90, - "width": 84, - "animations": [] - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "37983f2a-555b-4705-a7de-88a8f5145ed4", + "rotationY": 90, + "width": 0, + "x": -1664, + "y": 1216, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "0d7e7a700fe654df077830ff50844449cdaddbb46dbe23de65f970569e6a983b", - "name": "Van", - "type": "Scene3D::Model3DObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Physics3D", - "type": "Physics3D::Physics3DBehavior", - "object3D": "Object3D", - "bodyType": "Dynamic", - "bullet": false, - "fixedRotation": false, - "shape": "Box", - "shapeOrientation": "Z", - "shapeDimensionA": 0, - "shapeDimensionB": 0, - "shapeDimensionC": 0, - "density": 5, - "friction": 0.3, - "restitution": 0.2, - "linearDamping": 7, - "angularDamping": 4, - "gravityScale": 1, - "layers": 17, - "masks": 17, - "shapeOffsetX": 0, - "shapeOffsetY": 0, - "shapeOffsetZ": 0, - "massCenterOffsetX": 0, - "massCenterOffsetY": 0, - "massCenterOffsetZ": 0, - "massOverride": 0 - } - ], - "content": { - "centerLocation": "ObjectCenter", - "crossfadeDuration": 0, - "depth": 79, - "height": 79, - "isCastingShadow": true, - "isReceivingShadow": true, - "keepAspectRatio": true, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "Van2.glb", - "originLocation": "ModelOrigin", - "rotationX": 90, - "rotationY": 0, - "rotationZ": -90, - "width": 79, - "animations": [] - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "cc3ff3ba-91eb-4e5d-b982-61d5bbedae1e", + "rotationY": 90, + "width": 0, + "x": -960, + "y": 3708, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "", - "name": "Arrow", - "type": "Scene3D::Cube3DObject", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "width": 32, - "height": 32, - "depth": 1, - "enableTextureTransparency": true, - "facesOrientation": "Y", - "frontFaceResourceName": "Arrow.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" - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "84e5efdd-e8b2-4eec-a5c8-53026c16cd7c", + "rotationY": 90, + "width": 0, + "x": 2240, + "y": 2046, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "bbdd1d6c7d452e1847310eb327cddabe057cb893886f3a7a1af1c38e353eac92", - "name": "RoadStraight", - "type": "Scene3D::Model3DObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Physics3D", - "type": "Physics3D::Physics3DBehavior", - "object3D": "Object3D", - "bodyType": "Static", - "bullet": false, - "fixedRotation": false, - "shape": "Box", - "shapeOrientation": "Z", - "shapeDimensionA": 0, - "shapeDimensionB": 0, - "shapeDimensionC": 0, - "density": 1, - "friction": 7, - "restitution": 0.1, - "linearDamping": 0.1, - "angularDamping": 0.1, - "gravityScale": 1, - "layers": 17, - "masks": 17, - "shapeOffsetX": 0, - "shapeOffsetY": 0, - "shapeOffsetZ": -4, - "massCenterOffsetX": 0, - "massCenterOffsetY": 0, - "massCenterOffsetZ": 0, - "massOverride": 0 - } - ], - "content": { - "centerLocation": "ObjectCenter", - "crossfadeDuration": 0, - "depth": 8, - "height": 384, - "isCastingShadow": true, - "isReceivingShadow": true, - "keepAspectRatio": false, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "Road Straight.glb", - "originLocation": "TopLeft", - "rotationX": 90, - "rotationY": 0, - "rotationZ": 0, - "width": 384, - "animations": [] - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "2c168740-81d7-4fc4-9470-16f9c927628d", + "rotationY": 90, + "width": 0, + "x": 2048, + "y": 2046, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "ae09642f549122b398405ffda9bd787c20f0fdfcb555a4535c710a3f218c8130", - "name": "RoadCrossroadPath", - "type": "Scene3D::Model3DObject", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "centerLocation": "ObjectCenter", - "crossfadeDuration": 0, - "depth": 8, - "height": 384, - "isCastingShadow": true, - "isReceivingShadow": true, - "keepAspectRatio": false, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "Road Crossroad Path.glb", - "originLocation": "TopLeft", - "rotationX": 90, - "rotationY": 0, - "rotationZ": 0, - "width": 384, - "animations": [] - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "f7fc9e25-e24e-4df9-8093-e808223b4b99", + "rotationY": 90, + "width": 0, + "x": 2144, + "y": 2046, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "fad6af3a34db69705540270898681716e47359bbb1b474b27104f823098ef0aa", - "name": "RoadIntersectionPath", - "type": "Scene3D::Model3DObject", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "centerLocation": "ObjectCenter", - "crossfadeDuration": 0, - "depth": 8, - "height": 384, - "isCastingShadow": true, - "isReceivingShadow": true, - "keepAspectRatio": false, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "Road Intersection Path.glb", - "originLocation": "TopLeft", - "rotationX": 90, - "rotationY": 0, - "rotationZ": 0, - "width": 384, - "animations": [] - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "902cf497-b394-425a-a9db-5eddefc4e98c", + "rotationY": 90, + "width": 0, + "x": 2464, + "y": 1120, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "79a334f5403b6c2daa0625e37c715ede02c9283c06721ee917767f36efff8570", - "name": "RoadBend", - "type": "Scene3D::Model3DObject", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "centerLocation": "ObjectCenter", - "crossfadeDuration": 0, - "depth": 8, - "height": 384, - "isCastingShadow": true, - "isReceivingShadow": true, - "keepAspectRatio": false, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "Road Bend.glb", - "originLocation": "TopLeft", - "rotationX": 90, - "rotationY": 0, - "rotationZ": 0, - "width": 384, - "animations": [] - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "527f0396-148d-4b9a-891b-3b030ed4c7c9", + "rotationY": 90, + "width": 0, + "x": 2464, + "y": 1323, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "16fac9714ba0a9eb3c83984910c70b11affca1b4e6a8bed49c22af1d30f957da", - "name": "CommonTree", - "type": "Scene3D::Model3DObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Physics3D", - "type": "Physics3D::Physics3DBehavior", - "object3D": "Object3D", - "bodyType": "Static", - "bullet": false, - "fixedRotation": false, - "shape": "Cylinder", - "shapeOrientation": "Z", - "shapeDimensionA": 15, - "shapeDimensionB": 100, - "shapeDimensionC": 0, - "shapeOffsetX": 0, - "shapeOffsetY": 0, - "shapeOffsetZ": 50, - "massCenterOffsetX": 0, - "massCenterOffsetY": 0, - "massCenterOffsetZ": 0, - "density": 1, - "friction": 0.01, - "restitution": 0.01, - "linearDamping": 0.1, - "angularDamping": 0.1, - "gravityScale": 1, - "layers": 17, - "masks": 17, - "massOverride": 0 - } - ], - "content": { - "centerLocation": "ModelOrigin", - "crossfadeDuration": 0, - "depth": 250, - "height": 250, - "isCastingShadow": true, - "isReceivingShadow": true, - "keepAspectRatio": true, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "Common Tree 1.glb", - "originLocation": "ModelOrigin", - "rotationX": 90, - "rotationY": 0, - "rotationZ": 0, - "width": 250, - "animations": [] - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "c43c4f54-000b-49ee-b8e7-fd9f39a65ad6", + "rotationY": 90, + "width": 0, + "x": 2464, + "y": 1216, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "", - "name": "Grass", - "type": "Scene3D::Cube3DObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Physics3D", - "type": "Physics3D::Physics3DBehavior", - "object3D": "Object3D", - "bodyType": "Static", - "bullet": false, - "fixedRotation": false, - "shape": "Box", - "shapeOrientation": "Z", - "shapeDimensionA": 0, - "shapeDimensionB": 0, - "shapeDimensionC": 0, - "density": 1, - "friction": 7, - "restitution": 0.1, - "linearDamping": 0.1, - "angularDamping": 0.1, - "gravityScale": 1, - "layers": 17, - "masks": 17, - "shapeOffsetX": 0, - "shapeOffsetY": 0, - "shapeOffsetZ": 4, - "massCenterOffsetX": 0, - "massCenterOffsetY": 0, - "massCenterOffsetZ": 0, - "massOverride": 0 - } - ], - "content": { - "width": 100, - "height": 100, - "depth": 100, - "enableTextureTransparency": false, - "facesOrientation": "Y", - "frontFaceResourceName": "assets\\Grass.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": "StandardWithoutMetalness", - "isReceivingShadow": true, - "isCastingShadow": true - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "01564816-db2d-4222-9271-691a782814ab", + "rotationY": 90, + "width": 0, + "x": -1664, + "y": -704, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "", - "name": "CoinPickUp", - "type": "ParticleEmitter3D::ParticleEmitter3D", - "variant": "", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "StartColor": "255;230;145", - "EndOpacity": 255, - "StartOpacity": 128, - "EndScale": 0, - "SpayConeAngle": 180, - "RotationY": 90, - "StartSpeedMin": 400, - "StartSpeedMax": 600, - "LifespanMax": 0.5, - "LifespanMin": 0.25, - "Duration": 0.0625, - "Flow": 200, - "StartSizeMin": 15, - "EndColor": "255;230;142", - "Blending": "Normal", - "StartSizeMax": 30 - }, - "childrenContent": { - "Particle": { - "adaptCollisionMaskAutomatically": true, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Image", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": true, - "image": "assets\\Particle.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [ - [ - { - "x": 0, - "y": 0 - }, - { - "x": 32, - "y": 0 - }, - { - "x": 32, - "y": 32 - }, - { - "x": 0, - "y": 32 - } - ] - ] - } - ] - } - ] - } - ] - } - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "4112fc62-34be-4269-b843-94d7ef614ad2", + "rotationY": 90, + "width": 0, + "x": -1664, + "y": -512, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "e5919fb86a559b00001678c710efe55f4e9f2e032a9ff9610087370f998d57de", - "name": "ScreenOrientationChecker", - "type": "ScreenOrientationChecker::ScreenOrientationChecker", - "variant": "Black screen orientation checker", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "IsForceShown": false, - "BackgroundColor": "24;24;24", - "CornerRadius": 8, - "Padding": 5 - } + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "ae78128d-84ce-4d60-8baa-f0b7edac934c", + "rotationY": 90, + "width": 0, + "x": -1664, + "y": -608, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "assetStoreId": "0e3ee52ba8369c68fe75e3b34a056876ba39b1d0dbb9de6e83e1f2ea0e6f94ac", + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", "name": "Coin", - "type": "Scene3D::Model3DObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Collectible", - "type": "Collectible::Collectible", - "RotationSpeed": 50 - }, - { - "name": "InOnScreen", - "type": "IsOnScreen::InOnScreen" - } - ], - "content": { - "centerLocation": "ModelOrigin", - "crossfadeDuration": 0, - "depth": 31, - "height": 31, - "isCastingShadow": true, - "isReceivingShadow": true, - "keepAspectRatio": true, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "Coin.glb", - "originLocation": "ModelOrigin", - "rotationX": 0, - "rotationY": 0, - "rotationZ": 0, - "width": 31, - "animations": [] - } + "persistentUuid": "1a6de6d8-8f3a-465c-8872-69f145ddef23", + "rotationY": 90, + "width": 0, + "x": -864, + "y": -928, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "adaptCollisionMaskAutomatically": true, - "assetStoreId": "", - "name": "Sky", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "animations": [ - { - "name": "", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": true, - "image": "assets\\FoggySky.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [ - [ - { - "x": 0, - "y": 0 - }, - { - "x": 256, - "y": 0 - }, - { - "x": 256, - "y": 256 - }, - { - "x": 0, - "y": 256 - } - ] - ] - } - ] - } - ] - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "folderName": "Background", - "quickCustomizationVisibility": "hidden", - "children": [ - { - "objectName": "Sky" - } - ] - }, - { - "folderName": "Obstacles", - "quickCustomizationVisibility": "visible", - "children": [ - { - "objectName": "CommonTree" - }, - { - "objectName": "Van" - }, - { - "objectName": "SuvLuxury" - }, - { - "objectName": "LargeBuildingA" - }, - { - "objectName": "LargeBuildingF" - } - ] - }, - { - "folderName": "UI", - "quickCustomizationVisibility": "hidden", - "children": [ - { - "objectName": "Arrow" - }, - { - "objectName": "SteerJoystick" - }, - { - "objectName": "SpeedJoystick" - }, - { - "objectName": "ScreenOrientationChecker" - }, - { - "objectName": "TutorialText" - }, - { - "objectName": "TimeText" - }, - { - "objectName": "RemainingText" - }, - { - "objectName": "BestTimeText" - } - ] - }, - { - "folderName": "VFX", - "quickCustomizationVisibility": "hidden", - "children": [ - { - "objectName": "Dust" - }, - { - "objectName": "CoinPickUp" - } - ] - }, - { - "folderName": "Floor", - "quickCustomizationVisibility": "hidden", - "children": [ - { - "objectName": "RoadStraight" - }, - { - "objectName": "RoadCrossroadPath" - }, - { - "objectName": "RoadIntersectionPath" - }, - { - "objectName": "RoadBend" - }, - { - "objectName": "Grass" - } - ] - }, - { - "objectName": "Player" - }, - { - "objectName": "Coin" - } - ] - }, - "events": [ + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "a38b1d1e-0a5b-405c-ad85-4a4610c1b2c6", + "rotationY": 90, + "width": 0, + "x": -1056, + "y": -928, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Game Set Up and controls for mobile." + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "a1fea144-0d41-47fe-9522-0191b2a188a8", + "rotationY": 90, + "width": 0, + "x": -960, + "y": -928, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "DepartScene" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "BuiltinExternalLayouts::CreateObjectsFromExternalLayout" - }, - "parameters": [ - "", - "\"Level1\"", - "0", - "0", - "" - ] - } - ] + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "81751047-2c44-4915-aa4c-a8beb7ffb039", + "rotationY": 90, + "width": 0, + "x": 736, + "y": -1036, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "DepartScene" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "CentreCamera" - }, - "parameters": [ - "", - "Player", - "", - "\"\"", - "" - ] - }, - { - "type": { - "value": "ReadNumberFromStorage" - }, - "parameters": [ - "\"HighScore\"", - "\"HighScore\"", - "", - "HighScore" - ] - }, - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "BestTimeText", - "Text", - "=", - "\"Best: \" + TimeFormatter::SecondsToHHMMSS000(Variable(HighScore))" - ] - }, - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "RemainingText", - "Text", - "=", - "\"Remaining: \" + ToString(SceneInstancesCount(Coin) - 20)" - ] - }, - { - "type": { - "value": "PlaySoundCanal" - }, - "parameters": [ - "", - "assets\\CarEngine.mp3", - "0", - "yes", - "30", - "1" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SystemInfo::HasTouchScreen" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Delete" - }, - "parameters": [ - "TutorialText", - "" - ] - } - ] - } - ] + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "f2f482fe-5abe-4bed-a2a3-3d24fe635a26", + "rotationY": 90, + "width": 0, + "x": 640, + "y": -1036, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "DepartScene" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Multiplayer::MultiplayerObjectBehavior::TakeObjectOwnership" - }, - "parameters": [ - "Player", - "MultiplayerObject" - ] - } - ] + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "8c7022de-259d-408e-a83b-e2dba8f1ac18", + "rotationY": 90, + "width": 0, + "x": 544, + "y": -1036, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "Multiplayer::MultiplayerObjectBehavior::IsObjectOwnedByCurrentPlayer" - }, - "parameters": [ - "Player", - "MultiplayerObject" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Player", - "ThirdPersonCamera", - "" - ] - }, - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Player", - "PhysicsCar3DKeyboardMapper", - "" - ] - }, - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Player", - "PhysicsCar3DGamepadMapper", - "" - ] - }, - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Player", - "PhysicsCar3DMultitouchMapper", - "" - ] - } - ] + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "d52ddf39-738d-4e60-bf80-4b43f89099e2", + "rotationY": 90, + "width": 0, + "x": 448, + "y": -1036, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Multiplayer::MultiplayerObjectBehavior::IsObjectOwnedByCurrentPlayer" - }, - "parameters": [ - "Player", - "MultiplayerObject" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Player", - "ThirdPersonCamera", - "yes" - ] - }, - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Player", - "PhysicsCar3DKeyboardMapper", - "yes" - ] - }, - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Player", - "PhysicsCar3DGamepadMapper", - "yes" - ] - }, - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Player", - "PhysicsCar3DMultitouchMapper", - "yes" - ] - } - ], - "events": [ - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "When the game is playing", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "GameState", - "=", - "\"Playing\"" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Start timer only when the SedanPlayer starts moving." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Physics3D::Physics3DBehavior::LinearVelocityLength" - }, - "parameters": [ - "Player", - "Physics3D", - ">", - "0" - ] - }, - { - "type": { - "inverted": true, - "value": "CompareTimer" - }, - "parameters": [ - "", - "\"Time\"", - ">", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ResetTimer" - }, - "parameters": [ - "", - "\"Time\"" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Display the timer." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "TimeText", - "Text", - "=", - "\"Time: \" + TimeFormatter::SecondsToHHMMSS000(TimerElapsedTime(\"Time\"))" - ] - } - ] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Floating joysticks", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SystemInfo::HasTouchScreen" - }, - "parameters": [ - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "DepartScene" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "BuiltinExternalLayouts::CreateObjectsFromExternalLayout" - }, - "parameters": [ - "", - "\"Touch controls\"", - "0", - "0", - "0" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Cache" - }, - "parameters": [ - "SteerJoystick" - ] - }, - { - "type": { - "value": "Cache" - }, - "parameters": [ - "SpeedJoystick" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" - }, - "parameters": [ - "SteerJoystick", - "", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" - }, - "parameters": [ - "SpeedJoystick", - "", - "" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" - }, - "parameters": [ - "", - "SteerJoystick", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" - }, - "parameters": [ - "SteerJoystick", - "CursorX(\"UI\")", - "CursorY(\"UI\")", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" - }, - "parameters": [ - "", - "SpeedJoystick", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" - }, - "parameters": [ - "SpeedJoystick", - "CursorX(\"UI\")", - "CursorY(\"UI\")", - "" - ] - } - ] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Air control", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Physics3D::PhysicsCar3D::IsOnFloor" - }, - "parameters": [ - "Player", - "PhysicsCar3D" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Player", - "AirControl3D", - "no" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "Physics3D::PhysicsCar3D::IsOnFloor" - }, - "parameters": [ - "Player", - "PhysicsCar3D" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Player", - "AirControl3D", - "yes" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "KeyFromTextPressed" - }, - "parameters": [ - "", - "\"Down\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "1", - "\"LT\"", - "\"Up\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "SpeedJoystick", - "\"Down\"", - "" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "AirControl3D::AirControl3D::SimulateMoveBackwardKey" - }, - "parameters": [ - "Player", - "AirControl3D", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "KeyFromTextPressed" - }, - "parameters": [ - "", - "\"Up\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "1", - "\"RT\"", - "\"Up\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "SpeedJoystick", - "\"Up\"", - "" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "AirControl3D::AirControl3D::SimulateMoveForwardKey" - }, - "parameters": [ - "Player", - "AirControl3D", - "" - ] - } - ] - } - ], - "parameters": [] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Particles and car rev volume", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "Dust", - "=", - "Player.Angle() + 180" - ] - }, - { - "type": { - "value": "MettreAutour" - }, - "parameters": [ - "Dust", - "Player", - "10", - "Player.Angle() - 180" - ] - }, - { - "type": { - "value": "MettreXY" - }, - "parameters": [ - "Dust", - "=", - "Dust.X() + RandomFloatInRange(-6, 6)", - "=", - "Dust.Y() + RandomFloatInRange(-6, 6)" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetZ" - }, - "parameters": [ - "Dust", - "Object3D", - "=", - "Player.Object3D::Z() + 10" - ] - }, - { - "type": { - "value": "ModPitchSoundChannel" - }, - "parameters": [ - "", - "0", - "=", - "min((Player.Physics3D::LinearVelocityLength() / 300), 1)" - ] - }, - { - "type": { - "value": "ModVolumeSoundCanal" - }, - "parameters": [ - "", - "0", - "=", - "min(Player.Physics3D::LinearVelocityLength() * 10, 25)" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetFlow" - }, - "parameters": [ - "Dust", - "=", - "20 + 0.01 * Player.Physics3D::LinearVelocityLength()", - "-90" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSpeedMin" - }, - "parameters": [ - "Dust", - "=", - "30 + 0.1 * Player.Physics3D::LinearVelocityLength()", - "-90" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSpeedMax" - }, - "parameters": [ - "Dust", - "=", - "50 + 0.3 * Player.Physics3D::LinearVelocityLength()", - "-90" - ] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Coins", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Coins indicator" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PickNearest" - }, - "parameters": [ - "Coin", - "Player.CenterX()", - "Player.CenterY()", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "RotateTowardAngle" - }, - "parameters": [ - "Arrow", - "AngleBetweenPositions(Player.CenterX(), Player.CenterY(), Coin.CenterX(), Coin.CenterY())", - "30", - "" - ] - }, - { - "type": { - "value": "MettreAutour" - }, - "parameters": [ - "Arrow", - "Player", - "60", - "Arrow.Angle()" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "IsOnScreen::InOnScreen::IsOnScreen" - }, - "parameters": [ - "Coin", - "InOnScreen", - "0", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Arrow" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "IsOnScreen::InOnScreen::IsOnScreen" - }, - "parameters": [ - "Coin", - "InOnScreen", - "10", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Montre" - }, - "parameters": [ - "Arrow", - "" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Collision3D::AreWithinDistance" - }, - "parameters": [ - "", - "Coin", - "Player", - "45", - "", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "CoinPickUp", - "Coin.CenterX()", - "Coin.CenterY()", - "" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetCenterZ" - }, - "parameters": [ - "CoinPickUp", - "Object3D", - "=", - "Coin.Object3D::CenterZ()" - ] - }, - { - "type": { - "value": "Delete" - }, - "parameters": [ - "Coin", - "" - ] - }, - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "RemainingText", - "Text", - "=", - "\"Remaining: \" + ToString(SceneInstancesCount(Coin) - 20)" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Collect all coins" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SceneInstancesCount" - }, - "parameters": [ - "", - "Coin", - "<=", - "20" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "GameState", - "=", - "\"GameOver\"" - ] - }, - { - "type": { - "value": "ChangeTimeScale" - }, - "parameters": [ - "", - "0.5" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Score", - "=", - "TimerElapsedTime(\"Time\")" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Wait" - }, - "parameters": [ - "1.5" - ] - }, - { - "type": { - "value": "Scene" - }, - "parameters": [ - "", - "\"Leaderboard\"", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "CompareTimer" - }, - "parameters": [ - "", - "\"Time\"", - "<", - "HighScore" - ] - }, - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "HighScore", - "=", - "0" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "HighScore", - "=", - "Score" - ] - }, - { - "type": { - "value": "EcrireFichierExp" - }, - "parameters": [ - "\"HighScore\"", - "\"HighScore\"", - "HighScore" - ] - }, - { - "type": { - "value": "TextObject::ChangeColor" - }, - "parameters": [ - "BestTimeText", - "\"248;231;28\"" - ] - } - ] - } - ] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Collision sound effects", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Physics3D::Collision" - }, - "parameters": [ - "Player", - "Physics3D", - "Obstacle", - "Physics3D", - "" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "PlaySound" - }, - "parameters": [ - "", - "Collision", - "", - "50", - "RandomFloatInRange(0.8,1)" - ] - } - ] - } - ], - "parameters": [] - } - ] - } - ], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "Background", - "renderingType": "", - "visibility": true, - "cameras": [], - "effects": [ - { - "effectType": "Scene3D::HemisphereLight", - "name": "3D Light", - "doubleParameters": { - "elevation": 45, - "intensity": 1, - "rotation": 0 - }, - "stringParameters": { - "groundColor": "64;64;64", - "skyColor": "255;255;255", - "top": "Y-" - }, - "booleanParameters": {} - } - ] - }, - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 5000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 0.1, - "cameraType": "perspective", - "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::DirectionalLight", - "name": "DirectionalLight", - "doubleParameters": { - "distanceFromCamera": 1500, - "elevation": 40, - "frustumSize": 4000, - "intensity": 0.75, - "minimumShadowBias": 0, - "rotation": 300 - }, - "stringParameters": { - "color": "255;255;255", - "shadowQuality": "medium", - "top": "Z+" - }, - "booleanParameters": { - "isCastingShadow": true - } - }, - { - "effectType": "Scene3D::ExponentialFog", - "name": "Fog", - "doubleParameters": { - "density": 0.0006 - }, - "stringParameters": { - "color": "239;254;255" - }, - "booleanParameters": {} - }, - { - "effectType": "Scene3D::HemisphereLight", - "name": "HemisphereLight", - "doubleParameters": { - "elevation": 80, - "intensity": 0.33, - "rotation": 120 - }, - "stringParameters": { - "groundColor": "128;128;128", - "skyColor": "255;255;255", - "top": "Z+" - }, - "booleanParameters": {} - }, - { - "effectType": "Scene3D::Skybox", - "name": "Skybox", - "doubleParameters": {}, - "stringParameters": { - "backFaceResourceName": "assets\\Cubemap_Sky_02-512x512_Back.png", - "bottomFaceResourceName": "assets\\Cubemap_Sky_02-512x512_Bottom.png", - "frontFaceResourceName": "assets\\Cubemap_Sky_02-512x512_Front.png", - "leftFaceResourceName": "assets\\Cubemap_Sky_02-512x512_Left.png", - "rightFaceResourceName": "assets\\Cubemap_Sky_02-512x512_Right.png", - "topFaceResourceName": "assets\\Cubemap_Sky_02-512x512_Top.png" - }, - "booleanParameters": {} - } - ] - }, - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 0.1, - "cameraType": "perspective", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "UI", - "renderingType": "", - "visibility": true, - "cameras": [], - "effects": [ - { - "effectType": "Outline", - "name": "Effect", - "doubleParameters": { - "padding": 3, - "thickness": 3 - }, - "stringParameters": { - "color": "0;0;0" - }, - "booleanParameters": {} - } - ] - }, - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 0.1, - "cameraType": "perspective", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "MobileControls", - "renderingType": "", - "visibility": true, - "cameras": [], - "effects": [] - }, - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "Debug", - "renderingType": "", - "visibility": true, - "cameras": [], - "effects": [ - { - "effectType": "Scene3D::HemisphereLight", - "name": "3D Light", - "doubleParameters": { - "elevation": 45, - "intensity": 1, - "rotation": 0 - }, - "stringParameters": { - "groundColor": "64;64;64", - "skyColor": "255;255;255", - "top": "Y-" - }, - "booleanParameters": {} - } - ] - } - ], - "behaviorsSharedData": [ - { - "name": "AirControl3D", - "type": "AirControl3D::AirControl3D", - "Cos": 0, - "Sin": 0 - }, - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior" - }, - { - "name": "Animation", - "type": "AnimatableCapability::AnimatableBehavior" - }, - { - "name": "Collectible", - "type": "Collectible::Collectible" - }, - { - "name": "Effect", - "type": "EffectCapability::EffectBehavior" - }, - { - "name": "Flippable", - "type": "FlippableCapability::FlippableBehavior" - }, - { - "name": "InOnScreen", - "type": "IsOnScreen::InOnScreen" - }, - { - "name": "MultiplayerObject", - "type": "Multiplayer::MultiplayerObjectBehavior" - }, - { - "name": "Object3D", - "type": "Scene3D::Base3DBehavior" - }, - { - "name": "Opacity", - "type": "OpacityCapability::OpacityBehavior" - }, - { - "name": "Physics3D", - "type": "Physics3D::Physics3DBehavior", - "gravityX": 0, - "gravityY": 0, - "gravityZ": -9.8, - "worldScale": 20 - }, - { - "name": "PhysicsCar3D", - "type": "Physics3D::PhysicsCar3D" - }, - { - "name": "PhysicsCar3DGamepadMapper", - "type": "Gamepads::PhysicsCar3DGamepadMapper" - }, - { - "name": "PhysicsCar3DKeyboardMapper", - "type": "PhysicsCar3DKeyMapper::PhysicsCar3DKeyboardMapper" - }, - { - "name": "PhysicsCar3DMultitouchMapper", - "type": "SpriteMultitouchJoystick::PhysicsCar3DMultitouchMapper" - }, - { - "name": "Resizable", - "type": "ResizableCapability::ResizableBehavior" - }, - { - "name": "Scale", - "type": "ScalableCapability::ScalableBehavior" - }, - { - "name": "Text", - "type": "TextContainerCapability::TextContainerBehavior" - }, - { - "name": "ThirdPersonCamera", - "type": "ThirdPersonCamera::ThirdPersonCamera" - } - ] - }, - { - "b": 0, - "disableInputWhenNotFocused": true, - "mangledName": "Leaderboard", - "name": "Leaderboard", - "r": 0, - "standardSortMethod": true, - "stopSoundsOnStartup": true, - "title": "", - "v": 0, - "uiSettings": { - "grid": true, - "gridType": "rectangular", - "gridWidth": 16, - "gridHeight": 16, - "gridOffsetX": 0, - "gridOffsetY": 0, - "gridColor": 16777215, - "gridAlpha": 0.21, - "snap": true, - "zoomFactor": 0.6022931537048508, - "windowMask": false, - "selectedLayer": "" - }, - "objectsGroups": [], - "variables": [ - { - "name": "LeaderboardScore", - "type": "string", - "value": "" - } - ], - "instances": [ - { - "angle": 0, - "customSize": true, - "height": 64, - "layer": "", - "name": "Platform", - "persistentUuid": "c2c6a11c-e8f8-4ee6-aedb-369f62303136", - "width": 1152, - "x": -96, - "y": 512, - "zOrder": 14, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "height": 896, - "layer": "3D", - "name": "Background", - "persistentUuid": "968c9c47-08c4-44eb-917a-906d2ecee36b", - "width": 1024, - "x": -32, - "y": -320, - "zOrder": 15, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 496, - "keepRatio": true, - "layer": "", - "name": "LeaderboardDialog", - "persistentUuid": "24fb9077-19e6-49ff-b3c3-65ff89f4364f", - "width": 704, - "x": 304, - "y": 128, - "zOrder": 38, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "objects": [ - { - "assetStoreId": "", - "name": "LeaderboardDialog", - "persistentUuid": "be15c1ab-e476-499a-86bc-351227ed37ce", - "type": "LeaderboardDialog::LeaderboardDialog", - "variant": "Grey and yellow", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 4, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 4, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "LeaderboardId": "0d5ac561-afa4-45dc-bf58-561d557f7954", - "DefaultPlayerName": "", - "ScoreLabelText": "Time: ", - "Format": "MM:SS.ms" - } - }, - { - "assetStoreId": "0e3ee52ba8369c68fe75e3b34a056876ba39b1d0dbb9de6e83e1f2ea0e6f94ac", - "name": "Coin", - "type": "Scene3D::Model3DObject", - "variables": [ - { - "folded": true, - "name": "RotationX", - "type": "number", - "value": 0 - }, - { - "folded": true, - "name": "RotationY", - "type": "number", - "value": 0 - }, - { - "folded": true, - "name": "RotationZ", - "type": "number", - "value": 0 - } - ], - "effects": [], - "behaviors": [ - { - "name": "ScreenWrap", - "type": "ScreenWrap::ScreenWrap", - "HorizontalWrapping": false, - "VerticalWrapping": true, - "BorderTop": 0, - "BorderLeft": 0, - "BorderRight": 0, - "BorderBottom": 0, - "TriggerOffset": 500 - } - ], - "content": { - "centerLocation": "ModelOrigin", - "crossfadeDuration": 0, - "depth": 64, - "height": 64, - "isCastingShadow": false, - "isReceivingShadow": false, - "keepAspectRatio": true, - "materialType": "StandardWithoutMetalness", - "modelResourceName": "Coin.glb", - "originLocation": "ModelOrigin", - "rotationX": 0, - "rotationY": 0, - "rotationZ": 0, - "width": 64, - "animations": [] - } - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "LeaderboardDialog" - }, - { - "objectName": "Coin" - } - ] - }, - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Handle leaderboards.\nTo create a leaderboard, make sure your game is registered in Home > Profile > Games Dashboard and then, click on \"Manage game\" > Leaderboards. When a leaderboard is created, it should be available in the actions." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "DepartScene" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "LeaderboardDialog::LeaderboardDialog::SetScore" - }, - "parameters": [ - "LeaderboardDialog", - "=", - "Score", - "" - ] - }, - { - "type": { - "value": "LeaderboardDialog::LeaderboardDialog::SetDefaultPlayerName" - }, - "parameters": [ - "LeaderboardDialog", - "=", - "PlayerName", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "LeaderboardDialog::LeaderboardDialog::IsRestartClicked" - }, - "parameters": [ - "LeaderboardDialog", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Scene" - }, - "parameters": [ - "", - "\"Game\"", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "LeaderboardDialog::LeaderboardDialog::IsScoreSubmitted" - }, - "parameters": [ - "LeaderboardDialog", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "PlayerName", - "=", - "LeaderboardDialog.PlayerName()" - ] - }, - { - "type": { - "value": "Scene" - }, - "parameters": [ - "", - "\"Game\"", - "" - ] - } - ] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Coins animation", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "DepartScene" - }, - "parameters": [ - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "100", - "conditions": [], - "actions": [ - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "Coin", - "RandomInRange(CameraBorderLeft(), CameraBorderRight())", - "RandomInRange(-500 + CameraBorderTop(), CameraBorderBottom() + 500)", - "\"3D\"" - ] - }, - { - "type": { - "value": "SetNumberObjectVariable" - }, - "parameters": [ - "Coin", - "RotationX", - "=", - "RandomFloatInRange(20, 45)" - ] - }, - { - "type": { - "value": "SetNumberObjectVariable" - }, - "parameters": [ - "Coin", - "RotationY", - "=", - "RandomFloatInRange(20, 45)" - ] - }, - { - "type": { - "value": "SetNumberObjectVariable" - }, - "parameters": [ - "Coin", - "RotationZ", - "=", - "RandomFloatInRange(20, 45)" - ] - }, - { - "type": { - "value": "AddForceXY" - }, - "parameters": [ - "Coin", - "0", - "200", - "1" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetZ" - }, - "parameters": [ - "Coin", - "Object3D", - "=", - "RandomFloatInRange(-1000, -32)" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetRotationX" - }, - "parameters": [ - "Coin", - "Object3D", - "=", - "RandomFloat(360)" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetRotationY" - }, - "parameters": [ - "Coin", - "Object3D", - "=", - "RandomFloat(360)" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Scene3D::Base3DBehavior::SetRotationX" - }, - "parameters": [ - "Coin", - "Object3D", - "+", - "Coin.RotationX * TimeDelta()" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetRotationY" - }, - "parameters": [ - "Coin", - "Object3D", - "+", - "Coin.RotationY * TimeDelta()" - ] - }, - { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "Coin", - "+", - "Coin.RotationZ * TimeDelta()" - ] - } - ] - } - ], - "parameters": [] - } - ], - "layers": [ - { - "ambientLightColorB": 167797870, - "ambientLightColorG": 6032144, - "ambientLightColorR": 8563600, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 0.1, - "cameraType": "perspective", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "3D", - "renderingType": "3d", - "visibility": true, - "cameras": [], - "effects": [ - { - "effectType": "Scene3D::HemisphereLight", - "name": "Light", - "doubleParameters": { - "elevation": 90, - "intensity": 0.5, - "rotation": 0 - }, - "stringParameters": { - "groundColor": "127;127;127", - "skyColor": "255;255;255", - "top": "Y-" - }, - "booleanParameters": {} - } - ] - }, - { - "ambientLightColorB": 3, - "ambientLightColorG": 134217728, - "ambientLightColorR": 1597197633, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 0.1, - "cameraType": "perspective", - "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": "Anchor", - "type": "AnchorBehavior::AnchorBehavior" - }, - { - "name": "Animation", - "type": "AnimatableCapability::AnimatableBehavior" - }, - { - "name": "Effect", - "type": "EffectCapability::EffectBehavior" - }, - { - "name": "Flippable", - "type": "FlippableCapability::FlippableBehavior" - }, - { - "name": "Object3D", - "type": "Scene3D::Base3DBehavior" - }, - { - "name": "Opacity", - "type": "OpacityCapability::OpacityBehavior" - }, - { - "name": "Resizable", - "type": "ResizableCapability::ResizableBehavior" - }, - { - "name": "Scale", - "type": "ScalableCapability::ScalableBehavior" - }, - { - "name": "ScreenWrap", - "type": "ScreenWrap::ScreenWrap" - } - ] - } - ], - "externalEvents": [], - "eventsFunctionsExtensions": [ - { - "author": "", - "category": "Input", - "extensionNamespace": "", - "fullName": "Screen Orientation Checker", - "gdevelopVersion": ">=5.5.222", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXNjcmVlbi1yb3RhdGlvbiIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik03LjUsMjEuNUM0LjI1LDE5Ljk0IDEuOTEsMTYuNzYgMS41NSwxM0gwLjA1QzAuNTYsMTkuMTYgNS43MSwyNCAxMiwyNEwxMi42NiwyMy45N0w4Ljg1LDIwLjE2TTE0LjgzLDIxLjE5TDIuODEsOS4xN0w5LjE3LDIuODFMMjEuMTksMTQuODNNMTAuMjMsMS43NUM5LjY0LDEuMTYgOC42OSwxLjE2IDguMTEsMS43NUwxLjc1LDguMTFDMS4xNiw4LjcgMS4xNiw5LjY1IDEuNzUsMTAuMjNMMTMuNzcsMjIuMjVDMTQuMzYsMjIuODQgMTUuMzEsMjIuODQgMTUuODksMjIuMjVMMjIuMjUsMTUuODlDMjIuODQsMTUuMyAyMi44NCwxNC4zNSAyMi4yNSwxMy43N0wxMC4yMywxLjc1TTE2LjUsMi41QzE5Ljc1LDQuMDcgMjIuMDksNy4yNCAyMi40NSwxMUgyMy45NUMyMy40NCw0Ljg0IDE4LjI5LDAgMTIsMEwxMS4zNCwwLjAzTDE1LjE1LDMuODRMMTYuNSwyLjVaIiAvPjwvc3ZnPg==", - "name": "ScreenOrientationChecker", - "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/0126888931a4a4f82bb2824df9f096347ace1c47f510c44df42aa8dc9e49e24a_screen-rotation.svg", - "shortDescription": "Display a customizable screen asking the user to rotate their phone/tablet if not in the right orientation.", - "version": "0.2.0", - "description": "Display a customizable screen asking the user to rotate their phone/tablet if not in the right orientation.", - "origin": { - "identifier": "ScreenOrientationChecker", - "name": "gdevelop-extension-store" - }, - "tags": [ - "screen", - "orientation" - ], - "authorIds": [ - "wWP8BSlAW0UP4NeaHa2LcmmDzmH2" - ], - "dependencies": [], - "globalVariables": [ - { - "name": "TargetOrientation", - "type": "string", - "value": "" - } - ], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Check if the events are running for the editor.", - "fullName": "Editor is running", - "functionType": "Condition", - "name": "IsInGameEdition", - "private": true, - "sentence": "Events are running for the editor", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const game = runtimeScene.getGame();\r", - "eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "fullName": "Get game target orientation", - "functionType": "StringExpression", - "name": "ProjectOrientation", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "eventsFunctionContext.returnValue = runtimeScene.getGame().getGameData().properties.orientation;", - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onFirstSceneLoaded", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "TargetOrientation", - "=", - "ScreenOrientationChecker::ProjectOrientation()" - ] - } - ] - } - ], - "parameters": [], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [ - { - "areaMaxX": 400, - "areaMaxY": 200, - "areaMaxZ": 0, - "areaMinX": 0, - "areaMinY": 0, - "areaMinZ": 0, - "defaultName": "", - "description": "Automatically display a screen asking the player to rotate their screen if needed - on mobile phones and tablets only. Set up Anchor behavior on this object so that top/bottom/left/right edges are anchored to the screen top/bottom/left/right.", - "fullName": "Screen Orientation Checker", - "isInnerAreaFollowingParentSize": true, - "isUsingLegacyInstancesRenderer": false, - "name": "ScreenOrientationChecker", - "objects": [ - { - "assetStoreId": "", - "bold": true, - "italic": false, - "name": "Text", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 4, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 0, - "topEdgeAnchor": 4, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ], - "string": "Rotate screen to play", - "font": "", - "textAlignment": "center", - "characterSize": 30, - "color": { - "b": 255, - "g": 255, - "r": 255 - }, - "content": { - "bold": true, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Rotate screen to play", - "font": "", - "textAlignment": "center", - "verticalTextAlignment": "top", - "characterSize": 30, - "lineHeight": 0, - "color": "255;255;255" - } - }, - { - "assetStoreId": "", - "name": "BackgroundPainter", - "type": "PrimitiveDrawing::Drawer", - "variables": [], - "effects": [], - "behaviors": [], - "fillOpacity": 255, - "outlineSize": 0, - "outlineOpacity": 255, - "absoluteCoordinates": true, - "clearBetweenFrames": true, - "antialiasing": "none", - "fillColor": { - "r": 0, - "g": 0, - "b": 0 - }, - "outlineColor": { - "r": 0, - "g": 0, - "b": 0 - } - }, - { - "adaptCollisionMaskAutomatically": true, - "assetStoreId": "", - "name": "Icon", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 4, - "topEdgeAnchor": 4, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ], - "animations": [ - { - "name": "", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": true, - "image": "rotate-screen-icon.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 52.5, - "y": 56.5 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [ - [ - { - "x": 0, - "y": 1 - }, - { - "x": 105, - "y": 1 - }, - { - "x": 105, - "y": 113 - }, - { - "x": 0, - "y": 113 - } - ] - ] - } - ] - } - ] - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Text" - }, - { - "objectName": "BackgroundPainter" - }, - { - "objectName": "Icon" - } - ] - }, - "objectsGroups": [], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [ - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 35, - "keepRatio": true, - "layer": "", - "name": "Text", - "persistentUuid": "65c003ea-19c0-4f18-a189-a02a24378f35", - "width": 207, - "x": 104, - "y": 120, - "zOrder": 15, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "BackgroundPainter", - "persistentUuid": "49ff4576-6406-41de-a43b-1355529d61fe", - "width": 0, - "x": 38, - "y": 17, - "zOrder": 14, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "Icon", - "persistentUuid": "39cbfc66-13f4-43dc-b6ef-2bda83153277", - "width": 0, - "x": 204, - "y": 64, - "zOrder": 16, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "editionSettings": {}, - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "PrimitiveDrawing::ClearBetweenFrames" - }, - "parameters": [ - "BackgroundPainter", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ScreenOrientationChecker::IsInGameEdition" - }, - "parameters": [ - "", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenOrientationChecker::ScreenOrientationChecker::DrawBackground" - }, - "parameters": [ - "Object", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "ScreenOrientationChecker::IsInGameEdition" - }, - "parameters": [ - "", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Check if the screen must be shown" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SystemInfo::IsMobile" - }, - "parameters": [] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "SceneWindowWidth()", - ">", - "SceneWindowHeight()" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "TargetOrientation", - "=", - "\"portrait\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsShown", - "False", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "TargetOrientation", - "!=", - "\"portrait\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsShown", - "False", - "" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "SceneWindowWidth()", - "<=", - "SceneWindowHeight()" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "TargetOrientation", - "=", - "\"landscape\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsShown", - "False", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "TargetOrientation", - "=", - "\"portrait\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsShown", - "False", - "" - ] - } - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Show/hide the screen as needed" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsShown", - "True", - "" - ] - }, - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsForceShown", - "True", - "" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenOrientationChecker::ScreenOrientationChecker::DrawBackground" - }, - "parameters": [ - "Object", - "" - ] - }, - { - "type": { - "value": "Montre" - }, - "parameters": [ - "Object", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "IsShown", - "True", - "" - ] - }, - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "IsForceShown", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Object" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Icon", - "=", - "Text.Y() - 100" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Animate the icon" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "Tween::Exists" - }, - "parameters": [ - "Icon", - "Tween", - "\"Rotate\"" - ] - }, - { - "type": { - "inverted": true, - "value": "Tween::Exists" - }, - "parameters": [ - "Icon", - "Tween", - "\"RotateBack\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "Tween::TweenBehavior::AddObjectAngleTween2" - }, - "parameters": [ - "Icon", - "Tween", - "\"Rotate\"", - "8", - "\"easeInOutQuad\"", - "2", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Tween::HasFinished" - }, - "parameters": [ - "Icon", - "Tween", - "\"RotateBack\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "Tween::TweenBehavior::AddObjectAngleTween2" - }, - "parameters": [ - "Icon", - "Tween", - "\"Rotate\"", - "8", - "\"easeInOutQuad\"", - "2", - "" - ] - }, - { - "type": { - "value": "Tween::RemoveTween" - }, - "parameters": [ - "Icon", - "Tween", - "\"RotateBack\"" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Tween::HasFinished" - }, - "parameters": [ - "Icon", - "Tween", - "\"Rotate\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "Tween::TweenBehavior::AddObjectAngleTween2" - }, - "parameters": [ - "Icon", - "Tween", - "\"RotateBack\"", - "-8", - "\"easeInOutQuad\"", - "2", - "" - ] - }, - { - "type": { - "value": "Tween::RemoveTween" - }, - "parameters": [ - "Icon", - "Tween", - "\"Rotate\"" - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Draw the background.", - "fullName": "Draw the background", - "functionType": "Action", - "name": "DrawBackground", - "private": true, - "sentence": "Draw the background of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "PrimitiveDrawing::RoundedRectangle" - }, - "parameters": [ - "BackgroundPainter", - "Padding", - "Padding", - "Object.Width()-Padding", - "Object.Height()-Padding", - "CornerRadius" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the screen should be forced to be shown. Use this to test the screen in your game.", - "fullName": "Force show the screen", - "functionType": "Condition", - "name": "IsForceShown", - "sentence": "_PARAM0_ is forced to be shown", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsForceShown", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Change if the screen should be forced to be shown. Use this to test the screen in your game.", - "fullName": "Force show the screen", - "functionType": "Action", - "name": "SetIsForceShown", - "sentence": "Force _PARAM0_ to be shown: _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "Value", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsForceShown", - "False", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "Value", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsForceShown", - "False", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", - "type": "object" - }, - { - "defaultValue": "yes", - "description": "Force show the screen?", - "name": "Value", - "optional": true, - "type": "yesorno" - } - ], - "objectGroups": [] - }, - { - "description": "the message of the object.", - "fullName": "Message", - "functionType": "ExpressionAndCondition", - "name": "Message", - "sentence": "the message", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "Text.Text::Value()" - ] - } - ] - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "Message", - "name": "SetMessage", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "Text", - "Text", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", - "type": "object" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Boolean", - "label": "", - "hidden": true, - "name": "IsShown" - }, - { - "value": "", - "type": "Boolean", - "label": "Force show the screen", - "description": "Use this to test the screen in your game", - "name": "IsForceShown" - }, - { - "value": "5", - "type": "Number", - "unit": "Pixel", - "label": "Padding", - "group": "Appearance", - "name": "Padding" - }, - { - "value": "10", - "type": "Number", - "unit": "Pixel", - "label": "Corner radius", - "description": "Corner radius for the background", - "group": "Appearance", - "name": "CornerRadius" - } - ], - "variants": [ - { - "areaMaxX": 400, - "areaMaxY": 200, - "areaMaxZ": 0, - "areaMinX": 0, - "areaMinY": 0, - "areaMinZ": 0, - "assetStoreAssetId": "2743bcd6cf431c6c00cda3a59684eb152b3a09d598b799b15383e4f77daf8b37", - "assetStoreOriginalName": "Black screen orientation checker", - "name": "Black screen orientation checker", - "objects": [ - { - "assetStoreId": "", - "bold": true, - "italic": false, - "name": "Text", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 4, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 0, - "topEdgeAnchor": 4, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ], - "string": "Rotate screen to play", - "font": "", - "textAlignment": "center", - "characterSize": 30, - "color": { - "b": 255, - "g": 255, - "r": 255 - }, - "content": { - "bold": true, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Rotate screen to play", - "font": "", - "textAlignment": "center", - "verticalTextAlignment": "top", - "characterSize": 30, - "lineHeight": 0, - "color": "255;255;255" - } - }, - { - "assetStoreId": "", - "name": "BackgroundPainter", - "type": "PrimitiveDrawing::Drawer", - "variables": [], - "effects": [], - "behaviors": [], - "fillOpacity": 255, - "outlineSize": 0, - "outlineOpacity": 255, - "absoluteCoordinates": true, - "clearBetweenFrames": true, - "antialiasing": "none", - "fillColor": { - "r": 0, - "g": 0, - "b": 0 - }, - "outlineColor": { - "r": 0, - "g": 0, - "b": 0 - } - }, - { - "adaptCollisionMaskAutomatically": true, - "assetStoreId": "", - "name": "Icon", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 4, - "topEdgeAnchor": 4, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ], - "animations": [ - { - "name": "", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": true, - "image": "rotate-screen-icon.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 52.5, - "y": 56.5 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [ - [ - { - "x": 0, - "y": 1 - }, - { - "x": 105, - "y": 1 - }, - { - "x": 105, - "y": 113 - }, - { - "x": 0, - "y": 113 - } - ] - ] - } - ] - } - ] - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Text" - }, - { - "objectName": "BackgroundPainter" - }, - { - "objectName": "Icon" - } - ] - }, - "objectsGroups": [], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [ - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 35, - "keepRatio": true, - "layer": "", - "name": "Text", - "persistentUuid": "65c003ea-19c0-4f18-a189-a02a24378f35", - "width": 207, - "x": 104, - "y": 120, - "zOrder": 15, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "BackgroundPainter", - "persistentUuid": "49ff4576-6406-41de-a43b-1355529d61fe", - "width": 0, - "x": 38, - "y": 17, - "zOrder": 14, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "Icon", - "persistentUuid": "39cbfc66-13f4-43dc-b6ef-2bda83153277", - "width": 0, - "x": 204, - "y": 64, - "zOrder": 16, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "editionSettings": {} - } - ] - } - ] - }, - { - "author": "Bouh", - "category": "Input", - "extensionNamespace": "", - "fullName": "Gamepads (controllers)", - "gdevelopVersion": ">=5.5.222", - "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.9.0", - "description": [ - "Add support for gamepads (or other physical controllers).", - "", - "It gives access to:", - "- button presses,", - "- axis positions and force,", - "- trigger pressure,", - "- configurable deadzone,", - "- vibration,", - "- automatic \"gamepad mapper\" behaviors for 2D and 3D movement behaviors (platformer characters, top-down movement, 3D character etc...). Add one of these to the object with the movement behavior (i.e: the player most of the time) and the behavior will then be controlled automatically by the gamepad (it works by reading the gamepad state and simulating controls). No need for additional events to make it work once the behaviors are set up.", - "", - "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", - "platformer", - "platform", - "top-down" - ], - "authorIds": [ - "2OwwM8ToR9dx9RJ2sAKTcrLmCB92", - "taRwmWxwAFYFL9yyBwB3cwBw0BO2", - "mnImQKdn8nQxwzkS5D6a1JB27V23", - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [ - { - "name": "Buttons", - "type": "structure", - "children": [ - { - "name": "A or Cross", - "type": "string", - "value": "A" - }, - { - "name": "B or Circle", - "type": "string", - "value": "B" - }, - { - "name": "LB or L1", - "type": "string", - "value": "LB" - }, - { - "name": "LT or L2", - "type": "string", - "value": "LT" - }, - { - "name": "RB or R1", - "type": "string", - "value": "RB" - }, - { - "name": "RT or R2", - "type": "string", - "value": "RT" - }, - { - "name": "X or Square", - "type": "string", - "value": "X" - }, - { - "name": "Y or Triangle", - "type": "string", - "value": "Y" - } - ] - } - ], - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onFirstSceneLoaded", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "if (gdjs._extensionController) {\r", - " return;\r", - "}\r", - "\r", - "/**\r", - " * Associate controller button ids to button names\r", - " */\r", - "const controllerButtonNames = {\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", - " * @param {number} playerId\r", - " */\r", - "function getGamepad(playerId) {\r", - " /** @type {Gamepad[]} */\r", - " const gamepads = navigator.getGamepads ? navigator.getGamepads() : [];\r", - " return gamepads[playerId];\r", - "}\r", - "\r", - "/** @type {{[playerId: number]: Player}} */\r", - "const players = {};\r", - "\r", - "/**\r", - " * @param {number} playerId\r", - " */\r", - "function getPlayer(playerId) {\r", - " let player = players[playerId];\r", - " if (!player) {\r", - " player = new Player(playerId);\r", - " players[playerId] = player;\r", - " }\r", - " return player;\r", - "}\r", - "\r", - "class Player {\r", - " /** @type {number} */\r", - " playerId;\r", - " mapping = 'DEFAULT';\r", - " lastButtonUsed = -1;\r", - " deadzone = 0.2;\r", - " /** @type {{[buttonId: number]: ButtonState}} */\r", - " buttonStates = {};\r", - " rumble = { elapsedTime: 0, duration: 0, weakMagnitude: 0, strongMagnitude: 0 };\r", - "\r", - " /**\r", - " * @param {number} playerId\r", - " */\r", - " constructor(playerId) {\r", - " this.playerId = playerId;\r", - " }\r", - "\r", - " /**\r", - " * @param {number} buttonId\r", - " */\r", - " getButtonState(buttonId) {\r", - " let buttonState = this.buttonStates[buttonId];\r", - " if (!buttonState) {\r", - " buttonState = new ButtonState();\r", - " this.buttonStates[buttonId] = buttonState;\r", - " }\r", - " return buttonState;\r", - " }\r", - "\r", - " /**\r", - " * @param {number} buttonId\r", - " */\r", - " isButtonPressed(buttonId) {\r", - " return this.getButtonState(buttonId).isPressed;\r", - " }\r", - "\r", - " /**\r", - " * @param {number} buttonId\r", - " */\r", - " isButtonJustPressed(buttonId) {\r", - " return this.getButtonState(buttonId).isJustPressed();\r", - " }\r", - "\r", - " /**\r", - " * @param {number} buttonId\r", - " */\r", - " isButtonReleased(buttonId) {\r", - " return this.getButtonState(buttonId).isReleased();\r", - " }\r", - "\r", - " isAnyButtonReleased() {\r", - " for (const buttonId in this.buttonStates) {\r", - " const buttonState = this.buttonStates[buttonId];\r", - " if (buttonState.isReleased()) {\r", - " return true;\r", - " }\r", - " }\r", - " return false;\r", - " }\r", - "\r", - " isAnyButtonPressed() {\r", - " for (const buttonId in this.buttonStates) {\r", - " const buttonState = this.buttonStates[buttonId];\r", - " if (buttonState.isPressed) {\r", - " return true;\r", - " }\r", - " }\r", - " return false;\r", - " }\r", - "}\r", - "\r", - "class ButtonState {\r", - " wasPressed = false;\r", - " isPressed = false;\r", - "\r", - " isReleased() {\r", - " return this.wasPressed && !this.isPressed;\r", - " }\r", - "\r", - " isJustPressed() {\r", - " return !this.wasPressed && this.isPressed;\r", - " }\r", - "}\r", - "\r", - "// Async tasks are run before everything.\r", - "// This is a hack to make sure that button states are updated\r", - "// before mapping behavior events.\r", - "const frameBeginningTask = new class extends gdjs.AsyncTask {\r", - " update() {\r", - " /** @type {Gamepad[]} */\r", - " const gamepads = navigator.getGamepads ? navigator.getGamepads() : [];\r", - " for (let playerId = 0; playerId < gamepads.length; playerId++) {\r", - " const gamepad = gamepads[playerId];\r", - " if (gamepad == null) {\r", - " // The gamepad is not connected.\r", - " continue;\r", - " }\r", - " const player = getPlayer(playerId);\r", - "\r", - " for (let buttonId = 0; buttonId < Object.keys(gamepad.buttons).length; buttonId++) {\r", - " const buttonState = player.getButtonState(buttonId);\r", - " buttonState.wasPressed = buttonState.isPressed;\r", - " buttonState.isPressed = gamepad.buttons[buttonId].pressed;\r", - " if (buttonState.isJustPressed()) {\r", - " player.lastButtonUsed = buttonId;\r", - " }\r", - " }\r", - " }\r", - " return false;\r", - " }\r", - "}();\r", - "\r", - "function onScenePostEvents() {\r", - " /** @type {Gamepad[]} */\r", - " const gamepads = navigator.getGamepads ? navigator.getGamepads() : [];\r", - " for (let playerId = 0; playerId < gamepads.length; playerId++) {\r", - " let gamepad = gamepads[playerId];\r", - " if (gamepad == null) {\r", - " // The gamepad is not connected.\r", - " continue;\r", - " }\r", - " const player = getPlayer(playerId);\r", - " const rumble = player.rumble;\r", - " rumble.elapsedTime += runtimeScene.getElapsedTime(runtimeScene) / 1000;\r", - " if (rumble.duration - rumble.elapsedTime <= 0 &&\r", - " (rumble.weakMagnitude || rumble.strongMagnitude)\r", - " ) {\r", - " rumble.weakMagnitude = 0;\r", - " rumble.strongMagnitude = 0;\r", - " }\r", - " }\r", - "}\r", - "\r", - "/**\r", - " * @param {string} type\r", - " * @param {number} buttonId\r", - " */\r", - "function getInputString(type, buttonId) {\r", - " if (!controllerButtonNames[type]) {\r", - " return \"UNKNOWN_BUTTON\";\r", - " }\r", - " return controllerButtonNames[type][buttonId];\r", - "}\r", - "\r", - "function getButtonId(buttonName) {\r", - " switch (buttonName) {\r", - " case 'A':\r", - " case 'CROSS':\r", - " return 0;\r", - " case 'B':\r", - " case 'CIRCLE':\r", - " return 1;\r", - " case 'X':\r", - " case 'SQUARE':\r", - " return 2;\r", - " case 'Y':\r", - " case 'TRIANGLE':\r", - " return 3;\r", - " case 'LB':\r", - " case 'L1':\r", - " return 4;\r", - " case 'RB':\r", - " case 'R1':\r", - " return 5;\r", - " case 'LT':\r", - " case 'L2':\r", - " return 6;\r", - " case 'RT':\r", - " case 'R2':\r", - " return 7;\r", - " case 'UP':\r", - " return 12;\r", - " case 'DOWN':\r", - " return 13;\r", - " case 'LEFT':\r", - " return 14;\r", - " case 'RIGHT':\r", - " return 15;\r", - " case 'BACK':\r", - " case 'SHARE':\r", - " return 8;\r", - " case 'START':\r", - " case 'OPTIONS':\r", - " return 9;\r", - " case 'CLICK_STICK_LEFT':\r", - " return 10;\r", - " case 'CLICK_STICK_RIGHT':\r", - " return 11;\r", - " //PS4\r", - " case 'PS_BUTTON':\r", - " return 16;\r", - " case 'CLICK_TOUCHPAD':\r", - " return 17;\r", - " default:\r", - " console.error('The gamepad button: ' + buttonName + ' is not valid.');\r", - " return null;\r", - " }\r", - "}\r", - "\r", - "/**\r", - " * @param {number} playerId\r", - " * @param {string} directionName\r", - " * @param {number} axisValueX\r", - " * @param {number} axisValueY\r", - " */\r", - "function isAxisPushed(playerId, directionName, axisValueX, axisValueY) {\r", - " switch (directionName) {\r", - " case 'LEFT':\r", - " return getNormalizedAxisValue(axisValueX, playerId) < 0;\r", - " case 'RIGHT':\r", - " return getNormalizedAxisValue(axisValueX, playerId) > 0;\r", - " case 'UP':\r", - " return getNormalizedAxisValue(axisValueY, playerId) < 0;\r", - " case 'DOWN':\r", - " return getNormalizedAxisValue(axisValueY, playerId) > 0;\r", - " case 'ANY':\r", - " return getNormalizedAxisValue(axisValueX, playerId) < 0\r", - " || getNormalizedAxisValue(axisValueX, playerId) > 0\r", - " || getNormalizedAxisValue(axisValueY, playerId) < 0\r", - " || getNormalizedAxisValue(axisValueY, playerId) > 0\r", - " default:\r", - " console.error('The value stick direction is not valid.');\r", - " return false;\r", - " }\r", - "}\r", - "\r", - "/**\r", - " * @param {number} deltaX\r", - " * @param {number} deltaY\r", - " */\r", - "function axisToAngle(deltaX, deltaY) {\r", - " const rad = Math.atan2(deltaY, deltaX);\r", - " const deg = rad * (180 / Math.PI);\r", - " return deg;\r", - "}\r", - "\r", - "/**\r", - " * @param {{id: string}} gamepad\r", - " */\r", - "function isXbox(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", - "/**\r", - " * Returns the new value taking into account the dead zone for the player_ID given\r", - " * @param {number} value\r", - " * @param {number} playerID\r", - " */\r", - "function getNormalizedAxisValue(value, playerID) {\r", - " // gdjs._extensionController = gdjs._extensionController || { deadzone: 0.2 };\r", - "\r", - " // Anything smaller than this is assumed to be 0,0\r", - " const deadzone = getPlayer(playerID).deadzone;\r", - "\r", - " if (Math.abs(value) < deadzone) {\r", - " return 0;\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 value from\r", - " // deadzone..1 to 0..(1-deadzone)\r", - " // or from\r", - " // -1..-deadzone to -(1-deadzone)..0\r", - " value = value - Math.sign(value) * deadzone;\r", - "\r", - " // Remap value from\r", - " // 0..(1-deadzone) to 0..1\r", - " // or from\r", - " // -(1-deadzone)..0 to -1..0\r", - " return value / (1 - deadzone);\r", - " }\r", - "}\r", - "\r", - "gdjs._extensionController = {\r", - " getPlayer,\r", - " controllerButtonNames,\r", - " getInputString,\r", - " getButtonId,\r", - " axisToAngle,\r", - " isXbox,\r", - " getNormalizedAxisValue,\r", - " isAxisPushed,\r", - " getGamepad,\r", - " onScenePostEvents,\r", - " frameBeginningTask,\r", - "}" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onSceneLoaded", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "// Async tasks are run before everything.\r", - "// This is a hack to make sure that button states are updated\r", - "// before mapping behavior events.\r", - "runtimeScene.getAsyncTasksManager().addTask(gdjs._extensionController.frameBeginningTask);" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onScenePostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "gdjs._extensionController.onScenePostEvents();", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "fullName": "Accelerated speed", - "functionType": "Expression", - "name": "AcceleratedSpeed", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "=", - "CurrentSpeed" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TargetedSpeed", - "<", - "0" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Reduce the speed to match the stick force." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - "<", - "TargetedSpeed" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "=", - "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - ">", - "TargetedSpeed" - ] - }, - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - "<", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "-", - "Acceleration * TimeDelta()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Turn back at least as fast as it would stop." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - ">=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "=", - "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TargetedSpeed", - ">", - "0" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Reduce the speed to match the stick force." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - ">", - "TargetedSpeed" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "=", - "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - "<", - "TargetedSpeed" - ] - }, - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - ">", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "+", - "Acceleration * TimeDelta()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Turn back at least as fast as it would stop." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - "<=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "=", - "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TargetedSpeed", - "=", - "0" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - "<", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "=", - "min(0, CurrentSpeed + Acceleration * TimeDelta())" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - ">", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "=", - "max(0, CurrentSpeed - Acceleration * TimeDelta())" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "clamp(AcceleratedSpeed, -SpeedMax, SpeedMax)" - ] - } - ] - } - ], - "variables": [ - { - "name": "AcceleratedSpeed", - "type": "number", - "value": 0 - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Current speed", - "name": "CurrentSpeed", - "type": "expression" - }, - { - "description": "Targeted speed", - "name": "TargetedSpeed", - "type": "expression" - }, - { - "description": "Max speed", - "name": "SpeedMax", - "type": "expression" - }, - { - "description": "Acceleration", - "name": "Acceleration", - "type": "expression" - }, - { - "description": "Deceleration", - "name": "Deceleration", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "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": [ - "\r", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", - "const trigger = eventsFunctionContext.getArgument(\"Trigger\").toUpperCase();\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", - "/** @type {Gamepad} */\r", - "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", - "if (!gamepad) {\r", - " // The gamepad is not connected.\r", - " 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": "PlayerId", - "type": "expression" - }, - { - "description": "Trigger button", - "name": "Trigger", - "supplementaryInformation": "[\"LT\",\"RT\",\"L2\",\"R2\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "the force of gamepad stick (from 0 to 1).", - "fullName": "Stick force", - "functionType": "ExpressionAndCondition", - "name": "StickForce", - "sentence": "the gamepad _PARAM1_ _PARAM2_ stick force", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const { getNormalizedAxisValue } = gdjs._extensionController;\r", - "\r", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"Stick\").toUpperCase();\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", - "/** @type {Gamepad} */\r", - "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", - "if (!gamepad) {\r", - " // The gamepad is not connected.\r", - " return;\r", - "}\r", - "const axisValueX = stick === 'RIGHT' ? gamepad.axes[2] : gamepad.axes[0];\r", - "const axisValueY = stick === 'RIGHT' ? gamepad.axes[3] : gamepad.axes[1];\r", - "\r", - "eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(\r", - " Math.abs(getNormalizedAxisValue(axisValueX, playerId)) +\r", - " Math.abs(getNormalizedAxisValue(axisValueY, playerId)), 0, 1);\r", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "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 (deprecated)", - "functionType": "Expression", - "name": "StickRotationValue", - "private": true, - "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Gamepads::StickAngle(PlayerId, Stick)" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "type": "expression" - }, - { - "description": "Stick: \"Left\" or \"Right\"", - "name": "Stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Return the angle 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": "Stick angle", - "functionType": "Expression", - "name": "StickAngle", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const { getNormalizedAxisValue } = gdjs._extensionController;\r", - "\r", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"Stick\").toUpperCase();\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", - "/** @type {Gamepad} */\r", - "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", - "if (!gamepad) {\r", - " // The gamepad is not connected.\r", - " return;\r", - "}\r", - "const axisValueX = stick === 'RIGHT' ? gamepad.axes[2] : gamepad.axes[0];\r", - "const axisValueY = stick === 'RIGHT' ? gamepad.axes[3] : gamepad.axes[1];\r", - "\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(\r", - " getNormalizedAxisValue(axisValueX, playerId),\r", - " getNormalizedAxisValue(axisValueY, playerId));" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "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 (deprecated)", - "functionType": "Expression", - "name": "AxisValue", - "private": true, - "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "\r", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", - "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\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", - "/** @type {Gamepad} */\r", - "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", - "if (!gamepad) {\r", - " // The gamepad is not connected.\r", - " 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": "PlayerId", - "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": "Return the gamepad stick force on X axis (from -1 at the left to 1 at the right).", - "fullName": "Stick X force", - "functionType": "Expression", - "name": "StickForceX", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "\r", - "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\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", - "/** @type {Gamepad} */\r", - "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", - "if (!gamepad) {\r", - " // The gamepad is not connected.\r", - " return;\r", - "}\r", - "const axisIndex = stick === 'right' ? 2 : 0;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[axisIndex], playerId);\r", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Gamepad", - "type": "expression" - }, - { - "description": "Stick: \"Left\" or \"Right\"", - "name": "Stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Return the gamepad stick force on Y axis (from -1 at the top to 1 at the bottom).", - "fullName": "Stick Y force", - "functionType": "Expression", - "name": "StickForceY", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "\r", - "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\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", - "/** @type {Gamepad} */\r", - "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", - "if (!gamepad) {\r", - " // The gamepad is not connected.\r", - " return;\r", - "}\r", - "const axisIndex = stick === 'right' ? 3 : 1;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[axisIndex], playerId);\r", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Gamepad", - "type": "expression" - }, - { - "description": "Stick: \"Left\" or \"Right\"", - "name": "Stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "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": [ - "\r", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", - "const button = eventsFunctionContext.getArgument(\"Button\").toUpperCase();\r", - "\r", - "let buttonId = gdjs._extensionController.getButtonId(button);\r", - "if (buttonId === null) {\r", - " return;\r", - "}\r", - "const player = gdjs._extensionController.getPlayer(playerId)\r", - "eventsFunctionContext.returnValue = player.isButtonReleased(buttonId);" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "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": "Check if a button was just pressed 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 just pressed", - "functionType": "Condition", - "name": "IsButtonJustPressed", - "sentence": "Button _PARAM2_ of gamepad _PARAM1_ was just pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "\r", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", - "const button = eventsFunctionContext.getArgument(\"Button\").toUpperCase();\r", - "\r", - "let buttonId = gdjs._extensionController.getButtonId(button);\r", - "if (buttonId === null) {\r", - " return;\r", - "}\r", - "const player = gdjs._extensionController.getPlayer(playerId)\r", - "eventsFunctionContext.returnValue = player.isButtonJustPressed(buttonId);" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "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": [ - "\r", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.getPlayer(playerId).lastButtonUsed;" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "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": [ - "\r", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", - "const player = gdjs._extensionController.getPlayer(playerId)\r", - "eventsFunctionContext.returnValue = player.isAnyButtonPressed();\r", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "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": [ - "\r", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", - "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();\r", - "/** @type {Gamepad} */\r", - "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", - "if (!gamepad) {\r", - " // The gamepad is not connected.\r", - " return;\r", - "}\r", - "const lastButtonUsedID = gdjs._extensionController.getPlayer(playerId).lastButtonUsed;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.getInputString(controllerType, lastButtonUsedID);\r", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "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": [ - "\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : [];\r", - "let lastGamepadIndex = -1;\r", - "for (let playerId = 0; playerId < gamepads.length; playerId++) {\r", - " // Gamepads can be disconnected and become null\r", - " if (gamepads[playerId]) {\r", - " lastGamepadIndex = playerId\r", - " }\r", - "}\r", - "eventsFunctionContext.returnValue = lastGamepadIndex + 1;" - ], - "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": [ - "\r", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", - "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", - "\r", - "const buttonId = gdjs._extensionController.getButtonId(button);\r", - "if (buttonId === null) {\r", - " return;\r", - "}\r", - "const player = gdjs._extensionController.getPlayer(playerId)\r", - "eventsFunctionContext.returnValue = player.isButtonPressed(buttonId);\r", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "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": [ - "\r", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.getPlayer(playerId).deadzone;" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "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": [ - "\r", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", - "const newDeadzone = eventsFunctionContext.getArgument(\"deadzone\");\r", - "\r", - "// https://github.com/4ian/GDevelop-extensions/pull/33#issuecomment-618224857\r", - "gdjs._extensionController.getPlayer(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": "PlayerId", - "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": [ - "\r", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", - "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\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 direction in condition: \"Gamepad stick pushed (axis)\", is not valid, must be UP, DOWN, LEFT or RIGHT');\r", - " return;\r", - "}\r", - "/** @type {Gamepad} */\r", - "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", - "if (!gamepad) {\r", - " // The gamepad is not connected.\r", - " return;\r", - "}\r", - "const axisValueX = stick === 'RIGHT' ? gamepad.axes[2] : gamepad.axes[0];\r", - "const axisValueY = stick === 'RIGHT' ? gamepad.axes[3] : gamepad.axes[1];\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.isAxisPushed(playerId, direction, axisValueX, axisValueY);\r", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "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 count", - "functionType": "Expression", - "name": "ConnectedGamepadsCount", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : [];\r", - "let connectedGamepadCount = 0;\r", - "for (let playerId = 0; playerId < gamepads.length; playerId++) {\r", - " // Gamepads can be disconnected and become null\r", - " if (gamepads[playerId]) {\r", - " connectedGamepadCount++;\r", - " }\r", - "}\r", - "eventsFunctionContext.returnValue = connectedGamepadCount;\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": [ - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;", - "/** @type {Gamepad} */", - "const gamepad = gdjs._extensionController.getGamepad(playerId);", - "if (!gamepad) {", - " // The gamepad is not connected.", - " 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": "PlayerId", - "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": [ - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;", - "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();", - "/** @type {Gamepad} */", - "const gamepad = gdjs._extensionController.getGamepad(playerId);", - "if (!gamepad) {", - " // The gamepad is not connected.", - " 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": "PlayerId", - "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": [ - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;", - "/** @type {Gamepad[]} */", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : [];", - "// 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": "PlayerId", - "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": [ - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;", - "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", - "/** @type {Gamepad} */", - "const gamepad = gdjs._extensionController.getGamepad(playerId);", - "if (!gamepad) {", - " // The gamepad is not connected.", - " return;", - "}", - "//Vibration work only on game in browser.", - "if (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": "PlayerId", - "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": [ - "const { clamp } = gdjs.evtTools.common;", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;", - "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", - "const strongRumbleMagnitude = clamp(eventsFunctionContext.getArgument(\"StrongMagnitude\"), 0, 1);", - "const weakRumbleMagnitude = clamp(eventsFunctionContext.getArgument(\"WeakMagnitude\"), 0, 1);", - "/** @type {Gamepad} */", - "const gamepad = gdjs._extensionController.getGamepad(playerId);", - "if (!gamepad) {", - " // The gamepad is not connected.", - " return;", - "}", - "//Vibration work only on game in browser.", - "if (gamepad.vibrationActuator) {", - " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", - " startDelay: 0,", - " duration: duration * 1000,", - " weakMagnitude: weakRumbleMagnitude,", - " strongMagnitude: strongRumbleMagnitude", - " });", - "}", - "const player = gdjs._extensionController.getPlayer(playerId)", - "player.rumble.duration = duration;", - "player.rumble.elapsedTime = 0;", - "player.rumble.weakMagnitude = weakRumbleMagnitude;", - "player.rumble.strongMagnitude = strongRumbleMagnitude;" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "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": [ - "const { clamp } = gdjs.evtTools.common;", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;", - "const player = gdjs._extensionController.getPlayer(playerId);", - "const elapsedTime = player.rumble.elapsedTime || 0;", - "const originalDuration = player.rumble.duration || 1;", - "const strongRumbleMagnitude = clamp(eventsFunctionContext.getArgument(\"StrongMagnitude\"), 0, 1);", - "const weakRumbleMagnitude = clamp(eventsFunctionContext.getArgument(\"WeakMagnitude\"), 0, 1);", - "/** @type {Gamepad} */", - "const gamepad = gdjs._extensionController.getGamepad(playerId);", - "if (!gamepad) {", - " // The gamepad is not connected.", - " return;", - "}", - "if (originalDuration - elapsedTime <= 0) return;", - "//Vibration work only on game in browser.", - "if (gamepad.vibrationActuator) {", - " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", - " startDelay: 0,", - " duration: 1000 * (originalDuration - elapsedTime),", - " weakMagnitude: weakRumbleMagnitude,", - " strongMagnitude: strongRumbleMagnitude", - " });", - "}", - "", - "player.rumble.weakMagnitude = weakRumbleMagnitude;", - "player.rumble.strongMagnitude = strongRumbleMagnitude;" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "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": "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": [ - "\r", - "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", - "const player = gdjs._extensionController.getPlayer(playerId)\r", - "eventsFunctionContext.returnValue = player.isAnyButtonReleased();" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "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(\"PlayerId\") - 1;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.getPlayer(playerId).rumble.weakMagnitude;" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "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(\"PlayerId\") - 1;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.getPlayer(playerId).rumble.strongMagnitude;" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "PlayerId", - "type": "expression" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ - { - "description": "Control a platformer character with a gamepad.", - "fullName": "Platformer gamepad mapper", - "name": "PlatformerGamepadMapper", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Controller_X_is_connected" - }, - "parameters": [ - "", - "GamepadIdentifier", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "UseArrows", - "True", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Left\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Right\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"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": [ - "", - "GamepadIdentifier", - "\"Down\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "UseLeftStick", - "True", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Left\"", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Left\"", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"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": [ - "", - "GamepadIdentifier", - "\"Left\"", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "UseRightStick", - "True", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Right\"", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Right\"", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"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": [ - "", - "GamepadIdentifier", - "\"Right\"", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "Buttons[JumpButton]", - "\"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", - "extraInformation": [ - "PlatformBehavior::PlatformerObjectBehavior" - ], - "choices": [], - "name": "PlatformerCharacter" - }, - { - "value": "1", - "type": "Number", - "label": "Gamepad identifier (1, 2, 3 or 4)", - "name": "GamepadIdentifier" - }, - { - "value": "true", - "type": "Boolean", - "label": "Use directional pad", - "group": "Controls", - "name": "UseArrows" - }, - { - "value": "true", - "type": "Boolean", - "label": "Use left stick", - "group": "Controls", - "name": "UseLeftStick" - }, - { - "value": "", - "type": "Boolean", - "label": "Use right stick", - "group": "Controls", - "name": "UseRightStick" - }, - { - "value": "A or Cross", - "type": "Choice", - "label": "Jump button", - "group": "Controls", - "choices": [ - { - "label": "A or Cross", - "value": "A or Cross" - }, - { - "label": "B or Circle", - "value": "B or Circle" - }, - { - "label": "X or Square", - "value": "X or Square" - }, - { - "label": "Y or Triangle", - "value": "Y or Triangle" - }, - { - "label": "LB or L1", - "value": "LB or L1" - }, - { - "label": "RB or R1", - "value": "RB or R1" - }, - { - "label": "LT or L2", - "value": "LT or L2" - }, - { - "label": "RT or R2", - "value": "RT or R2" - } - ], - "name": "JumpButton" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Control a 3D physics character with a gamepad.", - "fullName": "3D platformer gamepad mapper", - "name": "Platformer3DGamepadMapper", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Controller_X_is_connected" - }, - "parameters": [ - "", - "GamepadIdentifier", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::StickForce" - }, - "parameters": [ - "", - ">", - "0", - "GamepadIdentifier", - "JoystickIdentifier", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SetForwardAngle" - }, - "parameters": [ - "Object", - "PhysicsCharacter3D", - "=", - "Gamepads::StickAngle(GamepadIdentifier, JoystickIdentifier) + CameraAngle(Object.Layer())" - ] - }, - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SimulateStick" - }, - "parameters": [ - "Object", - "PhysicsCharacter3D", - "-90", - "Gamepads::StickForce(GamepadIdentifier, JoystickIdentifier)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "Buttons[JumpButton]", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PhysicsCharacter3D" - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::Platformer3DGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "3D physics character", - "extraInformation": [ - "Physics3D::PhysicsCharacter3D" - ], - "choices": [], - "name": "PhysicsCharacter3D" - }, - { - "value": "1", - "type": "Number", - "label": "Gamepad identifier (1, 2, 3 or 4)", - "name": "GamepadIdentifier" - }, - { - "value": "Left", - "type": "Choice", - "label": "Walk joystick", - "group": "Controls", - "choices": [ - { - "label": "Left", - "value": "Left" - }, - { - "label": "Right", - "value": "Right" - } - ], - "name": "JoystickIdentifier" - }, - { - "value": "A or Cross", - "type": "Choice", - "label": "Jump button", - "group": "Controls", - "choices": [ - { - "label": "A or Cross", - "value": "A or Cross" - }, - { - "label": "B or Circle", - "value": "B or Circle" - }, - { - "label": "X or Square", - "value": "X or Square" - }, - { - "label": "Y or Triangle", - "value": "Y or Triangle" - }, - { - "label": "LB or L1", - "value": "LB or L1" - }, - { - "label": "RB or R1", - "value": "RB or R1" - }, - { - "label": "LT or L2", - "value": "LT or L2" - }, - { - "label": "RT or R2", - "value": "RT or R2" - } - ], - "name": "JumpButton" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Control a 3D physics character with a gamepad.", - "fullName": "3D shooter gamepad mapper", - "name": "Shooter3DGamepadMapper", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Controller_X_is_connected" - }, - "parameters": [ - "", - "GamepadIdentifier", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::StickForce" - }, - "parameters": [ - "", - ">", - "0", - "GamepadIdentifier", - "WalkStick", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SimulateStick" - }, - "parameters": [ - "Object", - "PhysicsCharacter3D", - "Gamepads::StickAngle(GamepadIdentifier, WalkStick)", - "Gamepads::StickForce(GamepadIdentifier, WalkStick)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "Buttons[JumpButton]", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PhysicsCharacter3D" - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::Shooter3DGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "3D physics character", - "extraInformation": [ - "Physics3D::PhysicsCharacter3D" - ], - "choices": [], - "name": "PhysicsCharacter3D" - }, - { - "value": "1", - "type": "Number", - "label": "Gamepad identifier (1, 2, 3 or 4)", - "name": "GamepadIdentifier" - }, - { - "value": "Left", - "type": "Choice", - "label": "Walk joystick", - "group": "Controls", - "choices": [ - { - "label": "Left", - "value": "Left" - }, - { - "label": "Right", - "value": "Right" - } - ], - "name": "WalkStick" - }, - { - "value": "Right", - "type": "Choice", - "label": "Camera joystick", - "group": "Controls", - "choices": [ - { - "label": "Left", - "value": "Left" - }, - { - "label": "Right", - "value": "Right" - } - ], - "name": "CameraStick" - }, - { - "value": "A or Cross", - "type": "Choice", - "label": "Jump button", - "group": "Controls", - "choices": [ - { - "label": "A or Cross", - "value": "A or Cross" - }, - { - "label": "B or Circle", - "value": "B or Circle" - }, - { - "label": "X or Square", - "value": "X or Square" - }, - { - "label": "Y or Triangle", - "value": "Y or Triangle" - }, - { - "label": "LB or L1", - "value": "LB or L1" - }, - { - "label": "RB or R1", - "value": "RB or R1" - }, - { - "label": "LT or L2", - "value": "LT or L2" - }, - { - "label": "RT or R2", - "value": "RT or R2" - } - ], - "name": "JumpButton" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Control camera rotations with a gamepad.", - "fullName": "First person camera gamepad mapper", - "name": "FirstPersonGamepadMapper", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "TODO It's probably a bad idea to rotate the object around Y." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "CurrentRotationSpeedZ", - "=", - "Gamepads::AcceleratedSpeed(CurrentRotationSpeedZ, Gamepads::StickForceX(GamepadIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" - ] - }, - { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "Object", - "+", - "CurrentRotationSpeedZ * TimeDelta()" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "CurrentRotationSpeedY", - "=", - "Gamepads::AcceleratedSpeed(CurrentRotationSpeedY, Gamepads::StickForceY(GamepadIdentifier, CameraStick) * VerticalRotationSpeedMax, VerticalRotationSpeedMax, VerticalRotationAcceleration, VerticalRotationDeceleration)" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetRotationY" - }, - "parameters": [ - "Object", - "Object3D", - "+", - "CurrentRotationSpeedY * TimeDelta()" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetRotationY" - }, - "parameters": [ - "Object", - "Object3D", - "=", - "clamp(Object.Object3D::RotationY(), VerticalAngleMin, VerticalAngleMax)" - ] - }, - { - "type": { - "value": "Gamepads::FirstPersonGamepadMapper::LookFromObjectEyes" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Move the camera to look though _PARAM1_ eyes. The object must look to the right when all its angles are 0 and the top of its head be toward Z+.", - "fullName": "Look through object eyes", - "functionType": "Action", - "group": "Layers and cameras", - "name": "LookFromObjectEyes", - "private": true, - "sentence": "Move the camera to look though _PARAM0_ eyes", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "CentreCamera" - }, - "parameters": [ - "", - "Object", - "", - "Object.Layer()", - "" - ] - }, - { - "type": { - "value": "Scene3D::SetCameraZ" - }, - "parameters": [ - "", - "=", - "Object.Object3D::Z() + Object.Object3D::Depth() + OffsetZ", - "", - "" - ] - }, - { - "type": { - "value": "Scene3D::SetCameraRotationX" - }, - "parameters": [ - "", - "=", - "- Object.Object3D::RotationY() + 90", - "GetArgumentAsString(\"Layer\")", - "" - ] - }, - { - "type": { - "value": "Scene3D::SetCameraRotationY" - }, - "parameters": [ - "", - "=", - "Object.Object3D::RotationX()", - "GetArgumentAsString(\"Layer\")", - "" - ] - }, - { - "type": { - "value": "SetCameraAngle" - }, - "parameters": [ - "", - "=", - "Object.Angle() + 90", - "Object.Layer()", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the maximum horizontal rotation speed of the object.", - "fullName": "Maximum horizontal rotation speed", - "functionType": "ExpressionAndCondition", - "group": "First person camera gamepad mapper horizontal rotation configuration", - "name": "HorizontalRotationSpeedMax", - "sentence": "the maximum horizontal rotation speed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "HorizontalRotationSpeedMax" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "HorizontalRotationSpeedMax", - "name": "SetHorizontalRotationSpeedMax", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "HorizontalRotationSpeedMax", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the horizontal rotation acceleration of the object.", - "fullName": "Horizontal rotation acceleration", - "functionType": "ExpressionAndCondition", - "group": "First person camera gamepad mapper horizontal rotation configuration", - "name": "HorizontalRotationAcceleration", - "sentence": "the horizontal rotation acceleration", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "HorizontalRotationAcceleration" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "HorizontalRotationAcceleration", - "name": "SetHorizontalRotationAcceleration", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "HorizontalRotationAcceleration", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the horizontal rotation deceleration of the object.", - "fullName": "Horizontal rotation deceleration", - "functionType": "ExpressionAndCondition", - "group": "First person camera gamepad mapper horizontal rotation configuration", - "name": "HorizontalRotationDeceleration", - "sentence": "the horizontal rotation deceleration", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "HorizontalRotationDeceleration" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "HorizontalRotationDeceleration", - "name": "SetHorizontalRotationDeceleration", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "HorizontalRotationDeceleration", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the maximum vertical rotation speed of the object.", - "fullName": "Maximum vertical rotation speed", - "functionType": "ExpressionAndCondition", - "group": "First person camera gamepad mapper vertical rotation configuration", - "name": "VerticalRotationSpeedMax", - "sentence": "the maximum vertical rotation speed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "VerticalRotationSpeedMax" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "VerticalRotationSpeedMax", - "name": "SetVerticalRotationSpeedMax", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "VerticalRotationSpeedMax", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the vertical rotation acceleration of the object.", - "fullName": "Vertical rotation acceleration", - "functionType": "ExpressionAndCondition", - "group": "First person camera gamepad mapper vertical rotation configuration", - "name": "VerticalRotationAcceleration", - "sentence": "the vertical rotation acceleration", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "VerticalRotationAcceleration" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "VerticalRotationAcceleration", - "name": "SetVerticalRotationAcceleration", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "VerticalRotationAcceleration", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the vertical rotation deceleration of the object.", - "fullName": "Vertical rotation deceleration", - "functionType": "ExpressionAndCondition", - "group": "First person camera gamepad mapper vertical rotation configuration", - "name": "VerticalRotationDeceleration", - "sentence": "the vertical rotation deceleration", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "VerticalRotationDeceleration" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "VerticalRotationDeceleration", - "name": "SetVerticalRotationDeceleration", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "VerticalRotationDeceleration", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the minimum vertical camera angle of the object.", - "fullName": "Minimum vertical camera angle", - "functionType": "ExpressionAndCondition", - "group": "First person camera gamepad mapper vertical rotation configuration", - "name": "VerticalAngleMin", - "sentence": "the minimum vertical camera angle", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "VerticalAngleMin" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "VerticalAngleMin", - "name": "SetVerticalAngleMin", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "VerticalAngleMin", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the maximum vertical camera angle of the object.", - "fullName": "Maximum vertical camera angle", - "functionType": "ExpressionAndCondition", - "group": "First person camera gamepad mapper vertical rotation configuration", - "name": "VerticalAngleMax", - "sentence": "the maximum vertical camera angle", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "VerticalAngleMax" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "VerticalAngleMax", - "name": "SetVerticalAngleMax", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "VerticalAngleMax", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the z position offset of the object.", - "fullName": "Z position offset", - "functionType": "ExpressionAndCondition", - "group": "First person camera gamepad mapper position configuration", - "name": "OffsetZ", - "sentence": "the z position offset", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "OffsetZ" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "OffsetZ", - "name": "SetOffsetZ", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "OffsetZ", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "3D capability", - "extraInformation": [ - "Scene3D::Base3DBehavior" - ], - "choices": [], - "name": "Object3D" - }, - { - "value": "1", - "type": "Number", - "label": "Gamepad identifier (1, 2, 3 or 4)", - "name": "GamepadIdentifier" - }, - { - "value": "Right", - "type": "Choice", - "label": "Camera joystick", - "choices": [ - { - "label": "Left", - "value": "Left" - }, - { - "label": "Right", - "value": "Right" - } - ], - "name": "CameraStick" - }, - { - "value": "180", - "type": "Number", - "unit": "AngularSpeed", - "label": "Maximum rotation speed", - "group": "Horizontal rotation", - "name": "HorizontalRotationSpeedMax" - }, - { - "value": "360", - "type": "Number", - "label": "Rotation acceleration", - "group": "Horizontal rotation", - "name": "HorizontalRotationAcceleration" - }, - { - "value": "720", - "type": "Number", - "label": "Rotation deceleration", - "group": "Horizontal rotation", - "name": "HorizontalRotationDeceleration" - }, - { - "value": "120", - "type": "Number", - "unit": "AngularSpeed", - "label": "Maximum rotation speed", - "group": "Vertical rotation", - "name": "VerticalRotationSpeedMax" - }, - { - "value": "240", - "type": "Number", - "label": "Rotation acceleration", - "group": "Vertical rotation", - "name": "VerticalRotationAcceleration" - }, - { - "value": "480", - "type": "Number", - "label": "Rotation deceleration", - "group": "Vertical rotation", - "name": "VerticalRotationDeceleration" - }, - { - "value": "-90", - "type": "Number", - "unit": "DegreeAngle", - "label": "Minimum angle", - "group": "Vertical rotation", - "name": "VerticalAngleMin" - }, - { - "value": "90", - "type": "Number", - "unit": "DegreeAngle", - "label": "Maximum angle", - "group": "Vertical rotation", - "name": "VerticalAngleMax" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Z position offset", - "group": "Position", - "name": "OffsetZ" - }, - { - "value": "0", - "type": "Number", - "unit": "AngularSpeed", - "label": "Current rotation speed Z", - "hidden": true, - "name": "CurrentRotationSpeedZ" - }, - { - "value": "0", - "type": "Number", - "unit": "AngularSpeed", - "label": "Current rotation speed Y", - "hidden": true, - "name": "CurrentRotationSpeedY" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Control a 3D physics car with a gamepad.", - "fullName": "3D car gamepad mapper", - "name": "PhysicsCar3DGamepadMapper", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Controller_X_is_connected" - }, - "parameters": [ - "", - "GamepadIdentifier", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "UseArrows", - "True", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Left\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCar3D::SimulateLeftKey" - }, - "parameters": [ - "Object", - "PhysicsCar3D" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Right\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCar3D::SimulateRightKey" - }, - "parameters": [ - "Object", - "PhysicsCar3D" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "UseLeftStick", - "True", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "1", - "\"Left\"", - "\"Any\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCar3D::SimulateSteeringStick" - }, - "parameters": [ - "Object", - "PhysicsCar3D", - "Gamepads::StickForceX(GamepadIdentifier, \"Left\")" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "UseRightStick", - "True", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "1", - "\"Right\"", - "\"Any\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCar3D::SimulateSteeringStick" - }, - "parameters": [ - "Object", - "PhysicsCar3D", - "Gamepads::StickForceX(GamepadIdentifier, \"Right\")" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "1", - "\"LT\"", - "\"Up\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "1", - "\"RT\"", - "\"Up\"" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCar3D::SimulateAcceleratorStick" - }, - "parameters": [ - "Object", - "PhysicsCar3D", - "Gamepads::TriggerPressure(GamepadIdentifier, \"RT\") - Gamepads::TriggerPressure(GamepadIdentifier, \"LT\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "Buttons[HandBrakeButton]", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCar3D::SimulateHandBrakeKey" - }, - "parameters": [ - "Object", - "PhysicsCar3D" - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::PhysicsCar3DGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "3D physics car", - "extraInformation": [ - "Physics3D::PhysicsCar3D" - ], - "choices": [], - "name": "PhysicsCar3D" - }, - { - "value": "1", - "type": "Number", - "label": "Gamepad identifier (1, 2, 3 or 4)", - "name": "GamepadIdentifier" - }, - { - "value": "true", - "type": "Boolean", - "label": "Use directional pad", - "group": "Controls", - "name": "UseArrows" - }, - { - "value": "true", - "type": "Boolean", - "label": "Use left stick", - "group": "Controls", - "name": "UseLeftStick" - }, - { - "value": "", - "type": "Boolean", - "label": "Use right stick", - "group": "Controls", - "name": "UseRightStick" - }, - { - "value": "B or Circle", - "type": "Choice", - "label": "Hand brake button", - "group": "Controls", - "choices": [ - { - "label": "A or Cross", - "value": "A or Cross" - }, - { - "label": "B or Circle", - "value": "B or Circle" - }, - { - "label": "X or Square", - "value": "X or Square" - }, - { - "label": "Y or Triangle", - "value": "Y or Triangle" - }, - { - "label": "LB or L1", - "value": "LB or L1" - }, - { - "label": "RB or R1", - "value": "RB or R1" - }, - { - "label": "LT or L2", - "value": "LT or L2" - }, - { - "label": "RT or R2", - "value": "RT or R2" - } - ], - "name": "HandBrakeButton" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Control a top-down character with a gamepad.", - "fullName": "Top-down gamepad mapper", - "name": "TopDownGamepadMapper", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Controller_X_is_connected" - }, - "parameters": [ - "", - "GamepadIdentifier", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "UseArrows", - "True", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Left\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Right\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Up\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Down\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "UseLeftStick", - "True", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "StickMode", - "=", - "\"Analog\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "Gamepads::StickRotationValue(GamepadIdentifier, \"Left\")", - "Gamepads::StickForce(GamepadIdentifier, \"Left\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "StickMode", - "=", - "\"360°\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "Gamepads::StickRotationValue(GamepadIdentifier, \"Left\")", - "sign(Gamepads::StickForce(GamepadIdentifier, \"Left\"))" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "StickMode", - "=", - "\"8 Directions\"" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Left\"", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Left\"", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Left\"", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Left\"", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "UseRightStick", - "True", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "StickMode", - "=", - "\"Analog\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "Gamepads::StickRotationValue(GamepadIdentifier, \"Right\")", - "Gamepads::StickForce(GamepadIdentifier, \"Right\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "StickMode", - "=", - "\"360°\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "sign(Gamepads::StickForce(GamepadIdentifier, \"Right\"))", - "1" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "StickMode", - "=", - "\"8 Directions\"" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Right\"", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Right\"", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Right\"", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"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", - "extraInformation": [ - "TopDownMovementBehavior::TopDownMovementBehavior" - ], - "choices": [], - "name": "TopDownMovement" - }, - { - "value": "1", - "type": "Number", - "label": "Gamepad identifier (1, 2, 3 or 4)", - "name": "GamepadIdentifier" - }, - { - "value": "true", - "type": "Boolean", - "label": "Use directional pad", - "group": "Controls", - "name": "UseArrows" - }, - { - "value": "true", - "type": "Boolean", - "label": "Use left stick", - "group": "Controls", - "name": "UseLeftStick" - }, - { - "value": "", - "type": "Boolean", - "label": "Use right stick", - "group": "Controls", - "name": "UseRightStick" - }, - { - "value": "Analog", - "type": "Choice", - "label": "Stick mode", - "group": "Controls", - "choices": [ - { - "label": "Analog", - "value": "Analog" - }, - { - "label": "360°", - "value": "360°" - }, - { - "label": "8 Directions", - "value": "8 Directions" - } - ], - "name": "StickMode" - } - ], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "Input", - "extensionNamespace": "", - "fullName": "Multitouch joystick and buttons (sprite)", - "gdevelopVersion": ">=5.5.222", - "helpPath": "/objects/multitouch-joystick", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMTYiIGN5PSIxNiIgcj0iMTMiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjI4LjQsMTIgMjAsMTIgMjAsMy42ICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMjAsMjguNCAyMCwyMCAyOC40LDIwICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMy42LDIwIDEyLDIwIDEyLDI4LjQgIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIxMiwzLjYgMTIsMTIgMy42LDEyICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIxNiw2IDE2LjcsNyAxNS4zLDcgIi8+DQo8cG9seWdvbiBjbGFzcz0ic3QwIiBwb2ludHM9IjE2LDI2IDE1LjMsMjUgMTYuNywyNSAiLz4NCjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iNiwxNiA3LDE1LjMgNywxNi43ICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIyNiwxNiAyNSwxNi43IDI1LDE1LjMgIi8+DQo8L3N2Zz4NCg==", - "name": "SpriteMultitouchJoystick", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Videogames/Videogames_controller_joystick_arrows_direction.svg", - "shortDescription": "Joysticks or buttons for touchscreens.", - "version": "1.9.0", - "description": [ - "Multitouch joysticks are objects showing a joystick on the screen, useful for mobile. They work like a physical gamepad:", - "- 4 or 8 directions", - "- Analogus pads", - "- Player selection", - "- Automatic \"mapper\" behaviors for 2D and 3D movement behaviors (platformer characters, top-down movement, 3D character etc...). Add one of these to the object with the movement behavior (i.e: the player most of the time) and the behavior will then be controlled automatically by the virtual joystick (it works by reading the multitouch joystick state and simulating controls). No need for additional events to make it work once the behaviors are set up.", - "", - "There are ready-to-use joysticks in the asset-store [multitouch joysticks pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=multitouch-joysticks-multitouch-joysticks)." - ], - "origin": { - "identifier": "SpriteMultitouchJoystick", - "name": "gdevelop-extension-store" - }, - "tags": [ - "multitouch", - "joystick", - "thumbstick", - "controller", - "touchscreen", - "twin stick", - "shooter", - "virtual", - "platformer", - "platform", - "top-down" - ], - "authorIds": [ - "gqDaZjCfevOOxBYkK6zlhtZnXCg1", - "1OgYzWp5UeVPbiWGJwI6vqfgZLC3", - "v0YRpdAnIucZFgiRCCecqVnGKno2", - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [ - { - "name": "Controllers", - "type": "array", - "children": [ - { - "type": "structure", - "children": [ - { - "name": "Buttons", - "type": "array", - "children": [ - { - "type": "structure", - "children": [ - { - "name": "State", - "type": "string", - "value": "Idle" - } - ] - } - ] - }, - { - "name": "Joystick", - "type": "structure", - "children": [] - } - ] - } - ] - } - ], - "eventsFunctions": [ - { - "description": "Check if the events are running for the editor.", - "fullName": "Editor is running", - "functionType": "Condition", - "name": "IsInGameEdition", - "private": true, - "sentence": "Events are running for the editor", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const game = runtimeScene.getGame();\r", - "eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "fullName": "Accelerated speed", - "functionType": "Expression", - "name": "AcceleratedSpeed", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "=", - "CurrentSpeed" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TargetedSpeed", - "<", - "0" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Reduce the speed to match the stick force." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - "<", - "TargetedSpeed" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "=", - "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - ">", - "TargetedSpeed" - ] - }, - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - "<", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "-", - "Acceleration * TimeDelta()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Turn back at least as fast as it would stop." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - ">=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "=", - "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TargetedSpeed", - ">", - "0" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Reduce the speed to match the stick force." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - ">", - "TargetedSpeed" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "=", - "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - "<", - "TargetedSpeed" - ] - }, - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - ">", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "+", - "Acceleration * TimeDelta()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Turn back at least as fast as it would stop." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - "<=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "=", - "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TargetedSpeed", - "=", - "0" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - "<", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "=", - "min(0, CurrentSpeed + Acceleration * TimeDelta())" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CurrentSpeed", - ">", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AcceleratedSpeed", - "=", - "max(0, CurrentSpeed - Acceleration * TimeDelta())" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "clamp(AcceleratedSpeed, -SpeedMax, SpeedMax)" - ] - } - ] - } - ], - "variables": [ - { - "name": "AcceleratedSpeed", - "type": "number", - "value": 0 - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Current speed", - "name": "CurrentSpeed", - "type": "expression" - }, - { - "description": "Targeted speed", - "name": "TargetedSpeed", - "type": "expression" - }, - { - "description": "Max speed", - "name": "SpeedMax", - "type": "expression" - }, - { - "description": "Acceleration", - "name": "Acceleration", - "type": "expression" - }, - { - "description": "Deceleration", - "name": "Deceleration", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Check if a button was just pressed on a multitouch controller.", - "fullName": "Multitouch controller button just pressed", - "functionType": "Condition", - "name": "IsButtonJustPressed", - "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ was just pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Controllers[ControllerIdentifier].Buttons[Button].State", - "=", - "\"JustPressed\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Button name", - "name": "Button", - "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "Check if a button is pressed on a multitouch controller.", - "fullName": "Multitouch controller button pressed", - "functionType": "Condition", - "name": "IsButtonPressed", - "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Controllers[ControllerIdentifier].Buttons[Button].State", - "=", - "\"Pressed\"" - ] - }, - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Controllers[ControllerIdentifier].Buttons[Button].State", - "=", - "\"JustPressed\"" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Button name", - "name": "Button", - "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "Check if a button is released on a multitouch controller.", - "fullName": "Multitouch controller button released", - "functionType": "Condition", - "name": "IsButtonReleased", - "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is released", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Controllers[ControllerIdentifier].Buttons[Button].State", - "=", - "\"Released\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Button name", - "name": "Button", - "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "Change a button state for a multitouch controller.", - "fullName": "Button state", - "functionType": "Action", - "name": "SetButtonState", - "private": true, - "sentence": "Mark _PARAM2_ button as _PARAM3_ for multitouch controller _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "Controllers[ControllerIdentifier].Buttons[Button].State", - "=", - "ButtonState" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Button name", - "name": "Button", - "type": "string" - }, - { - "description": "Button state", - "name": "ButtonState", - "supplementaryInformation": "[\"Idle\",\"Pressed\",\"JustPressed\",\"Released\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Change the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", - "fullName": "Dead zone radius", - "functionType": "Action", - "name": "SetDeadZone", - "private": true, - "sentence": "Change the dead zone of multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", - "=", - "DeadZoneRadius" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "type": "string" - }, - { - "description": "Dead zone radius", - "name": "DeadZoneRadius", - "supplementaryInformation": "[]", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Return the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", - "fullName": "Dead zone radius", - "functionType": "Expression", - "name": "DeadZone", - "private": true, - "sentence": "Change multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ dead zone to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "the direction index (left = 1, bottom = 1, right = 2, top = 3) for an angle (in degrees).", - "fullName": "Angle to 4-way index", - "functionType": "ExpressionAndCondition", - "name": "AngleTo4Way", - "private": true, - "sentence": "The angle _PARAM1_ 4-way index", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "mod(round(Angle * 4 / 360), 4)" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Angle", - "name": "Angle", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "the direction index (left = 1, bottom-left = 1... top-left = 7) for an angle (in degrees).", - "fullName": "Angle to 8-way index", - "functionType": "ExpressionAndCondition", - "name": "AngleTo8Way", - "private": true, - "sentence": "The angle _PARAM1_ 8-way index", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "mod(round(Angle * 8 / 360), 8)" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Angle", - "name": "Angle", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Check if angle is in a given direction.", - "fullName": "Angle 4-way direction", - "functionType": "Condition", - "name": "IsAngleIn4WayDirection", - "private": true, - "sentence": "The angle _PARAM1_ is the 4-way direction _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Right\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" - }, - "parameters": [ - "", - "=", - "0", - "Angle", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Down\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" - }, - "parameters": [ - "", - "=", - "1", - "Angle", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Left\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" - }, - "parameters": [ - "", - "=", - "2", - "Angle", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Up\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" - }, - "parameters": [ - "", - "=", - "3", - "Angle", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Angle", - "name": "Angle", - "type": "expression" - }, - { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Check if angle is in a given direction.", - "fullName": "Angle 8-way direction", - "functionType": "Condition", - "name": "IsAngleIn8WayDirection", - "private": true, - "sentence": "The angle _PARAM1_ is the 8-way direction _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Right\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "0", - "Angle", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"DownRight\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "1", - "Angle", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Down\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "2", - "Angle", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"DownLeft\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "3", - "Angle", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Left\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "4", - "Angle", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"UpLeft\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "5", - "Angle", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Up\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "6", - "Angle", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"UpRight\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "7", - "Angle", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Angle", - "name": "Angle", - "type": "expression" - }, - { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Check if joystick is pushed in a given direction.", - "fullName": "Joystick pushed in a direction (4-way)", - "functionType": "Condition", - "name": "IsDirectionPushed4Way", - "sentence": "Joystick _PARAM2_ of multitouch controller _PARAM1_ is pushed in direction _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Make sure the joystick has moved from center" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::JoystickForce" - }, - "parameters": [ - "", - ">", - "0", - "ControllerIdentifier", - "JoystickIdentifier", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::IsAngleIn4WayDirection" - }, - "parameters": [ - "", - "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", - "Direction", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "supplementaryInformation": "[\"Primary\",\"Secondary\"]", - "type": "stringWithSelector" - }, - { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Check if joystick is pushed in a given direction.", - "fullName": "Joystick pushed in a direction (8-way)", - "functionType": "Condition", - "name": "IsDirectionPushed8Way", - "sentence": "Joystick _PARAM2_ of multitouch controller _PARAM1_ is pushed in direction _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Make sure the joystick has moved from center" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::JoystickForce" - }, - "parameters": [ - "", - ">", - "0", - "ControllerIdentifier", - "JoystickIdentifier", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::IsAngleIn8WayDirection" - }, - "parameters": [ - "", - "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", - "Direction", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "supplementaryInformation": "[\"Primary\",\"Secondary\"]", - "type": "stringWithSelector" - }, - { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "the percentage the thumb has been pulled away from the joystick center (Range: 0 to 1).", - "fullName": "Joystick force (deprecated)", - "functionType": "ExpressionAndCondition", - "name": "JoystickForce", - "private": true, - "sentence": "Joystick _PARAM2_ of multitouch controller _PARAM1_ force", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "supplementaryInformation": "[\"Primary\",\"Secondary\"]", - "type": "stringWithSelector" - }, - { - "description": "", - "name": "Coucou", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "the force of multitouch contoller stick (from 0 to 1).", - "fullName": "Stick force", - "functionType": "ExpressionAndCondition", - "name": "StickForce", - "sentence": "multitouch controller _PARAM1_ _PARAM2_ stick force", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "max(0, Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier)) / (1 - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier))" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Stick name", - "name": "JoystickIdentifier", - "supplementaryInformation": "[\"Primary\",\"Secondary\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Change the percentage the thumb has been pulled away from the joystick center (Range: 0 to 1).", - "fullName": "Joystick force", - "functionType": "Action", - "name": "SetJoystickForce", - "private": true, - "sentence": "Change the force of the joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "type": "string" - }, - { - "description": "Value", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Return the angle the joystick is pointing towards (Range: -180 to 180).", - "fullName": "Joystick angle (deprecated)", - "functionType": "Expression", - "name": "JoystickAngle", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "supplementaryInformation": "[\"Primary\",\"Secondary\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Return the angle the multitouch controller stick is pointing towards (Range: -180 to 180).", - "fullName": "Stick angle", - "functionType": "Expression", - "name": "StickAngle", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "supplementaryInformation": "[\"Primary\",\"Secondary\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Change the angle the joystick is pointing towards (Range: -180 to 180).", - "fullName": "Joystick angle", - "functionType": "Action", - "name": "SetJoystickAngle", - "private": true, - "sentence": "Change the angle of the joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "type": "string" - }, - { - "description": "Value", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Return the multitouch contoller stick force on X axis (from -1 at the left to 1 at the right).", - "fullName": "Stick X force", - "functionType": "Expression", - "name": "StickForceX", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "XFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "supplementaryInformation": "[\"Primary\",\"Secondary\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Return the multitouch contoller stick force on Y axis (from -1 at the top to 1 at the bottom).", - "fullName": "Stick Y force", - "functionType": "Expression", - "name": "StickForceY", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "YFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "supplementaryInformation": "[\"Primary\",\"Secondary\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Check if a new touch has started on the right or left side of the screen.", - "fullName": "New touch on a screen side", - "functionType": "Condition", - "group": "Multitouch Joystick", - "name": "HasTouchStartedOnScreenSide", - "sentence": "A new touch has started on the _PARAM2_ side of the screen on _PARAM1_'s layer", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HasAnyTouchOrMouseStarted" - }, - "parameters": [ - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Side", - "=", - "\"Left\"" - ] - }, - { - "type": { - "value": "TouchX" - }, - "parameters": [ - "", - "StartedTouchOrMouseId(0)", - "<", - "CameraCenterX(Object.Layer())", - "Object.Layer()", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Side", - "=", - "\"Right\"" - ] - }, - { - "type": { - "value": "TouchX" - }, - "parameters": [ - "", - "StartedTouchOrMouseId(0)", - ">=", - "CameraCenterX(Object.Layer())", - "Object.Layer()", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch joystick", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "objectList" - }, - { - "description": "Screen side", - "name": "Side", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ - { - "description": "Joystick that can be controlled by interacting with a touchscreen.", - "fullName": "Multitouch Joystick", - "name": "MultitouchJoystick", - "objectType": "", - "private": true, - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::SetDeadZone" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "DeadZoneRadius", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onDeActivate", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "SpriteMultitouchJoystick::IsInGameEdition" - }, - "parameters": [ - "", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HasGameJustResumed" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Manage touches", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HasAnyTouchOrMouseStarted" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TouchIndex", - "=", - "0" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "StartedTouchOrMouseCount()", - "conditions": [], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TouchId", - "=", - "0" - ] - }, - { - "type": { - "value": "CollisionPoint" - }, - "parameters": [ - "Object", - "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TouchId", - "=", - "StartedTouchOrMouseId(TouchIndex)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TouchIndex", - "+", - "1" - ] - } - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Move thumb back to center when not being pressed (acts like a spring on a real controller)" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HasTouchEnded" - }, - "parameters": [ - "", - "TouchId" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Update joystick position", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TouchId", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickAngle" - }, - "parameters": [ - "Object", - "Behavior", - "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(TouchId, Object.Layer(), 0), TouchY(TouchId, Object.Layer(), 0))", - "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(TouchId, Object.Layer(), 0), TouchY(TouchId, Object.Layer(), 0))" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickForce" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "clamp(2 * DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(TouchId, Object.Layer(), 0), TouchY(TouchId, Object.Layer(), 0)) / Object.Width(), 0, 1)", - "" - ] - } - ] - } - ], - "parameters": [] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the joystick force (from 0 to 1).", - "fullName": "Joystick force", - "functionType": "ExpressionAndCondition", - "name": "JoystickForce", - "sentence": "the joystick force", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "max(0, JoystickForce - DeadZoneRadius) / (1 - DeadZoneRadius)" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "JoystickForce", - "name": "SetJoystickForce", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "JoystickForce", - "=", - "Value" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SetJoystickForce" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "JoystickForce", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - }, - { - "description": "", - "name": "Parameter", - "type": "objectList" - } - ], - "objectGroups": [] - }, - { - "description": "Return the angle the joystick is pointing towards (Range: -180 to 180).", - "fullName": "Joystick angle", - "functionType": "Expression", - "name": "JoystickAngle", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "JoystickAngle" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Change the angle the joystick is pointing towards (Range: -180 to 180).", - "fullName": "Joystick angle", - "functionType": "Action", - "name": "SetJoystickAngle", - "private": true, - "sentence": "Change the joystick angle of _PARAM0_ to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "JoystickAngle", - "=", - "Value" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SetJoystickAngle" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "JoystickAngle", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - }, - { - "description": "Angle", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Return the stick force on X axis (from -1 at the left to 1 at the right).", - "fullName": "Stick X force", - "functionType": "Expression", - "name": "StickForceX", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::JoystickForce() * cos(ToRad(Object.Behavior::JoystickAngle()))" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Return the stick force on Y axis (from -1 at the top to 1 at the bottom).", - "fullName": "Stick Y force", - "functionType": "Expression", - "name": "StickForceY", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::JoystickForce() * sin(ToRad(Object.Behavior::JoystickAngle()))" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if joystick is pushed in a given direction.", - "fullName": "Joystick pushed in a direction (4-way movement)", - "functionType": "Condition", - "name": "IsDirectionPushed4Way", - "sentence": "_PARAM0_ is pushed in direction _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "0", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::IsAngleIn4WayDirection" - }, - "parameters": [ - "", - "JoystickAngle", - "Direction", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - }, - { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Check if joystick is pushed in a given direction.", - "fullName": "Joystick pushed in a direction (8-way movement)", - "functionType": "Condition", - "name": "IsDirectionPushed8Way", - "sentence": "_PARAM0_ is pushed in direction _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "0", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::IsAngleIn8WayDirection" - }, - "parameters": [ - "", - "JoystickAngle", - "Direction", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - }, - { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Check if a joystick is pressed.", - "fullName": "Joystick pressed", - "functionType": "Condition", - "name": "IsPressed", - "sentence": "Joystick _PARAM0_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TouchId", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Reset the joystick values (except for angle, which stays the same)", - "fullName": "Reset", - "functionType": "Action", - "name": "Reset", - "private": true, - "sentence": "Reset the joystick of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickForce" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0", - "" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TouchId", - "=", - "0" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the multitouch controller identifier.", - "fullName": "Multitouch controller identifier", - "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "ControllerIdentifier", - "sentence": "the multitouch controller identifier", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "ControllerIdentifier" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "ControllerIdentifier", - "name": "SetControllerIdentifier", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "ControllerIdentifier", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the joystick name.", - "fullName": "Joystick name", - "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "JoystickIdentifier", - "sentence": "the joystick name", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "JoystickIdentifier" - ] - } - ] - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "JoystickIdentifier", - "name": "SetJoystickIdentifier", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "JoystickIdentifier", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the dead zone radius (range: 0 to 1) of the joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", - "fullName": "Dead zone radius", - "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "DeadZoneRadius", - "sentence": "the dead zone radius", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "DeadZoneRadius" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "DeadZoneRadius", - "name": "SetDeadZoneRadius", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "DeadZoneRadius", - "=", - "Value" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SetDeadZone" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "Value", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Force the joystick into the pressing state.", - "fullName": "Force start pressing", - "functionType": "Action", - "name": "ForceStartPressing", - "sentence": "Force start pressing _PARAM0_ with touch identifier: _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TouchId", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - }, - { - "description": "Touch identifier", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "1", - "type": "Number", - "label": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier" - }, - { - "value": "Primary", - "type": "String", - "label": "Joystick name", - "name": "JoystickIdentifier" - }, - { - "value": "0.4", - "type": "Number", - "label": "Dead zone radius (range: 0 to 1)", - "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", - "name": "DeadZoneRadius" - }, - { - "value": "0", - "type": "Number", - "label": "Joystick angle (range: -180 to 180)", - "hidden": true, - "name": "JoystickAngle" - }, - { - "value": "0", - "type": "Number", - "label": "Joystick force (range: 0 to 1)", - "hidden": true, - "name": "JoystickForce" - }, - { - "value": "0", - "type": "Number", - "label": "", - "hidden": true, - "name": "TouchId" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "TouchIndex" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Detect presses made on a touchscreen on the object so it acts like a button and automatically trigger the button having the same identifier for the mapper behaviors.", - "fullName": "Multitouch button", - "name": "MultitouchButton", - "objectType": "", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsReleased", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsReleased", - "False", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" - }, - "parameters": [ - "Object", - "Behavior", - "\"Idle\"", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsJustPressed", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsJustPressed", - "False", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" - }, - "parameters": [ - "Object", - "Behavior", - "\"Pressed\"", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "HasAnyTouchOrMouseStarted" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TouchIndex", - "=", - "0" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "StartedTouchOrMouseCount()", - "conditions": [], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "CollisionPoint" - }, - "parameters": [ - "Object", - "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer())", - "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer())" - ] - }, - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "Radius", - ">", - "DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer()), TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer()))" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TouchId", - "=", - "StartedTouchOrMouseId(TouchIndex)" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" - }, - "parameters": [ - "Object", - "Behavior", - "\"JustPressed\"", - "" - ] - }, - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsJustPressed", - "True", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TouchIndex", - "+", - "1" - ] - } - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "HasTouchEnded" - }, - "parameters": [ - "", - "TouchId" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" - }, - "parameters": [ - "Object", - "Behavior", - "\"Released\"", - "" - ] - }, - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsReleased", - "True", - "" - ] - }, - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsJustPressed", - "False", - "" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TouchId", - "=", - "0" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the button was just pressed.", - "fullName": "Button just pressed", - "functionType": "Condition", - "name": "IsJustPressed", - "sentence": "Button _PARAM0_ was just pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsJustPressed", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the button is pressed.", - "fullName": "Button pressed", - "functionType": "Condition", - "name": "IsPressed", - "sentence": "Button _PARAM0_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TouchId", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the button is released.", - "fullName": "Button released", - "functionType": "Condition", - "name": "IsReleased", - "sentence": "Button _PARAM0_ is released", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsReleased", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "Button state", - "functionType": "Action", - "name": "SetButtonState", - "private": true, - "sentence": "Mark the button _PARAM0_ as _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::SetButtonState" - }, - "parameters": [ - "", - "ControllerIdentifier", - "ButtonIdentifier", - "ButtonState", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", - "type": "behavior" - }, - { - "description": "Button state", - "name": "ButtonState", - "supplementaryInformation": "[\"Idle\",\"JustPressed\",\"Pressed\",\"Released\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "1", - "type": "Number", - "label": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier" - }, - { - "value": "A", - "type": "String", - "label": "Button identifier", - "name": "ButtonIdentifier" - }, - { - "value": "0", - "type": "Number", - "label": "TouchID", - "hidden": true, - "name": "TouchId" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "TouchIndex" - }, - { - "value": "", - "type": "Boolean", - "label": "Button released", - "hidden": true, - "name": "IsReleased" - }, - { - "value": "", - "type": "Boolean", - "label": "Button just pressed", - "hidden": true, - "name": "IsJustPressed" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Triggering circle radius", - "description": "This circle adds up to the object collision mask.", - "name": "Radius" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Control a platformer character with a multitouch controller.", - "fullName": "Platformer multitouch controller mapper", - "name": "PlatformerMultitouchMapper", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "Property" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "Property" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "Property" - ] - }, - { - "type": { - "value": "PlatformBehavior::SimulateLadderKey" - }, - "parameters": [ - "Object", - "Property" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "Property" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsButtonPressed" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JumpButton", - "\"Down\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "Property" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::PlatformerMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "Platform character behavior", - "extraInformation": [ - "PlatformBehavior::PlatformerObjectBehavior" - ], - "choices": [], - "name": "Property" - }, - { - "value": "1", - "type": "Number", - "label": "Controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier" - }, - { - "value": "Primary", - "type": "Choice", - "label": "Joystick name", - "group": "Controls", - "choices": [ - { - "label": "Primary", - "value": "Primary" - }, - { - "label": "Secondary", - "value": "Secondary" - } - ], - "name": "JoystickIdentifier" - }, - { - "value": "A", - "type": "String", - "label": "Jump button name", - "group": "Controls", - "name": "JumpButton" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Control a 3D physics character with a multitouch controller.", - "fullName": "3D platformer multitouch controller mapper", - "name": "Platformer3DMultitouchMapper", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::StickForce" - }, - "parameters": [ - "", - ">", - "0", - "ControllerIdentifier", - "JoystickIdentifier", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SetForwardAngle" - }, - "parameters": [ - "Object", - "PhysicsCharacter3D", - "=", - "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier) + CameraAngle(Object.Layer())" - ] - }, - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SimulateStick" - }, - "parameters": [ - "Object", - "PhysicsCharacter3D", - "-90", - "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsButtonPressed" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JumpButton", - "\"Down\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PhysicsCharacter3D" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::Platformer3DMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "3D physics character", - "extraInformation": [ - "Physics3D::PhysicsCharacter3D" - ], - "choices": [], - "name": "PhysicsCharacter3D" - }, - { - "value": "1", - "type": "Number", - "label": "Controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier" - }, - { - "value": "Primary", - "type": "Choice", - "label": "Walk joystick", - "group": "Controls", - "choices": [ - { - "label": "Primary", - "value": "Primary" - }, - { - "label": "Secondary", - "value": "Secondary" - } - ], - "name": "JoystickIdentifier" - }, - { - "value": "A", - "type": "String", - "label": "Jump button name", - "group": "Controls", - "name": "JumpButton" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Control a 3D physics character with a multitouch controller.", - "fullName": "3D shooter multitouch controller mapper", - "name": "Shooter3DMultitouchMapper", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::StickForce" - }, - "parameters": [ - "", - ">", - "0", - "ControllerIdentifier", - "JoystickIdentifier", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SimulateStick" - }, - "parameters": [ - "Object", - "PhysicsCharacter3D", - "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", - "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsButtonPressed" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JumpButton", - "\"Down\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PhysicsCharacter3D" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::Shooter3DMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "3D physics character", - "extraInformation": [ - "Physics3D::PhysicsCharacter3D" - ], - "choices": [], - "name": "PhysicsCharacter3D" - }, - { - "value": "1", - "type": "Number", - "label": "Controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier" - }, - { - "value": "Primary", - "type": "Choice", - "label": "Walk joystick", - "group": "Controls", - "choices": [ - { - "label": "Primary", - "value": "Primary" - }, - { - "label": "Secondary", - "value": "Secondary" - } - ], - "name": "JoystickIdentifier" - }, - { - "value": "A", - "type": "String", - "label": "Jump button name", - "group": "Controls", - "name": "JumpButton" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Control camera rotations with a multitouch controller.", - "fullName": "First person camera multitouch controller mapper", - "name": "FirstPersonMultitouchMapper", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "TODO It's probably a bad idea to rotate the object around Y." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "CurrentRotationSpeedZ", - "=", - "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedZ, SpriteMultitouchJoystick::StickForceX(ControllerIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" - ] - }, - { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "Object", - "+", - "CurrentRotationSpeedZ * TimeDelta()" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "CurrentRotationSpeedY", - "=", - "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedY, SpriteMultitouchJoystick::StickForceY(ControllerIdentifier, CameraStick) * VerticalRotationSpeedMax, VerticalRotationSpeedMax, VerticalRotationAcceleration, VerticalRotationDeceleration)" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetRotationY" - }, - "parameters": [ - "Object", - "Object3D", - "+", - "CurrentRotationSpeedY * TimeDelta()" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetRotationY" - }, - "parameters": [ - "Object", - "Object3D", - "=", - "clamp(Object.Object3D::RotationY(), VerticalAngleMin, VerticalAngleMax)" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::LookFromObjectEyes" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Move the camera to look though _PARAM1_ eyes. The object must look to the right when all its angles are 0 and the top of its head be toward Z+.", - "fullName": "Look through object eyes", - "functionType": "Action", - "group": "Layers and cameras", - "name": "LookFromObjectEyes", - "private": true, - "sentence": "Move the camera to look though _PARAM0_ eyes", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "CentreCamera" - }, - "parameters": [ - "", - "Object", - "", - "Object.Layer()", - "" - ] - }, - { - "type": { - "value": "Scene3D::SetCameraZ" - }, - "parameters": [ - "", - "=", - "Object.Object3D::Z() + Object.Object3D::Depth() + OffsetZ", - "", - "" - ] - }, - { - "type": { - "value": "Scene3D::SetCameraRotationX" - }, - "parameters": [ - "", - "=", - "- Object.Object3D::RotationY() + 90", - "GetArgumentAsString(\"Layer\")", - "" - ] - }, - { - "type": { - "value": "Scene3D::SetCameraRotationY" - }, - "parameters": [ - "", - "=", - "Object.Object3D::RotationX()", - "GetArgumentAsString(\"Layer\")", - "" - ] - }, - { - "type": { - "value": "SetCameraAngle" - }, - "parameters": [ - "", - "=", - "Object.Angle() + 90", - "Object.Layer()", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the maximum horizontal rotation speed of the object.", - "fullName": "Maximum horizontal rotation speed", - "functionType": "ExpressionAndCondition", - "group": "First person camera multitouch controller mapper horizontal rotation configuration", - "name": "HorizontalRotationSpeedMax", - "sentence": "the maximum horizontal rotation speed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "HorizontalRotationSpeedMax" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "HorizontalRotationSpeedMax", - "name": "SetHorizontalRotationSpeedMax", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "HorizontalRotationSpeedMax", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the horizontal rotation acceleration of the object.", - "fullName": "Horizontal rotation acceleration", - "functionType": "ExpressionAndCondition", - "group": "First person camera multitouch controller mapper horizontal rotation configuration", - "name": "HorizontalRotationAcceleration", - "sentence": "the horizontal rotation acceleration", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "HorizontalRotationAcceleration" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "HorizontalRotationAcceleration", - "name": "SetHorizontalRotationAcceleration", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "HorizontalRotationAcceleration", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the horizontal rotation deceleration of the object.", - "fullName": "Horizontal rotation deceleration", - "functionType": "ExpressionAndCondition", - "group": "First person camera multitouch controller mapper horizontal rotation configuration", - "name": "HorizontalRotationDeceleration", - "sentence": "the horizontal rotation deceleration", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "HorizontalRotationDeceleration" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "HorizontalRotationDeceleration", - "name": "SetHorizontalRotationDeceleration", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "HorizontalRotationDeceleration", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the maximum vertical rotation speed of the object.", - "fullName": "Maximum vertical rotation speed", - "functionType": "ExpressionAndCondition", - "group": "First person camera multitouch controller mapper vertical rotation configuration", - "name": "VerticalRotationSpeedMax", - "sentence": "the maximum vertical rotation speed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "VerticalRotationSpeedMax" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "VerticalRotationSpeedMax", - "name": "SetVerticalRotationSpeedMax", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "VerticalRotationSpeedMax", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the vertical rotation acceleration of the object.", - "fullName": "Vertical rotation acceleration", - "functionType": "ExpressionAndCondition", - "group": "First person camera multitouch controller mapper vertical rotation configuration", - "name": "VerticalRotationAcceleration", - "sentence": "the vertical rotation acceleration", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "VerticalRotationAcceleration" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "VerticalRotationAcceleration", - "name": "SetVerticalRotationAcceleration", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "VerticalRotationAcceleration", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the vertical rotation deceleration of the object.", - "fullName": "Vertical rotation deceleration", - "functionType": "ExpressionAndCondition", - "group": "First person camera multitouch controller mapper vertical rotation configuration", - "name": "VerticalRotationDeceleration", - "sentence": "the vertical rotation deceleration", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "VerticalRotationDeceleration" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "VerticalRotationDeceleration", - "name": "SetVerticalRotationDeceleration", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "VerticalRotationDeceleration", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the minimum vertical camera angle of the object.", - "fullName": "Minimum vertical camera angle", - "functionType": "ExpressionAndCondition", - "group": "First person camera multitouch controller mapper vertical rotation configuration", - "name": "VerticalAngleMin", - "sentence": "the minimum vertical camera angle", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "VerticalAngleMin" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "VerticalAngleMin", - "name": "SetVerticalAngleMin", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "VerticalAngleMin", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the maximum vertical camera angle of the object.", - "fullName": "Maximum vertical camera angle", - "functionType": "ExpressionAndCondition", - "group": "First person camera multitouch controller mapper vertical rotation configuration", - "name": "VerticalAngleMax", - "sentence": "the maximum vertical camera angle", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "VerticalAngleMax" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "VerticalAngleMax", - "name": "SetVerticalAngleMax", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "VerticalAngleMax", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the z position offset of the object.", - "fullName": "Z position offset", - "functionType": "ExpressionAndCondition", - "group": "First person camera multitouch controller mapper position configuration", - "name": "OffsetZ", - "sentence": "the z position offset", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "OffsetZ" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "OffsetZ", - "name": "SetOffsetZ", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "OffsetZ", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "3D capability", - "extraInformation": [ - "Scene3D::Base3DBehavior" - ], - "choices": [], - "name": "Object3D" - }, - { - "value": "1", - "type": "Number", - "label": "Controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier" - }, - { - "value": "Secondary", - "type": "Choice", - "label": "Camera joystick", - "group": "Controls", - "choices": [ - { - "label": "Primary", - "value": "Primary" - }, - { - "label": "Secondary", - "value": "Secondary" - } - ], - "name": "CameraStick" - }, - { - "value": "180", - "type": "Number", - "unit": "AngularSpeed", - "label": "Maximum rotation speed", - "group": "Horizontal rotation", - "name": "HorizontalRotationSpeedMax" - }, - { - "value": "360", - "type": "Number", - "label": "Rotation acceleration", - "group": "Horizontal rotation", - "name": "HorizontalRotationAcceleration" - }, - { - "value": "720", - "type": "Number", - "label": "Rotation deceleration", - "group": "Horizontal rotation", - "name": "HorizontalRotationDeceleration" - }, - { - "value": "120", - "type": "Number", - "unit": "AngularSpeed", - "label": "Maximum rotation speed", - "group": "Vertical rotation", - "name": "VerticalRotationSpeedMax" - }, - { - "value": "240", - "type": "Number", - "label": "Rotation acceleration", - "group": "Vertical rotation", - "name": "VerticalRotationAcceleration" - }, - { - "value": "480", - "type": "Number", - "label": "Rotation deceleration", - "group": "Vertical rotation", - "name": "VerticalRotationDeceleration" - }, - { - "value": "-90", - "type": "Number", - "unit": "DegreeAngle", - "label": "Minimum angle", - "group": "Vertical rotation", - "name": "VerticalAngleMin" - }, - { - "value": "90", - "type": "Number", - "unit": "DegreeAngle", - "label": "Maximum angle", - "group": "Vertical rotation", - "name": "VerticalAngleMax" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Z position offset", - "group": "Position", - "name": "OffsetZ" - }, - { - "value": "0", - "type": "Number", - "unit": "AngularSpeed", - "label": "Current rotation speed Z", - "hidden": true, - "name": "CurrentRotationSpeedZ" - }, - { - "value": "0", - "type": "Number", - "unit": "AngularSpeed", - "label": "Current rotation speed Y", - "hidden": true, - "name": "CurrentRotationSpeedY" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Control a 3D physics car with a multitouch controller.", - "fullName": "3D car multitouch controller mapper", - "name": "PhysicsCar3DMultitouchMapper", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::StickForce" - }, - "parameters": [ - "", - ">", - "0", - "ControllerIdentifier", - "SteerJoystickIdentifier", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCar3D::SimulateSteeringStick" - }, - "parameters": [ - "Object", - "PhysicsCar3D", - "SpriteMultitouchJoystick::StickForceX(ControllerIdentifier, \"Primary\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::StickForce" - }, - "parameters": [ - "", - ">", - "0", - "ControllerIdentifier", - "SpeedJoystickIdentifier", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCar3D::SimulateAcceleratorStick" - }, - "parameters": [ - "Object", - "PhysicsCar3D", - "-SpriteMultitouchJoystick::StickForceY(ControllerIdentifier, \"Secondary\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsButtonPressed" - }, - "parameters": [ - "", - "ControllerIdentifier", - "HandBrakeButton", - "\"Down\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCar3D::SimulateHandBrakeKey" - }, - "parameters": [ - "Object", - "PhysicsCar3D" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::PhysicsCar3DMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "3D physics car", - "extraInformation": [ - "Physics3D::PhysicsCar3D" - ], - "choices": [], - "name": "PhysicsCar3D" - }, - { - "value": "1", - "type": "Number", - "label": "Controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier" - }, - { - "value": "Primary", - "type": "Choice", - "label": "Steer joystick", - "group": "Controls", - "choices": [ - { - "label": "Primary", - "value": "Primary" - }, - { - "label": "Secondary", - "value": "Secondary" - } - ], - "name": "SteerJoystickIdentifier" - }, - { - "value": "Secondary", - "type": "Choice", - "label": "Speed joystick", - "group": "Controls", - "choices": [ - { - "label": "Primary", - "value": "Primary" - }, - { - "label": "Secondary", - "value": "Secondary" - } - ], - "name": "SpeedJoystickIdentifier" - }, - { - "value": "B", - "type": "String", - "label": "Hand brake button name", - "group": "Controls", - "name": "HandBrakeButton" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Control a top-down character with a multitouch controller.", - "fullName": "Top-down multitouch controller mapper", - "name": "TopDownMultitouchMapper", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "StickMode", - "=", - "\"Analog\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", - "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "StickMode", - "=", - "\"360°\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", - "sign(SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "StickMode", - "=", - "\"8 Directions\"" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "TopDownMovementBehavior::DiagonalsAllowed" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "TopDownMovementBehavior::DiagonalsAllowed" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"UpLeft\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"UpRight\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"DownLeft\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"DownRight\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "Top-down movement behavior", - "extraInformation": [ - "TopDownMovementBehavior::TopDownMovementBehavior" - ], - "choices": [], - "name": "TopDownMovement" - }, - { - "value": "1", - "type": "Number", - "label": "Controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier" - }, - { - "value": "Primary", - "type": "Choice", - "label": "Joystick name", - "choices": [ - { - "label": "Primary", - "value": "Primary" - }, - { - "label": "Secondary", - "value": "Secondary" - } - ], - "name": "JoystickIdentifier" - }, - { - "value": "Analog", - "type": "Choice", - "label": "Stick mode", - "group": "Controls", - "choices": [ - { - "label": "Analog", - "value": "Analog" - }, - { - "label": "360°", - "value": "360°" - }, - { - "label": "8 Directions", - "value": "8 Directions" - } - ], - "name": "StickMode" - } - ], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [ - { - "areaMaxX": 64, - "areaMaxY": 64, - "areaMaxZ": 64, - "areaMinX": 0, - "areaMinY": 0, - "areaMinZ": 0, - "defaultName": "Joystick", - "description": "Joystick for touchscreens.", - "fullName": "Multitouch Joystick", - "isUsingLegacyInstancesRenderer": true, - "name": "SpriteMultitouchJoystick", - "objects": [ - { - "adaptCollisionMaskAutomatically": false, - "assetStoreId": "", - "name": "Thumb", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [], - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [] - } - ] - } - ] - }, - { - "adaptCollisionMaskAutomatically": false, - "assetStoreId": "", - "name": "Border", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "MultitouchJoystick", - "type": "SpriteMultitouchJoystick::MultitouchJoystick", - "ControllerIdentifier": 1, - "JoystickIdentifier": "Primary", - "FloatingEnabled": false, - "DeadZoneRadius": 0.4, - "JoystickAngle": 0, - "JoystickForce": 0, - "TouchId": 0, - "TouchIndex": 0 - } - ], - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [] - } - ] - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Thumb" - }, - { - "objectName": "Border" - } - ] - }, - "objectsGroups": [], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [], - "editionSettings": {}, - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "Border", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "Thumb", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Border", - "=", - "1" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Thumb", - "=", - "2" - ] - }, - { - "type": { - "value": "SetCenter" - }, - "parameters": [ - "Border", - "=", - "0", - "=", - "0" - ] - }, - { - "type": { - "value": "SetCenter" - }, - "parameters": [ - "Thumb", - "=", - "0", - "=", - "0" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" - }, - "parameters": [ - "Object", - "" - ] - }, - { - "type": { - "value": "SetIncludedInParentCollisionMask" - }, - "parameters": [ - "Thumb", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "SpriteMultitouchJoystick::IsInGameEdition" - }, - "parameters": [ - "", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "MettreAutour" - }, - "parameters": [ - "Thumb", - "Border", - "Border.MultitouchJoystick::JoystickForce() * Border.Width() / 2", - "Border.MultitouchJoystick::JoystickAngle()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "ShouldBeHiddenWhenReleased", - "True", - "" - ] - }, - { - "type": { - "inverted": true, - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" - }, - "parameters": [ - "Object", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Object" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" - }, - "parameters": [ - "Object", - "no", - "" - ] - }, - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "ShouldBeHiddenWhenReleased", - "False", - "" - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onHotReloading", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" - }, - "parameters": [ - "Object", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Pass the object property values to the behavior.", - "fullName": "Update configuration", - "functionType": "Action", - "name": "UpdateConfiguration", - "private": true, - "sentence": "Update the configuration of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "=", - "ControllerIdentifier", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "=", - "JoystickIdentifier", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "=", - "DeadZoneRadius", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Show the joystick until it is released.", - "fullName": "Show and start pressing", - "functionType": "Action", - "name": "TeleportAndPress", - "sentence": "Show _PARAM0_ at the cursor position and start pressing", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HasAnyTouchOrMouseStarted" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "MettreXY" - }, - "parameters": [ - "Object", - "=", - "Object.ParentTouchX(StartedTouchOrMouseId(0))", - "=", - "Object.ParentTouchY(StartedTouchOrMouseId(0))" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" - }, - "parameters": [ - "Object", - "yes", - "" - ] - }, - { - "type": { - "value": "Montre" - }, - "parameters": [ - "Object", - "" - ] - }, - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "ShouldBeHiddenWhenReleased", - "True", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::ForceStartPressing" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "StartedTouchOrMouseId(0)", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Return the X position of a specified touch", - "fullName": "Touch X position (on parent)", - "functionType": "Expression", - "name": "ParentTouchX", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] - }, - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];", - "const touchId = eventsFunctionContext.getArgument(\"TouchId\");", - "eventsFunctionContext.returnValue = gdjs.evtTools.input.getTouchX(object.getInstanceContainer(), touchId, object.getLayer());" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - }, - { - "description": "Touch identifier", - "name": "TouchId", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Return the X position of a specified touch", - "fullName": "Touch X position (on parent)", - "functionType": "Expression", - "name": "ParentTouchY", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] - }, - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];", - "const touchId = eventsFunctionContext.getArgument(\"TouchId\");", - "eventsFunctionContext.returnValue = gdjs.evtTools.input.getTouchY(object.getInstanceContainer(), touchId, object.getLayer());" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - }, - { - "description": "Touch identifier", - "name": "TouchId", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "De/activate control of the joystick.", - "fullName": "De/activate control", - "functionType": "Action", - "name": "ActivateControl", - "sentence": "Activate control of _PARAM0_: _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "ShouldActivate", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "no" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "ShouldActivate", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "yes" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - }, - { - "description": "Activate", - "name": "ShouldActivate", - "type": "yesorno" - } - ], - "objectGroups": [] - }, - { - "description": "Check if a stick is pressed.", - "fullName": "Stick pressed", - "functionType": "Condition", - "name": "IsPressed", - "sentence": "Stick _PARAM0_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsPressed" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "!=" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the joystick force (from 0 to 1).", - "fullName": "Joystick force (deprecated)", - "functionType": "ExpressionAndCondition", - "name": "JoystickForce", - "private": true, - "sentence": "the joystick force", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Border.MultitouchJoystick::JoystickForce()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the strick force (from 0 to 1).", - "fullName": "Stick force", - "functionType": "ExpressionAndCondition", - "name": "StickForce", - "sentence": "the stick force", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Border.MultitouchJoystick::JoystickForce()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the stick force on X axis (from -1 at the left to 1 at the right).", - "fullName": "Stick X force", - "functionType": "ExpressionAndCondition", - "name": "StickForceX", - "sentence": "the stick X force", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Border.MultitouchJoystick::StickForceX()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the stick force on Y axis (from -1 at the top to 1 at the bottom).", - "fullName": "Stick Y force", - "functionType": "ExpressionAndCondition", - "name": "StickForceY", - "sentence": "the stick Y force", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Border.MultitouchJoystick::StickForceY()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Return the angle the joystick is pointing towards (from -180 to 180).", - "fullName": "Joystick angle (deprecated)", - "functionType": "Expression", - "name": "JoystickAngle", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Border.MultitouchJoystick::JoystickAngle()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Return the angle the stick is pointing towards (from -180 to 180).", - "fullName": "Stick angle", - "functionType": "Expression", - "name": "StickAngle", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Border.MultitouchJoystick::JoystickAngle()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check if joystick is pushed in a given direction.", - "fullName": "Joystick pushed in a direction (4-way movement)", - "functionType": "Condition", - "name": "IsDirectionPushed4Way", - "sentence": "_PARAM0_ is pushed in direction _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "Direction", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - }, - { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Check if joystick is pushed in a given direction.", - "fullName": "Joystick pushed in a direction (8-way movement)", - "functionType": "Condition", - "name": "IsDirectionPushed8Way", - "sentence": "_PARAM0_ is pushed in direction _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "Direction", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - }, - { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "the multitouch controller identifier (1, 2, 3, 4...).", - "fullName": "Multitouch controller identifier", - "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "ControllerIdentifier", - "sentence": "the multitouch controller identifier", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Border.MultitouchJoystick::PropertyControllerIdentifier()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "ControllerIdentifier", - "name": "SetControllerIdentifier", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "=", - "Value", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the joystick name of the object.", - "fullName": "Joystick name", - "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "JoystickIdentifier", - "sentence": "the joystick name", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "Border.MultitouchJoystick::PropertyJoystickIdentifier()" - ] - } - ] - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "JoystickIdentifier", - "name": "SetJoystickIdentifier", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "=", - "Value", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the dead zone radius of the joystick (range: 0 to 1). The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", - "fullName": "Dead zone radius", - "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "DeadZoneRadius", - "sentence": "the dead zone radius", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Border.MultitouchJoystick::PropertyDeadZoneRadius()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "DeadZoneRadius", - "name": "SetDeadZoneRadius", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "=", - "Value", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "1", - "type": "Number", - "label": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier" - }, - { - "value": "Primary", - "type": "Choice", - "label": "Joystick name", - "choices": [ - { - "label": "Primary", - "value": "Primary" - }, - { - "label": "Secondary", - "value": "Secondary" - } - ], - "name": "JoystickIdentifier" - }, - { - "value": "0.4", - "type": "Number", - "label": "Dead zone radius (range: 0 to 1)", - "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", - "name": "DeadZoneRadius" - }, - { - "value": "Center-center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "extraInformation": [ - "Thumb" - ], - "choices": [], - "hidden": true, - "name": "ThumbAnchorOrigin" - }, - { - "value": "Center-center", - "type": "Number", - "label": "", - "description": "Only used by the scene editor.", - "hidden": true, - "name": "ThumbAnchorTarget" - }, - { - "value": "true", - "type": "Boolean", - "label": "", - "description": "Only used by the scene editor.", - "extraInformation": [ - "Thumb" - ], - "choices": [], - "hidden": true, - "name": "ThumbIsScaledProportionally" - }, - { - "value": "Center-center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "hidden": true, - "name": "ParentOrigin" - }, - { - "value": "", - "type": "Boolean", - "label": "", - "hidden": true, - "name": "ShouldBeHiddenWhenReleased" - } - ], - "variants": [] - } - ] - }, - { - "author": "", - "category": "Input", - "extensionNamespace": "", - "fullName": "3D car keyboard mapper", - "gdevelopVersion": ">=5.5.222", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggZD0iTTI5LDE0aC00LjJjMC4xLTAuMywwLjItMC42LDAuMi0xYzAtMS43LTEuMy0zLTMtM0g4Yy0wLjYsMC0xLTAuNC0xLTFzMC40LTEsMS0xaDZjMS43LDAsMy0xLjMsMy0zVjJjMC0wLjYtMC40LTEtMS0xDQoJcy0xLDAuNC0xLDF2M2MwLDAuNi0wLjQsMS0xLDFIOEM2LjMsNiw1LDcuMyw1LDlzMS4zLDMsMywzaDE0YzAuNiwwLDEsMC40LDEsMXMtMC40LDEtMSwxSDNjLTAuNiwwLTEsMC40LTEsMXYxNGMwLDAuNiwwLjQsMSwxLDENCgloMjZjMC42LDAsMS0wLjQsMS0xVjE1QzMwLDE0LjQsMjkuNiwxNCwyOSwxNHogTTcsMThoMmMwLjYsMCwxLDAuNCwxLDFjMC0wLjYsMC40LTEsMS0xaDJjMC42LDAsMSwwLjQsMSwxYzAtMC42LDAuNC0xLDEtMWgyDQoJYzAuNiwwLDEsMC40LDEsMWMwLTAuNiwwLjQtMSwxLTFoMmMwLjYsMCwxLDAuNCwxLDFjMC0wLjYsMC40LTEsMS0xaDJjMC42LDAsMSwwLjQsMSwxcy0wLjQsMS0xLDFoLTJjLTAuNiwwLTEtMC40LTEtMQ0KCWMwLDAuNi0wLjQsMS0xLDFoLTJjLTAuNiwwLTEtMC40LTEtMWMwLDAuNi0wLjQsMS0xLDFoLTJjLTAuNiwwLTEtMC40LTEtMWMwLDAuNi0wLjQsMS0xLDFoLTJjLTAuNiwwLTEtMC40LTEtMWMwLDAuNi0wLjQsMS0xLDFINw0KCWMtMC42LDAtMS0wLjQtMS0xUzYuNCwxOCw3LDE4eiBNMTksMjJjMCwwLjEsMCwwLjMtMC4xLDAuNHMtMC4xLDAuMi0wLjIsMC4zYzAsMC0wLjEsMC4xLTAuMiwwLjFjMCwwLTAuMSwwLjEtMC4yLDAuMQ0KCWMtMC4xLDAtMC4xLDAtMC4yLDAuMWMtMC4xLDAtMC4xLDAtMC4yLDBjLTAuMSwwLTAuMSwwLTAuMiwwYy0wLjEsMC0wLjEsMC0wLjItMC4xYy0wLjEsMC0wLjEtMC4xLTAuMi0wLjFjMCwwLTAuMS0wLjEtMC4xLTAuMQ0KCWMtMC4xLTAuMS0wLjItMC4yLTAuMi0wLjNDMTcsMjIuMywxNywyMi4xLDE3LDIyYzAtMC4xLDAtMC4zLDAuMS0wLjRjMC0wLjEsMC4xLTAuMiwwLjItMC4zYzAsMCwwLjEtMC4xLDAuMS0wLjENCgljMC4xLDAsMC4xLTAuMSwwLjItMC4xYzAuMSwwLDAuMSwwLDAuMi0wLjFjMC4xLDAsMC4zLDAsMC40LDBjMC4xLDAsMC4xLDAsMC4yLDAuMWMwLjEsMCwwLjEsMC4xLDAuMiwwLjFjMC4xLDAsMC4xLDAuMSwwLjIsMC4xDQoJYzAuMSwwLjEsMC4yLDAuMiwwLjIsMC4zQzE5LDIxLjcsMTksMjEuOSwxOSwyMnogTTE1LDIyYzAsMC4xLDAsMC4zLTAuMSwwLjRzLTAuMSwwLjItMC4yLDAuM2MwLDAtMC4xLDAuMS0wLjIsMC4xDQoJYzAsMC0wLjEsMC4xLTAuMiwwLjFjLTAuMSwwLTAuMSwwLTAuMiwwLjFjLTAuMSwwLTAuMSwwLTAuMiwwYy0wLjMsMC0wLjUtMC4xLTAuNy0wLjNjLTAuMS0wLjEtMC4yLTAuMi0wLjItMC4zDQoJQzEzLDIyLjMsMTMsMjIuMSwxMywyMmMwLTAuMSwwLTAuMSwwLTAuMmMwLTAuMSwwLTAuMSwwLjEtMC4yYzAtMC4xLDAtMC4xLDAuMS0wLjJjMC0wLjEsMC4xLTAuMSwwLjEtMC4xYzAuMi0wLjIsMC42LTAuMywwLjktMC4zDQoJYzAuMSwwLDAuMSwwLDAuMiwwLjFjMC4xLDAsMC4xLDAuMSwwLjIsMC4xYzAuMSwwLDAuMSwwLjEsMC4yLDAuMWMwLDAsMC4xLDAuMSwwLjEsMC4xYzAsMC4xLDAuMSwwLjEsMC4xLDAuMmMwLDAuMSwwLDAuMSwwLjEsMC4yDQoJQzE1LDIxLjksMTUsMjEuOSwxNSwyMnogTTUsMjJjMC0wLjEsMC0wLjMsMC4xLTAuNGMwLTAuMSwwLjEtMC4yLDAuMi0wLjNjMC4yLTAuMiwwLjYtMC4zLDAuOS0wLjNjMC4xLDAsMC4xLDAsMC4yLDAuMQ0KCWMwLjEsMCwwLjEsMC4xLDAuMiwwLjFjMCwwLDAuMSwwLjEsMC4yLDAuMWMwLjEsMC4xLDAuMiwwLjIsMC4yLDAuM0M3LDIxLjcsNywyMS45LDcsMjJjMCwwLjMtMC4xLDAuNS0wLjMsMC43YzAsMC0wLjEsMC4xLTAuMiwwLjENCgljLTAuMSwwLTAuMSwwLjEtMC4yLDAuMWMtMC4xLDAtMC4xLDAtMC4yLDAuMWMtMC4xLDAtMC4xLDAtMC4yLDBjLTAuMywwLTAuNS0wLjEtMC43LTAuM0M1LjEsMjIuNSw1LDIyLjMsNSwyMnogTTgsMjZINw0KCWMtMC42LDAtMS0wLjQtMS0xczAuNC0xLDEtMWgxYzAuNiwwLDEsMC40LDEsMVM4LjYsMjYsOCwyNnogTTEwLjksMjIuNGMwLDAuMSwwLDAuMS0wLjEsMC4yYzAsMC0wLjEsMC4xLTAuMSwwLjENCglDMTAuNSwyMi45LDEwLjMsMjMsMTAsMjNjLTAuMSwwLTAuMywwLTAuNC0wLjFjLTAuMS0wLjEtMC4yLTAuMS0wLjMtMC4yYzAtMC4xLTAuMS0wLjEtMC4xLTAuMWMwLTAuMS0wLjEtMC4xLTAuMS0wLjINCgljMC0wLjEsMC0wLjEtMC4xLTAuMmMwLTAuMSwwLTAuMSwwLTAuMmMwLTAuMywwLjEtMC41LDAuMy0wLjdjMC4xLTAuMSwwLjItMC4yLDAuMy0wLjJjMC40LTAuMiwwLjgtMC4xLDEuMSwwLjINCgljMC4yLDAuMiwwLjMsMC40LDAuMywwLjdjMCwwLjEsMCwwLjEsMCwwLjJDMTEsMjIuMywxMSwyMi4zLDEwLjksMjIuNHogTTIwLDI2aC04Yy0wLjYsMC0xLTAuNC0xLTFzMC40LTEsMS0xaDhjMC42LDAsMSwwLjQsMSwxDQoJUzIwLjYsMjYsMjAsMjZ6IE0yMi45LDIyLjRjMCwwLjEsMCwwLjEtMC4xLDAuMmMwLDAtMC4xLDAuMS0wLjEsMC4xYzAsMC0wLjEsMC4xLTAuMiwwLjFjMCwwLTAuMSwwLjEtMC4yLDAuMWMtMC4xLDAtMC4xLDAtMC4yLDAuMQ0KCWMtMC4xLDAtMC4xLDAtMC4yLDBjLTAuMSwwLTAuMSwwLTAuMiwwYy0wLjEsMC0wLjEsMC0wLjItMC4xYy0wLjEsMC0wLjEtMC4xLTAuMi0wLjFjMCwwLTAuMS0wLjEtMC4xLTAuMWMwLTAuMS0wLjEtMC4xLTAuMS0wLjENCgljMC0wLjEtMC4xLTAuMS0wLjEtMC4yYzAtMC4xLDAtMC4xLTAuMS0wLjJjMC0wLjEsMC0wLjEsMC0wLjJjMC0wLjMsMC4xLTAuNSwwLjMtMC43YzAsMCwwLjEtMC4xLDAuMS0wLjFjMC4xLDAsMC4xLTAuMSwwLjItMC4xDQoJYzAuMSwwLDAuMSwwLDAuMi0wLjFjMC4xLDAsMC4zLDAsMC40LDBjMC4xLDAsMC4xLDAsMC4yLDAuMWMwLjEsMCwwLjEsMC4xLDAuMiwwLjFjMC4xLDAsMC4xLDAuMSwwLjIsMC4xYzAuMiwwLjIsMC4zLDAuNCwwLjMsMC43DQoJYzAsMC4xLDAsMC4xLDAsMC4yQzIzLDIyLjMsMjMsMjIuMywyMi45LDIyLjR6IE0yNSwyNmgtMWMtMC42LDAtMS0wLjQtMS0xczAuNC0xLDEtMWgxYzAuNiwwLDEsMC40LDEsMVMyNS42LDI2LDI1LDI2eiBNMjYuNywyMi43DQoJQzI2LjUsMjIuOSwyNi4zLDIzLDI2LDIzYy0wLjEsMC0wLjEsMC0wLjIsMGMtMC4xLDAtMC4xLDAtMC4yLTAuMWMtMC4xLDAtMC4xLTAuMS0wLjItMC4xYy0wLjEsMC0wLjEtMC4xLTAuMi0wLjENCglDMjUuMSwyMi41LDI1LDIyLjMsMjUsMjJjMC0wLjEsMC0wLjMsMC4xLTAuNGMwLTAuMSwwLjEtMC4yLDAuMi0wLjNjMCwwLDAuMS0wLjEsMC4yLTAuMWMwLDAsMC4xLTAuMSwwLjItMC4xYzAuMSwwLDAuMSwwLDAuMi0wLjENCgljMC4zLTAuMSwwLjcsMCwwLjksMC4zYzAuMiwwLjIsMC4zLDAuNCwwLjMsMC43QzI3LDIyLjMsMjYuOSwyMi41LDI2LjcsMjIuN3oiLz4NCjwvc3ZnPg0K", - "name": "PhysicsCar3DKeyMapper", - "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Computers and Hardware/3e5871434a72821bf3ecb44a6857e62a438cf23dc8f95966f56ae97e95315468_Computers and Hardware_keyboard.svg", - "shortDescription": "3D car keyboard controls.", - "version": "1.0.1", - "description": "3D physics car keyboard controls.", - "origin": { - "identifier": "PhysicsCar3DKeyMapper", - "name": "gdevelop-extension-store" - }, - "tags": [ - "3d" - ], - "authorIds": [ - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [], - "eventsBasedBehaviors": [ - { - "description": "Control a 3D physics car with a keyboard.", - "fullName": "3D car keyboard mapper", - "name": "PhysicsCar3DKeyboardMapper", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "KeyFromTextPressed" - }, - "parameters": [ - "", - "Down" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCar3D::SimulateBackwardKey" - }, - "parameters": [ - "Object", - "PhysicsCar3D" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "KeyFromTextPressed" - }, - "parameters": [ - "", - "Up" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCar3D::SimulateForwardKey" - }, - "parameters": [ - "Object", - "PhysicsCar3D" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "KeyFromTextPressed" - }, - "parameters": [ - "", - "Left" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCar3D::SimulateLeftKey" - }, - "parameters": [ - "Object", - "PhysicsCar3D" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "KeyFromTextPressed" - }, - "parameters": [ - "", - "Right" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCar3D::SimulateRightKey" - }, - "parameters": [ - "Object", - "PhysicsCar3D" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "KeyFromTextPressed" - }, - "parameters": [ - "", - "HandBrake" - ] - } - ], - "actions": [ - { - "type": { - "value": "Physics3D::PhysicsCar3D::SimulateHandBrakeKey" - }, - "parameters": [ - "Object", - "PhysicsCar3D" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PhysicsCar3DKeyMapper::PhysicsCar3DKeyboardMapper", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "3D physics car", - "extraInformation": [ - "Physics3D::PhysicsCar3D" - ], - "choices": [], - "name": "PhysicsCar3D" - }, - { - "value": "Space", - "type": "KeyboardKey", - "label": "Hand brake key", - "name": "HandBrake" - }, - { - "value": "Up", - "type": "KeyboardKey", - "label": "Up key", - "name": "Up" - }, - { - "value": "Left", - "type": "KeyboardKey", - "label": "Left key", - "name": "Left" - }, - { - "value": "Down", - "type": "KeyboardKey", - "label": "Down key", - "name": "Down" - }, - { - "value": "Right", - "type": "KeyboardKey", - "label": "Right key", - "name": "Right" - } - ], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "Visual effect", - "extensionNamespace": "", - "fullName": "3D object shake", - "gdevelopVersion": ">=5.5.222", - "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.1.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": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onFirstSceneLoaded", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ShakeObject3D::DefineHelperClasses" - }, - "parameters": [ - "", - "" - ] - } - ] - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Define helper classes JavaScript code.", - "fullName": "Define helper classes", - "functionType": "Action", - "name": "DefineHelperClasses", - "private": true, - "sentence": "Define helper classes JavaScript code", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "if (gdjs._shakeObjectExtension) {", - " return;", - "}", - "", - "/** Noise generator manager. */", - "class NoiseManager {", - " /**", - " * Create the manager of noise generators.", - " */", - " constructor() {", - " this.seed = gdjs.randomInRange(1, Number.MAX_SAFE_INTEGER);", - " /** @type {Map} */", - " this.generators = new Map();", - " }", - "", - " /**", - " * @param name {string}", - " * @return {NoiseGenerator}", - " */", - " getGenerator(name) {", - " let generator = this.generators.get(name);", - " if (!generator) {", - " generator = new NoiseGenerator(name + this.seed);", - " this.generators.set(name, generator);", - " }", - " return generator;", - " }", - "", - " /**", - " * @param seed {number}", - " */", - " setSeed(seed) {", - " this.seed = seed;", - " this.generators.forEach(generator => generator.setSeed(name + this.seed));", - " }", - "", - " /**", - " * @param name {string}", - " */", - " deleteGenerator(name) {", - " this.generators.delete(name);", - " }", - "", - " /**", - " */", - " deleteAllGenerators() {", - " this.generators.clear();", - " }", - "}", - "", - "/** Noise generator with octaves. */", - "class NoiseGenerator {", - " /**", - " * Create a noise generator with a seed.", - " * @param seed {string}", - " */", - " constructor(seed) {", - " this.simplexNoise = new SimplexNoise(seed);", - " this.frequency = 1;", - " this.octaves = 1;", - " this.persistence = 0.5;", - " this.lacunarity = 2;", - " this.xLoopPeriod = 0;", - " this.yLoopPeriod = 0;", - " }", - "", - " /**", - " * @param seed {string}", - " */", - " setSeed(seed) {", - " this.simplexNoise = new SimplexNoise(seed);", - " }", - "", - " /**", - " * @param x {float}", - " * @param y {float}", - " * @param z {float} optionnal", - " * @param w {float} optionnal", - " * @return {float}", - " */", - " noise(x, y, z, w) {", - " if (this.xLoopPeriod && this.yLoopPeriod) {", - " const circleRatioX = 2 * Math.PI / this.xLoopPeriod;", - " const circleRatioY = 2 * Math.PI / this.yLoopPeriod;", - " const angleX = circleRatioX * x;", - " const angleY = circleRatioY * y;", - " x = Math.cos(angleX) / circleRatioX;", - " y = Math.sin(angleX) / circleRatioX;", - " z = Math.cos(angleY) / circleRatioY;", - " w = Math.sin(angleY) / circleRatioY;", - " }", - " else if (this.xLoopPeriod) {", - " const circleRatio = 2 * Math.PI / this.xLoopPeriod;", - " const angleX = circleRatio * x;", - " w = z;", - " z = y;", - " x = Math.cos(angleX) / circleRatio;", - " y = Math.sin(angleX) / circleRatio;", - " }", - " else if (this.yLoopPeriod) {", - " const circleRatio = 2 * Math.PI / this.xLoopPeriod;", - " const angleX = circleRatio * x;", - " w = z;", - " // Make the circle perimeter equals to the looping period", - " // to keep the same perceived frequency with or without looping.", - " y = Math.cos(angleX) / circleRatio;", - " z = Math.sin(angleX) / circleRatio;", - " }", - " let noiseFunction = this.simplexNoise.noise4D.bind(this.simplexNoise);", - " if (z === undefined) {", - " noiseFunction = this.simplexNoise.noise2D.bind(this.simplexNoise);", - " }", - " else if (w === undefined) {", - " noiseFunction = this.simplexNoise.noise3D.bind(this.simplexNoise);", - " }", - " let frequency = this.frequency;", - " let noiseSum = 0;", - " let amplitudeSum = 0;", - " let amplitude = 1;", - " for (let i = 0; i < this.octaves; i++) {", - " noiseSum += noiseFunction(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;", - " amplitudeSum += Math.abs(amplitude);", - " amplitude *= this.persistence;", - " frequency *= this.lacunarity;", - " }", - " return noiseSum / amplitudeSum;", - " }", - "}", - "", - "/*", - "A fast javascript implementation of simplex noise by Jonas Wagner", - "https://github.com/jwagner/simplex-noise.js", - "", - "Based on a speed-improved simplex noise algorithm for 2D, 3D and 4D in Java.", - "Which is based on example code by Stefan Gustavson (stegu@itn.liu.se).", - "With Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).", - "Better rank ordering method by Stefan Gustavson in 2012.", - "", - " Copyright (c) 2021 Jonas Wagner", - "", - " Permission is hereby granted, free of charge, to any person obtaining a copy", - " of this software and associated documentation files (the \"Software\"), to deal", - " in the Software without restriction, including without limitation the rights", - " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", - " copies of the Software, and to permit persons to whom the Software is", - " furnished to do so, subject to the following conditions:", - "", - " The above copyright notice and this permission notice shall be included in all", - " copies or substantial portions of the Software.", - "", - " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", - " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", - " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", - " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE", - " SOFTWARE.", - " */", - "", - "const F2 = 0.5 * (Math.sqrt(3.0) - 1.0);", - "const G2 = (3.0 - Math.sqrt(3.0)) / 6.0;", - "const F3 = 1.0 / 3.0;", - "const G3 = 1.0 / 6.0;", - "const F4 = (Math.sqrt(5.0) - 1.0) / 4.0;", - "const G4 = (5.0 - Math.sqrt(5.0)) / 20.0;", - "const grad3 = new Float32Array([1, 1, 0,", - " -1, 1, 0,", - " 1, -1, 0,", - " -1, -1, 0,", - " 1, 0, 1,", - " -1, 0, 1,", - " 1, 0, -1,", - " -1, 0, -1,", - " 0, 1, 1,", - " 0, -1, 1,", - " 0, 1, -1,", - " 0, -1, -1]);", - "const grad4 = new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,", - " 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,", - " 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,", - " -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,", - " 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,", - " -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,", - " 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,", - " -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]);", - "", - "", - "/**", - " * Builds a random permutation table.", - " * This is exported only for (internal) testing purposes.", - " * Do not rely on this export.", - " * @param {() => number} random", - " * @private", - " */", - "function buildPermutationTable(random) {", - " const p = new Uint8Array(256);", - " for (let i = 0; i < 256; i++) {", - " p[i] = i;", - " }", - " for (let i = 0; i < 255; i++) {", - " const r = i + ~~(random() * (256 - i));", - " const aux = p[i];", - " p[i] = p[r];", - " p[r] = aux;", - " }", - " return p;", - "}", - "", - "/*", - "The ALEA PRNG and masher code used by simplex-noise.js", - "is based on code by Johannes Baagøe, modified by Jonas Wagner.", - "See alea.md for the full license.", - "@param {string|number} seed", - "*/", - "function alea(seed) {", - " let s0 = 0;", - " let s1 = 0;", - " let s2 = 0;", - " let c = 1;", - " const mash = masher();", - " s0 = mash(' ');", - " s1 = mash(' ');", - " s2 = mash(' ');", - " s0 -= mash(seed);", - " if (s0 < 0) {", - " s0 += 1;", - " }", - " s1 -= mash(seed);", - " if (s1 < 0) {", - " s1 += 1;", - " }", - " s2 -= mash(seed);", - " if (s2 < 0) {", - " s2 += 1;", - " }", - " return function () {", - " const t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32", - " s0 = s1;", - " s1 = s2;", - " return s2 = t - (c = t | 0);", - " };", - "}", - "", - "function masher() {", - " let n = 0xefc8249d;", - " return function (data) {", - " data = data.toString();", - " for (let i = 0; i < data.length; i++) {", - " n += data.charCodeAt(i);", - " let h = 0.02519603282416938 * n;", - " n = h >>> 0;", - " h -= n;", - " h *= n;", - " n = h >>> 0;", - " h -= n;", - " n += h * 0x100000000; // 2^32", - " }", - " return (n >>> 0) * 2.3283064365386963e-10; // 2^-32", - " };", - "}", - "", - "/** Deterministic simplex noise generator suitable for 2D, 3D and 4D spaces. */", - "class SimplexNoise {", - " /**", - " * Creates a new `SimplexNoise` instance.", - " * This involves some setup. You can save a few cpu cycles by reusing the same instance.", - " * @param {(() => number)|string|number} randomOrSeed A random number generator or a seed (string|number).", - " * Defaults to Math.random (random irreproducible initialization).", - " */", - " constructor(randomOrSeed) {", - " if (randomOrSeed === void 0) { randomOrSeed = Math.random; }", - " const random = typeof randomOrSeed == 'function' ? randomOrSeed : alea(randomOrSeed);", - " this.p = buildPermutationTable(random);", - " this.perm = new Uint8Array(512);", - " this.permMod12 = new Uint8Array(512);", - " for (let i = 0; i < 512; i++) {", - " this.perm[i] = this.p[i & 255];", - " this.permMod12[i] = this.perm[i] % 12;", - " }", - " }", - "", - " /**", - " * Samples the noise field in 2 dimensions", - " * @param {number} x", - " * @param {number} y", - " * @returns a number in the interval [-1, 1]", - " */", - " noise2D(x, y) {", - " const permMod12 = this.permMod12;", - " const perm = this.perm;", - " let n0 = 0; // Noise contributions from the three corners", - " let n1 = 0;", - " let n2 = 0;", - " // Skew the input space to determine which simplex cell we're in", - " const s = (x + y) * F2; // Hairy factor for 2D", - " const i = Math.floor(x + s);", - " const j = Math.floor(y + s);", - " const t = (i + j) * G2;", - " const X0 = i - t; // Unskew the cell origin back to (x,y) space", - " const Y0 = j - t;", - " const x0 = x - X0; // The x,y distances from the cell origin", - " const y0 = y - Y0;", - " // For the 2D case, the simplex shape is an equilateral triangle.", - " // Determine which simplex we are in.", - " let i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords", - " if (x0 > y0) {", - " i1 = 1;", - " j1 = 0;", - " } // lower triangle, XY order: (0,0)->(1,0)->(1,1)", - " else {", - " i1 = 0;", - " j1 = 1;", - " } // upper triangle, YX order: (0,0)->(0,1)->(1,1)", - " // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and", - " // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where", - " // c = (3-sqrt(3))/6", - " const x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords", - " const y1 = y0 - j1 + G2;", - " const x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords", - " const y2 = y0 - 1.0 + 2.0 * G2;", - " // Work out the hashed gradient indices of the three simplex corners", - " const ii = i & 255;", - " const jj = j & 255;", - " // Calculate the contribution from the three corners", - " let t0 = 0.5 - x0 * x0 - y0 * y0;", - " if (t0 >= 0) {", - " const gi0 = permMod12[ii + perm[jj]] * 3;", - " t0 *= t0;", - " n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0); // (x,y) of grad3 used for 2D gradient", - " }", - " let t1 = 0.5 - x1 * x1 - y1 * y1;", - " if (t1 >= 0) {", - " const gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;", - " t1 *= t1;", - " n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);", - " }", - " let t2 = 0.5 - x2 * x2 - y2 * y2;", - " if (t2 >= 0) {", - " const gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;", - " t2 *= t2;", - " n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);", - " }", - " // Add contributions from each corner to get the final noise value.", - " // The result is scaled to return values in the interval [-1,1].", - " return 70.0 * (n0 + n1 + n2);", - " }", - "", - " /**", - " * Samples the noise field in 3 dimensions", - " * @param {number} x", - " * @param {number} y", - " * @param {number} z", - " * @returns a number in the interval [-1, 1]", - " */", - " noise3D(x, y, z) {", - " const permMod12 = this.permMod12;", - " const perm = this.perm;", - " let n0, n1, n2, n3; // Noise contributions from the four corners", - " // Skew the input space to determine which simplex cell we're in", - " const s = (x + y + z) * F3; // Very nice and simple skew factor for 3D", - " const i = Math.floor(x + s);", - " const j = Math.floor(y + s);", - " const k = Math.floor(z + s);", - " const t = (i + j + k) * G3;", - " const X0 = i - t; // Unskew the cell origin back to (x,y,z) space", - " const Y0 = j - t;", - " const Z0 = k - t;", - " const x0 = x - X0; // The x,y,z distances from the cell origin", - " const y0 = y - Y0;", - " const z0 = z - Z0;", - " // For the 3D case, the simplex shape is a slightly irregular tetrahedron.", - " // Determine which simplex we are in.", - " let i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords", - " let i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords", - " if (x0 >= y0) {", - " if (y0 >= z0) {", - " i1 = 1;", - " j1 = 0;", - " k1 = 0;", - " i2 = 1;", - " j2 = 1;", - " k2 = 0;", - " } // X Y Z order", - " else if (x0 >= z0) {", - " i1 = 1;", - " j1 = 0;", - " k1 = 0;", - " i2 = 1;", - " j2 = 0;", - " k2 = 1;", - " } // X Z Y order", - " else {", - " i1 = 0;", - " j1 = 0;", - " k1 = 1;", - " i2 = 1;", - " j2 = 0;", - " k2 = 1;", - " } // Z X Y order", - " }", - " else { // x0 y0)", - " rankx++;", - " else", - " ranky++;", - " if (x0 > z0)", - " rankx++;", - " else", - " rankz++;", - " if (x0 > w0)", - " rankx++;", - " else", - " rankw++;", - " if (y0 > z0)", - " ranky++;", - " else", - " rankz++;", - " if (y0 > w0)", - " ranky++;", - " else", - " rankw++;", - " if (z0 > w0)", - " rankz++;", - " else", - " rankw++;", - " // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.", - " // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0;", - " const j1 = ranky >= 3 ? 1 : 0;", - " const k1 = rankz >= 3 ? 1 : 0;", - " const l1 = rankw >= 3 ? 1 : 0;", - " // The integer offsets for the third simplex corner", - " const i2 = rankx >= 2 ? 1 : 0;", - " const j2 = ranky >= 2 ? 1 : 0;", - " const k2 = rankz >= 2 ? 1 : 0;", - " const l2 = rankw >= 2 ? 1 : 0;", - " // The integer offsets for the fourth simplex corner", - " const i3 = rankx >= 1 ? 1 : 0;", - " const j3 = ranky >= 1 ? 1 : 0;", - " const k3 = rankz >= 1 ? 1 : 0;", - " const l3 = rankw >= 1 ? 1 : 0;", - " // The fifth corner has all coordinate offsets = 1, so no need to compute that.", - " const x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords", - " const y1 = y0 - j1 + G4;", - " const z1 = z0 - k1 + G4;", - " const w1 = w0 - l1 + G4;", - " const x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords", - " const y2 = y0 - j2 + 2.0 * G4;", - " const z2 = z0 - k2 + 2.0 * G4;", - " const w2 = w0 - l2 + 2.0 * G4;", - " const x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords", - " const y3 = y0 - j3 + 3.0 * G4;", - " const z3 = z0 - k3 + 3.0 * G4;", - " const w3 = w0 - l3 + 3.0 * G4;", - " const x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords", - " const y4 = y0 - 1.0 + 4.0 * G4;", - " const z4 = z0 - 1.0 + 4.0 * G4;", - " const w4 = w0 - 1.0 + 4.0 * G4;", - " // Work out the hashed gradient indices of the five simplex corners", - " const ii = i & 255;", - " const jj = j & 255;", - " const kk = k & 255;", - " const ll = l & 255;", - " // Calculate the contribution from the five corners", - " let t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;", - " if (t0 < 0)", - " n0 = 0.0;", - " else {", - " const gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;", - " t0 *= t0;", - " n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);", - " }", - " let t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;", - " if (t1 < 0)", - " n1 = 0.0;", - " else {", - " const gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;", - " t1 *= t1;", - " n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);", - " }", - " let t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;", - " if (t2 < 0)", - " n2 = 0.0;", - " else {", - " const gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;", - " t2 *= t2;", - " n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);", - " }", - " let t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;", - " if (t3 < 0)", - " n3 = 0.0;", - " else {", - " const gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;", - " t3 *= t3;", - " n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);", - " }", - " let t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;", - " if (t4 < 0)", - " n4 = 0.0;", - " else {", - " const gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;", - " t4 *= t4;", - " n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);", - " }", - " // Sum up and scale the result to cover the range [-1,1]", - " return 27.0 * (n0 + n1 + n2 + n3 + n4);", - " };", - "}", - "", - "gdjs._shakeObjectExtension = {", - " noiseManager: new NoiseManager(),", - "};", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Generate a number from 2 dimensional simplex noise.", - "fullName": "2D noise", - "functionType": "Expression", - "name": "Noise2d", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "const x = eventsFunctionContext.getArgument(\"X\");\r", - "const y = eventsFunctionContext.getArgument(\"Y\");\r", - "\r", - "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.getGenerator(name).noise(x, y);" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Generator name", - "name": "Name", - "type": "string" - }, - { - "description": "X coordinate", - "name": "X", - "type": "expression" - }, - { - "description": "Y coordinate", - "name": "Y", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Generate a number from 3 dimensional simplex noise.", - "fullName": "3D noise", - "functionType": "Expression", - "name": "Noise3d", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "const x = eventsFunctionContext.getArgument(\"X\");\r", - "const y = eventsFunctionContext.getArgument(\"Y\");\r", - "const z = eventsFunctionContext.getArgument(\"Z\");\r", - "\r", - "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.getGenerator(name).noise(x, y, z);" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Generator name", - "name": "Name", - "type": "string" - }, - { - "description": "X coordinate", - "name": "X", - "type": "expression" - }, - { - "description": "Y coordinate", - "name": "Y", - "type": "expression" - }, - { - "description": "Z coordinate", - "name": "Z", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Generate a number from 4 dimensional simplex noise.", - "fullName": "4D noise", - "functionType": "Expression", - "name": "Noise4d", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "const x = eventsFunctionContext.getArgument(\"X\");\r", - "const y = eventsFunctionContext.getArgument(\"Y\");\r", - "const z = eventsFunctionContext.getArgument(\"Z\");\r", - "const w = eventsFunctionContext.getArgument(\"W\");\r", - "\r", - "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.getGenerator(name).noise(x, y, z, w);" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Generator name", - "name": "Name", - "type": "string" - }, - { - "description": "X coordinate", - "name": "X", - "type": "expression" - }, - { - "description": "Y coordinate", - "name": "Y", - "type": "expression" - }, - { - "description": "Z coordinate", - "name": "Z", - "type": "expression" - }, - { - "description": "W coordinate", - "name": "W", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Create a noise generator with default settings (frequency = 1, octaves = 1, persistence = 0.5, lacunarity = 2).", - "fullName": "Create a noise generator", - "functionType": "Action", - "name": "Create", - "private": true, - "sentence": "Create a noise generator named _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "\r", - "gdjs._shakeObjectExtension.noiseManager.getGenerator(name);" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [ - { - "description": "Generator name", - "name": "Name", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "Delete a noise generator and loose its settings.", - "fullName": "Delete a noise generator", - "functionType": "Action", - "name": "Delete", - "private": true, - "sentence": "Delete _PARAM1_ noise generator", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "\r", - "gdjs._shakeObjectExtension.noiseManager.deleteGenerator(name);" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [ - { - "description": "Generator name", - "name": "Name", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "Delete all noise generators and loose their settings.", - "fullName": "Delete all noise generators", - "functionType": "Action", - "name": "DeleteAll", - "private": true, - "sentence": "Delete all noise generators", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "gdjs._shakeObjectExtension.noiseManager.deleteAllGenerators();", - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "The seed is a number used to generate the random noise. Setting the same seed will result in the same random noise generation. It's for example useful to generate the same world, by saving this seed value and reusing it later to generate again a world.", - "fullName": "Noise seed", - "functionType": "Action", - "name": "SetSeed", - "private": true, - "sentence": "Change the noise seed to _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "gdjs._shakeObjectExtension.noiseManager.setSeed(eventsFunctionContext.getArgument(\"Seed\"));", - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [ - { - "description": "Seed", - "longDescription": "15 digits numbers maximum", - "name": "Seed", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Change the looping period on X used for noise generation. The noise will wrap-around on X.", - "fullName": "Noise looping period on X", - "functionType": "Action", - "name": "SetLoopPeriodX", - "private": true, - "sentence": "Change the looping period on X of _PARAM2_: _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "\r", - "gdjs._shakeObjectExtension.noiseManager.getGenerator(name).xLoopPeriod = eventsFunctionContext.getArgument(\"LoopPeriod\");" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [ - { - "description": "Looping period on X", - "name": "LoopPeriod", - "type": "expression" - }, - { - "description": "Generator name", - "name": "Name", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "Change the looping period on Y used for noise generation. The noise will wrap-around on Y.", - "fullName": "Noise looping period on Y", - "functionType": "Action", - "name": "SetLoopPeriodY", - "private": true, - "sentence": "Change the looping period on Y of _PARAM2_: _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "\r", - "gdjs._shakeObjectExtension.noiseManager.getGenerator(name).yLoopPeriod = eventsFunctionContext.getArgument(\"LoopPeriod\");" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "Looping period on Y", - "name": "LoopPeriod", - "type": "expression" - }, - { - "description": "Generator name", - "name": "Name", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "Change the base frequency used for noise generation. A lower frequency will zoom in the noise.", - "fullName": "Noise base frequency", - "functionType": "Action", - "name": "SetFrequency", - "private": true, - "sentence": "Change the noise frequency of _PARAM2_: _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "\r", - "gdjs._shakeObjectExtension.noiseManager.getGenerator(name).frequency = eventsFunctionContext.getArgument(\"Frequency\");" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [ - { - "description": "Frequency", - "name": "Frequency", - "type": "expression" - }, - { - "description": "Generator name", - "name": "Name", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "Change the number of octaves used for noise generation. It can be seen as layers of noise with different zoom.", - "fullName": "Noise octaves", - "functionType": "Action", - "name": "SetOctaves", - "private": true, - "sentence": "Change the number of noise octaves of _PARAM2_: _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "\r", - "gdjs._shakeObjectExtension.noiseManager.getGenerator(name).octaves = eventsFunctionContext.getArgument(\"Octaves\");" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [ - { - "description": "Octaves", - "name": "Octaves", - "type": "expression" - }, - { - "description": "Generator name", - "name": "Name", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "Change the persistence used for noise generation. At its default value \"0.5\", it halves the noise amplitude at each octave.", - "fullName": "Noise persistence", - "functionType": "Action", - "name": "SetPersistence", - "private": true, - "sentence": "Change the noise persistence of _PARAM2_: _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "\r", - "gdjs._shakeObjectExtension.noiseManager.getGenerator(name).persistence = eventsFunctionContext.getArgument(\"Persistence\");" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [ - { - "description": "Persistence", - "name": "Persistence", - "type": "expression" - }, - { - "description": "Generator name", - "name": "Name", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "Change the lacunarity used for noise generation. At its default value \"2\", it doubles the frequency at each octave.", - "fullName": "Noise lacunarity", - "functionType": "Action", - "name": "SetLacunarity", - "private": true, - "sentence": "Change the noise lacunarity of _PARAM2_: _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "\r", - "gdjs._shakeObjectExtension.noiseManager.getGenerator(name).lacunarity = eventsFunctionContext.getArgument(\"Lacunarity\");" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [ - { - "description": "Lacunarity", - "name": "Lacunarity", - "type": "expression" - }, - { - "description": "Generator name", - "name": "Name", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "The seed used for noise generation.", - "fullName": "Noise seed", - "functionType": "Expression", - "name": "Seed", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.seed;", - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [], - "objectGroups": [] - }, - { - "description": "The base frequency used for noise generation.", - "fullName": "Noise base frequency", - "functionType": "Expression", - "name": "Frequency", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "\r", - "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.getGenerator(name).frequency;" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Generator name", - "name": "Name", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "The number of octaves used for noise generation.", - "fullName": "Noise octaves number", - "functionType": "Expression", - "name": "Octaves", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "\r", - "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.getGenerator(name).octaves;" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Generator name", - "name": "Name", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "The persistence used for noise generation.", - "fullName": "Noise persistence", - "functionType": "Expression", - "name": "Persistence", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "\r", - "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.getGenerator(name).persistence;" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Generator name", - "name": "Name", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "The lacunarity used for noise generation.", - "fullName": "Noise lacunarity", - "functionType": "Expression", - "name": "Lacunarity", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "\r", - "eventsFunctionContext.returnValue = gdjs._shakeObjectExtension.noiseManager.getGenerator(name).lacunarity;" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Generator name", - "name": "Name", - "type": "string" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ - { - "description": "Shake 3D objects with translation and rotation.", - "fullName": "3D shake", - "name": "ShakeModel3D", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsStartingAtCreation", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ShakeObject3D::DefineHelperClasses" - }, - "parameters": [ - "", - "" - ] - }, - { - "type": { - "value": "ShakeObject3D::ShakeModel3D::StartShaking" - }, - "parameters": [ - "Object", - "Behavior", - "0", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject3D::ShakeModel3D", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Step time counters." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Time", - "+", - "TimeDelta()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ShakeObject3D::ShakeModel3D::IsShaking" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "NoiseTime", - "+", - "TimeDelta() * Frequency" - ] - }, - { - "type": { - "value": "ShakeObject3D::ShakeModel3D::SetSharedPropertyEasingFactor" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "min(Object.Behavior::StartEasingFactor(), Object.Behavior::StopEasingFactor())" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Shake the object.\nSave the object displacement to revert it in onScenePostEvents." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TranslationAmplitudeX", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "DeltaX", - "=", - "ShakeObject3D::Noise2d(\"\", NoiseTime, 1000) * TranslationAmplitudeX * EasingFactor" - ] - }, - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Object", - "+", - "DeltaX" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TranslationAmplitudeY", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "DeltaY", - "=", - "ShakeObject3D::Noise2d(\"\", NoiseTime, 2000) * TranslationAmplitudeY * EasingFactor" - ] - }, - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Object", - "+", - "DeltaY" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TranslationAmplitudeZ", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "DeltaZ", - "=", - "ShakeObject3D::Noise2d(\"\", NoiseTime, 3000) * TranslationAmplitudeZ * EasingFactor" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetZ" - }, - "parameters": [ - "Object", - "Object3D", - "+", - "DeltaZ" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "RotationAmplitudeX", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "DeltaAngleX", - "=", - "ShakeObject3D::Noise2d(\"\", NoiseTime, 4000) * RotationAmplitudeX * EasingFactor" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetRotationX" - }, - "parameters": [ - "Object", - "Object3D", - "+", - "DeltaAngleX" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "RotationAmplitudeY", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "DeltaAngleY", - "=", - "ShakeObject3D::Noise2d(\"\", NoiseTime, 5000) * RotationAmplitudeY * EasingFactor" - ] - }, - { - "type": { - "value": "Scene3D::Base3DBehavior::SetRotationY" - }, - "parameters": [ - "Object", - "Object3D", - "+", - "DeltaAngleY" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "RotationAmplitudeZ", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "DeltaAngleZ", - "=", - "ShakeObject3D::Noise2d(\"\", NoiseTime, 6000) * RotationAmplitudeZ * EasingFactor" - ] - }, - { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "Object", - "+", - "DeltaAngleZ" - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject3D::ShakeModel3D", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Revert the shaking." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ShakeObject3D::ShakeModel3D::IsShaking" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TranslationAmplitudeX", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Object", - "-", - "DeltaX" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TranslationAmplitudeY", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Object", - "-", - "DeltaY" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TranslationAmplitudeZ", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "Scene3D::Base3DBehavior::SetZ" - }, - "parameters": [ - "Object", - "Object3D", - "-", - "DeltaZ" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "RotationAmplitudeX", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "Scene3D::Base3DBehavior::SetRotationX" - }, - "parameters": [ - "Object", - "Object3D", - "-", - "DeltaAngleX" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "RotationAmplitudeY", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "Scene3D::Base3DBehavior::SetRotationY" - }, - "parameters": [ - "Object", - "Object3D", - "-", - "DeltaAngleY" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "RotationAmplitudeZ", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "Object", - "-", - "DeltaAngleZ" - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject3D::ShakeModel3D", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Shake the object with a linear easing at the start and the end.", - "fullName": "Shake", - "functionType": "Action", - "name": "Shake", - "sentence": "Shake _PARAM0_ for _PARAM2_ seconds with _PARAM3_ seconds of easing to start and _PARAM4_ seconds to stop", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Time", - "=", - "0" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "NoiseTime", - "=", - "TimeFromStart() * Frequency" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Duration", - "=", - "NewDuration" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "StartEasingDuration", - "=", - "StartEaseDuration" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "StopEasingDuration", - "=", - "StopEaseDuration" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "NewDuration", - "<", - "StartEaseDuration + StopEaseDuration" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "StartEasingDuration", - "=", - "StartEaseDuration * NewDuration / (StartEaseDuration + StopEaseDuration)" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "StopEasingDuration", - "=", - "StopEaseDuration * NewDuration / (StartEaseDuration + StopEaseDuration)" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject3D::ShakeModel3D", - "type": "behavior" - }, - { - "description": "Duration (in seconds)", - "name": "NewDuration", - "type": "expression" - }, - { - "description": "Ease duration to start (in seconds)", - "name": "StartEaseDuration", - "type": "expression" - }, - { - "description": "Ease duration to stop (in seconds)", - "name": "StopEaseDuration", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Shake the object with a linear easing at the start and keep shaking until the stop action is used.", - "fullName": "Start shaking", - "functionType": "Action", - "name": "StartShaking", - "sentence": "Start shaking _PARAM0_ with _PARAM2_ seconds of easing", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Time", - "=", - "0" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "NoiseTime", - "=", - "TimeFromStart() * Frequency" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Duration", - "=", - "1234567890" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "StartEasingDuration", - "=", - "EaseDuration" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject3D::ShakeModel3D", - "type": "behavior" - }, - { - "description": "Ease duration (in seconds)", - "name": "EaseDuration", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Stop shaking the object with a linear easing.", - "fullName": "Stop shaking", - "functionType": "Action", - "name": "StopShaking", - "sentence": "Stop shaking _PARAM0_ with _PARAM2_ seconds of easing", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ShakeObject3D::ShakeModel3D::IsShaking" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Time", - "=", - "0" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Duration", - "=", - "EaseDuration" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "StopEasingDuration", - "=", - "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": "NumberVariable" - }, - "parameters": [ - "Time", - "<", - "Duration" - ] - }, - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "Time", - ">", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject3D::ShakeModel3D", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the object is stopping to shake.", - "fullName": "Is stopping to shake", - "functionType": "Condition", - "name": "IsStopping", - "sentence": "_PARAM0_ is stopping to shake", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ShakeObject3D::ShakeModel3D::IsShaking" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "ShakeObject3D::ShakeModel3D::StopEasingFactor" - }, - "parameters": [ - "Object", - "Behavior", - "<", - "1", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject3D::ShakeModel3D", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the shaking frequency of the object.", - "fullName": "Shaking frequency", - "functionType": "ExpressionAndCondition", - "group": "ShakeObject3D configuration", - "name": "Frequency", - "sentence": "the shaking frequency", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Frequency" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject3D::ShakeModel3D", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "Frequency", - "name": "SetFrequency", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Frequency", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject3D::ShakeModel3D", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Return the easing factor according to start properties.", - "fullName": "Start easing factor", - "functionType": "Expression", - "name": "StartEasingFactor", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "StartEasingDuration", - "<=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "1" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "StartEasingDuration", - ">", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "clamp(Time / StartEasingDuration, 0, 1)" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject3D::ShakeModel3D", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Return the easing factor according to stop properties.", - "fullName": "Stop easing factor", - "functionType": "ExpressionAndCondition", - "name": "StopEasingFactor", - "private": true, - "sentence": "stop easing factor", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "StopEasingDuration", - "<=", - "0" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "Time", - "<", - "Duration" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "1" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "Time", - ">=", - "Duration" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "0" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "StopEasingDuration", - ">", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "clamp((Duration - Time) / StopEasingDuration, 0, 1)" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject3D::ShakeModel3D", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Translation amplitude on X axis", - "name": "TranslationAmplitudeX" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Translation amplitude on Y axis", - "name": "TranslationAmplitudeY" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Translation amplitude on Z axis", - "name": "TranslationAmplitudeZ" - }, - { - "value": "5", - "type": "Number", - "unit": "DegreeAngle", - "label": "Rotation amplitude around X axis", - "name": "RotationAmplitudeX" - }, - { - "value": "5", - "type": "Number", - "unit": "DegreeAngle", - "label": "Rotation amplitude around Y axis", - "name": "RotationAmplitudeY" - }, - { - "value": "5", - "type": "Number", - "unit": "DegreeAngle", - "label": "Rotation amplitude around Z axis", - "name": "RotationAmplitudeZ" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "Time" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "Duration" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "StartEasingDuration" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "StopEasingDuration" - }, - { - "value": "", - "type": "Number", - "label": "Frequency", - "name": "Frequency" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "DeltaX" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "DeltaY" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "DeltaZ" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "DeltaAngleX" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "DeltaAngleY" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "DeltaAngleZ" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "NoiseTime" - }, - { - "value": "", - "type": "Behavior", - "label": "3D capability", - "extraInformation": [ - "Scene3D::Base3DBehavior" - ], - "choices": [], - "name": "Object3D" - }, - { - "value": "", - "type": "Boolean", - "label": "Start to shake at the object creation", - "name": "IsStartingAtCreation" - } - ], - "sharedPropertyDescriptors": [ - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "EasingFactor" - } - ] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "Camera", - "extensionNamespace": "", - "fullName": "Third person camera", - "gdevelopVersion": ">=5.5.222", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSI3LDEwIDEsMTMgNywxNiAxMywxMyAiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjEsMTMgMSwyMCA3LDIzIDEzLDIwIDEzLDEzICIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjciIHkxPSIxNiIgeDI9IjciIHkyPSIyMyIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjMxIiB5MT0iMTYiIHgyPSIyMSIgeTI9IjgiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyMSIgeTE9IjI0IiB4Mj0iMzEiIHkyPSIxNiIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTIyLjcsMjIuNkMyMCwyMS43LDE4LDE5LjEsMTgsMTZjMC0zLjEsMi01LjcsNC43LTYuNiIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTE5LjgsMTEuM2MxLjQsMS4xLDIuMiwyLjgsMi4yLDQuN2MwLDEuOS0wLjksMy42LTIuMiw0LjciLz4NCjwvc3ZnPg0K", - "name": "ThirdPersonCamera", - "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Virtual Reality/94e95d2c318e1f3dc7151a351024e13c574e1e44669c6696aa107d60230073f6_Virtual Reality_3d_vision_eye_vr.svg", - "shortDescription": "Move the camera to look at an object from a given distance.", - "version": "1.7.1", - "description": [ - "Move the camera to look at an object from a given distance with a rotation and an elevation angles.", - "", - "It can be useful for:", - "- 3D platformer games ([open the project online](https://editor.gdevelop.io/?project=example://3d-platformer))", - "- 3D racing games ([open the project online](https://editor.gdevelop.io/?project=example://3d-car-coin-hunt))", - "- Orbit camera controls ([open the project online](https://editor.gdevelop.io/?project=example://3d-tile-based-city-builder))", - "- Isometric-like point of view ([open the project online](https://editor.gdevelop.io/?project=example://3d-road-crosser))" - ], - "origin": { - "identifier": "ThirdPersonCamera", - "name": "gdevelop-extension-store" - }, - "tags": [ - "3d", - "camera" - ], - "authorIds": [ - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Move the camera to look at a position from a distance.", - "fullName": "Look at a position from a distance (deprecated)", - "functionType": "Action", - "name": "LookFromDistanceAtPosition", - "private": true, - "sentence": "Move the camera of _PARAM6_ to look at _PARAM1_; _PARAM2_ from _PARAM3_ pixels with a rotation of _PARAM4_° and an elevation of _PARAM5_°", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetCameraCenterX" - }, - "parameters": [ - "", - "=", - "PositionX + Distance * cos(ToRad(RotationAngle + 90)) * cos(ToRad(ElevationAngle))", - "Layer", - "" - ] - }, - { - "type": { - "value": "SetCameraCenterY" - }, - "parameters": [ - "", - "=", - "PositionY + Distance * sin(ToRad(RotationAngle + 90)) * cos(ToRad(ElevationAngle))", - "Layer", - "" - ] - }, - { - "type": { - "value": "Scene3D::SetCameraZ" - }, - "parameters": [ - "", - "=", - "Distance * sin(ToRad(ElevationAngle))", - "Layer", - "" - ] - }, - { - "type": { - "value": "Scene3D::TurnCameraTowardPosition" - }, - "parameters": [ - "", - "PositionX", - "PositionY", - "0", - "Layer", - "", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Position on X axis", - "name": "PositionX", - "type": "expression" - }, - { - "description": "Position on Y axis", - "name": "PositionY", - "type": "expression" - }, - { - "description": "Distance", - "name": "Distance", - "type": "expression" - }, - { - "description": "Rotation angle (around Z axis)", - "name": "RotationAngle", - "type": "expression" - }, - { - "description": "Elevation angle (around Y axis)", - "name": "ElevationAngle", - "type": "expression" - }, - { - "description": "Layer", - "name": "Layer", - "type": "layer" - } - ], - "objectGroups": [] - }, - { - "description": "Move the camera to look at an object from a distance.", - "fullName": "Look at an object from a distance (deprecated)", - "functionType": "Action", - "name": "LookFromDistanceAtObject", - "private": true, - "sentence": "Move the camera of _PARAM5_ to look at _PARAM1_ from _PARAM2_ pixels with a rotation of _PARAM3_° and an elevation of _PARAM4_°", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ThirdPersonCamera::LookFromDistanceAtPosition" - }, - "parameters": [ - "", - "Object.CenterX()", - "Object.CenterY()", - "Distance", - "RotationAngle", - "ElevationAngle", - "Layer", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "objectList" - }, - { - "description": "Distance", - "name": "Distance", - "type": "expression" - }, - { - "description": "Rotation angle (around Z axis)", - "name": "RotationAngle", - "type": "expression" - }, - { - "description": "Elevation angle (around Y axis)", - "name": "ElevationAngle", - "type": "expression" - }, - { - "description": "Layer", - "name": "Layer", - "type": "layer" - } - ], - "objectGroups": [] - }, - { - "description": "Move the camera to look at a position from a distance.", - "fullName": "Look at a position from a distance", - "functionType": "Action", - "name": "LookFromDistanceAtPosition3D", - "sentence": "Move the camera of _PARAM7_ to look at _PARAM1_; _PARAM2_; _PARAM3_ from _PARAM4_ pixels with a rotation of _PARAM5_° and an elevation of _PARAM6_°", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetCameraCenterX" - }, - "parameters": [ - "", - "=", - "PositionX + Distance * cos(ToRad(RotationAngle + 90)) * cos(ToRad(ElevationAngle))", - "Layer", - "" - ] - }, - { - "type": { - "value": "SetCameraCenterY" - }, - "parameters": [ - "", - "=", - "PositionY + Distance * sin(ToRad(RotationAngle + 90)) * cos(ToRad(ElevationAngle))", - "Layer", - "" - ] - }, - { - "type": { - "value": "Scene3D::SetCameraZ" - }, - "parameters": [ - "", - "=", - "PositionZ + Distance * sin(ToRad(ElevationAngle))", - "Layer", - "" - ] - }, - { - "type": { - "value": "Scene3D::SetCameraRotationX" - }, - "parameters": [ - "", - "=", - "90 - ElevationAngle", - "Layer", - "" - ] - }, - { - "type": { - "value": "Scene3D::SetCameraRotationY" - }, - "parameters": [ - "", - "=", - "0", - "Layer", - "" - ] - }, - { - "type": { - "value": "SetCameraAngle" - }, - "parameters": [ - "", - "=", - "RotationAngle", - "Layer", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Position on X axis", - "name": "PositionX", - "type": "expression" - }, - { - "description": "Position on Y axis", - "name": "PositionY", - "type": "expression" - }, - { - "description": "Position on Z axis", - "name": "PositionZ", - "type": "expression" - }, - { - "description": "Distance", - "name": "Distance", - "type": "expression" - }, - { - "description": "Rotation angle (around Z axis)", - "name": "RotationAngle", - "type": "expression" - }, - { - "description": "Elevation angle (around Y axis)", - "name": "ElevationAngle", - "type": "expression" - }, - { - "description": "Layer", - "name": "Layer", - "type": "layer" - } - ], - "objectGroups": [] - }, - { - "description": "Move the camera to look at an object from a distance.", - "fullName": "Look at an object from a distance", - "functionType": "Action", - "group": "Layers and cameras", - "name": "LookFromDistanceAtObject3D", - "sentence": "Move the camera of _PARAM6_ to look at _PARAM1_ from _PARAM3_ pixels with a rotation of _PARAM4_° and an elevation of _PARAM5_°", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ThirdPersonCamera::LookFromDistanceAtPosition3D" - }, - "parameters": [ - "", - "Object.CenterX()", - "Object.CenterY()", - "Object.Object3D::CenterZ()", - "Distance", - "RotationAngle", - "ElevationAngle", - "Layer", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "objectList" - }, - { - "description": "3D capability", - "name": "Object3D", - "supplementaryInformation": "Scene3D::Base3DBehavior", - "type": "behavior" - }, - { - "description": "Distance", - "name": "Distance", - "type": "expression" - }, - { - "description": "Rotation angle (around Z axis)", - "name": "RotationAngle", - "type": "expression" - }, - { - "description": "Elevation angle (around Y axis)", - "name": "ElevationAngle", - "type": "expression" - }, - { - "description": "Layer", - "name": "Layer", - "type": "layer" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Expression", - "name": "RotatedX", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Cos", - "=", - "cos(ToRad(RotationAngle))" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Sin", - "=", - "sin(ToRad(RotationAngle))" - ] - }, - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Cos * X - Sin * Y" - ] - } - ], - "variables": [ - { - "folded": true, - "name": "Cos", - "type": "number", - "value": 0 - }, - { - "folded": true, - "name": "Sin", - "type": "number", - "value": 0 - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Rotation angle", - "name": "RotationAngle", - "supplementaryInformation": "Tank::Tank", - "type": "expression" - }, - { - "description": "", - "name": "X", - "type": "expression" - }, - { - "description": "", - "name": "Y", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Expression", - "name": "RotatedY", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Cos", - "=", - "cos(ToRad(RotationAngle))" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Sin", - "=", - "sin(ToRad(RotationAngle))" - ] - }, - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Sin * X + Cos * Y" - ] - } - ], - "variables": [ - { - "folded": true, - "name": "Cos", - "type": "number", - "value": 0 - }, - { - "folded": true, - "name": "Sin", - "type": "number", - "value": 0 - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Rotation angle", - "name": "RotationAngle", - "supplementaryInformation": "Tank::Tank", - "type": "expression" - }, - { - "description": "", - "name": "X", - "type": "expression" - }, - { - "description": "", - "name": "Y", - "type": "expression" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ - { - "description": "Smoothly follow an object at a distance.", - "fullName": "Third person camera", - "name": "ThirdPersonCamera", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Update private properties through setters to check their values and initialize state." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "RotationHalfwayDuration", - "" - ] - }, - { - "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetElevationHalfwayDuration" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "ElevationHalfwayDuration", - "" - ] - }, - { - "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::SetTranslationZHalfwayDuration" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "TranslationZHalfwayDuration", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "HasJustBeenCreated", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "HasJustBeenCreated", - "False", - "" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "CameraZ", - "=", - "Object.Object3D::CenterZ()" - ] - }, - { - "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::JumpToTargetedRotation" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "IsCalledManually", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::DoMoveCameraCloser" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Move the camera closer to the object. This action must be called after the object has moved for the frame.", - "fullName": "Move the camera closer", - "functionType": "Action", - "name": "MoveCameraCloser", - "sentence": "Move the camera closer to _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "The camera following is called with an action, the call from doStepPreEvents must be disabled to avoid to do it twice." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BehaviorActivated" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsCalledManually", - "False", - "" - ] - }, - { - "type": { - "value": "ThirdPersonCamera::ThirdPersonCamera::DoMoveCameraCloser" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Move the camera closer to the object.", - "fullName": "Do move the camera closer", - "functionType": "Action", - "name": "DoMoveCameraCloser", - "private": true, - "sentence": "Do move the camera closer _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "At each frame, the camera must catchup the target by a given ratio (speed)\ncameraX(t) - targetX = (cameraX(t - 1) - targetX) * (1 - speed)\n\nThe frame rate must not impact on the catch-up speed, we don't want a speed in ratio per frame but a speed ratio per second, like this:\ncameraX(t) - targetX = (cameraX(t - 1s) - targetX) * (1 - speed)\n\nOk, but we still need to process each frame, we can use a exponent for this:\ncameraX(t) - targetX = (cameraX(t - timeDelta) - targetX) * (1 - speed)^timeDelta\ncameraX(t) = targetX + (cameraX(t - timeDelta) - targetX) * exp(timeDelta * ln((1 - speed)))\n\npow is probably more efficient than precalculated log if the speed is changed continuously but this might be rare enough." - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Z translation", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CameraZ", - "<", - "Object.Behavior::FreeAreaZMin()" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "CameraZ", - "=", - "Object.Behavior::FreeAreaZMin() + (CameraZ - Object.Behavior::FreeAreaZMin()) * exp(TimeDelta() * TranslationZLogSpeed)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "CameraZ", - ">", - "Object.Behavior::FreeAreaZMax()" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "CameraZ", - "=", - "Object.Behavior::FreeAreaZMax() + (CameraZ - Object.Behavior::FreeAreaZMax()) * exp(TimeDelta() * TranslationZLogSpeed)" - ] - } - ] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Z rotation", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsRotatingWithObject", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TargetedRotationAngle", - "=", - "Object.Angle()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsElevatingWithObject", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TargetedElevationAngle", - "=", - "Object.Object3D::RotationY()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "CameraRotationAngle", - "=", - "TargetedRotationAngle + 90 + RotationAngleOffset + AngleDifference(CameraAngle(Object.Layer()), TargetedRotationAngle + 90 + RotationAngleOffset) * exp(TimeDelta() * RotationLogSpeed)" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "CameraElevationAngle", - "=", - "TargetedElevationAngle + ElevationAngleOffset + AngleDifference(90 - Scene3D::CameraRotationX(Object.Layer()), TargetedElevationAngle + ElevationAngleOffset) * exp(TimeDelta() * ElevationLogSpeed)" - ] - }, - { - "type": { - "value": "ThirdPersonCamera::LookFromDistanceAtPosition3D" - }, - "parameters": [ - "", - "Object.CenterX() + ThirdPersonCamera::RotatedX(CameraRotationAngle, OffsetX, -OffsetY)", - "Object.CenterY() + ThirdPersonCamera::RotatedY(CameraRotationAngle, OffsetX, -OffsetY)", - "CameraZ + OffsetZ", - "Distance", - "CameraRotationAngle", - "CameraElevationAngle", - "", - "" - ] - } - ], - "variables": [ - { - "folded": true, - "name": "CameraRotationAngle", - "type": "number", - "value": 0 - }, - { - "name": "CameraElevationAngle", - "type": "number", - "value": 0 - } - ] - } - ], - "parameters": [] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Rotate the camera all the way to the targeted angle.", - "fullName": "Rotate the camera all the way", - "functionType": "Action", - "name": "JumpToTargetedRotation", - "sentence": "Rotate the camera all the way to the targeted angle of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsRotatingWithObject", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TargetedRotationAngle", - "=", - "Object.Angle()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsElevatingWithObject", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TargetedElevationAngle", - "=", - "Object.Object3D::RotationY()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "CameraAngle", - "=", - "TargetedRotationAngle + 90 + RotationAngleOffset" - ] - }, - { - "type": { - "value": "ThirdPersonCamera::LookFromDistanceAtPosition3D" - }, - "parameters": [ - "", - "Object.CenterX() + ThirdPersonCamera::RotatedX(CameraAngle, OffsetX, -OffsetY)", - "Object.CenterY() + ThirdPersonCamera::RotatedY(CameraAngle, OffsetX, -OffsetY)", - "CameraZ + OffsetZ", - "Distance", - "CameraAngle", - "Object.Object3D::RotationY() + ElevationAngleOffset", - "", - "" - ] - } - ], - "variables": [ - { - "folded": true, - "name": "CameraAngle", - "type": "number", - "value": 0 - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the camera rotation.", - "fullName": "Camera rotation", - "functionType": "ExpressionAndCondition", - "name": "RotationAngle", - "private": true, - "sentence": "the camera rotation", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "CameraAngle(Object.Layer())" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Rotate the camera all the way to the targeted angle.", - "fullName": "Rotate the camera all the way", - "functionType": "ActionWithOperator", - "getterName": "RotationAngle", - "name": "SetCameraRotation", - "sentence": "Rotate the camera all the way to the targeted angle of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ThirdPersonCamera::LookFromDistanceAtPosition3D" - }, - "parameters": [ - "", - "Object.CenterX() + ThirdPersonCamera::RotatedX(Value, OffsetX, -OffsetY)", - "Object.CenterY() + ThirdPersonCamera::RotatedY(Value, OffsetX, -OffsetY)", - "CameraZ + OffsetZ", - "Distance", - "Value", - "Object.Object3D::RotationY() + ElevationAngleOffset", - "", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the halfway time for rotation of the object.", - "fullName": "Halfway time for rotation", - "functionType": "ExpressionAndCondition", - "group": "Third person camera configuration", - "name": "RotationHalfwayDuration", - "sentence": "the halfway time for rotation", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "RotationHalfwayDuration" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "RotationHalfwayDuration", - "name": "SetRotationHalfwayDuration", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "ln((1 - speed)) = ln(1 / 2) / halfwatTime" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "RotationHalfwayDuration", - "=", - "Value" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "RotationLogSpeed", - "=", - "log(0.5) / Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the halfway time for elevation rotation of the object.", - "fullName": "Halfway time for elevation rotation", - "functionType": "ExpressionAndCondition", - "group": "Third person camera configuration", - "name": "ElevationHalfwayDuration", - "sentence": "the halfway time for elevation rotation", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "ElevationHalfwayDuration" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "ElevationHalfwayDuration", - "name": "SetElevationHalfwayDuration", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "ln((1 - speed)) = ln(1 / 2) / halfwatTime" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "ElevationHalfwayDuration", - "=", - "Value" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "ElevationLogSpeed", - "=", - "log(0.5) / Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the halfway time on Z axis of the object.", - "fullName": "Halfway time on Z axis", - "functionType": "ExpressionAndCondition", - "group": "Third person camera configuration", - "name": "TranslationZHalfwayDuration", - "sentence": "the halfway time on Z axis", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "TranslationZHalfwayDuration" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "TranslationZHalfwayDuration", - "name": "SetTranslationZHalfwayDuration", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "ln((1 - speed)) = ln(1 / 2) / halfwatTime" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TranslationZHalfwayDuration", - "=", - "Value" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TranslationZLogSpeed", - "=", - "log(0.5) / Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Return follow free area bottom border Z.", - "fullName": "Free area Z min", - "functionType": "Expression", - "group": "Private", - "name": "FreeAreaZMin", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Object3D::CenterZ() + OffsetZ - FollowFreeAreaZMin" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Return follow free area top border Z.", - "fullName": "Free area Z max", - "functionType": "Expression", - "group": "Private", - "name": "FreeAreaZMax", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Object3D::CenterZ() + OffsetZ + FollowFreeAreaZMax" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the follow free area top border on Z axis of the object.", - "fullName": "Follow free area top border on Z axis", - "functionType": "ExpressionAndCondition", - "group": "Third person camera configuration", - "name": "FollowFreeAreaZMax", - "sentence": "the follow free area top border on Z axis", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "FollowFreeAreaZMax" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "FollowFreeAreaZMax", - "name": "SetFollowFreeAreaZMax", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "FollowFreeAreaZMax", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the follow free area bottom border on Z axis of the object.", - "fullName": "Follow free area bottom border on Z axis", - "functionType": "ExpressionAndCondition", - "group": "Third person camera configuration", - "name": "FollowFreeAreaZMin", - "sentence": "the follow free area bottom border on Z axis", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "FollowFreeAreaZMin" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "FollowFreeAreaZMin", - "name": "SetFollowFreeAreaZMin", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "FollowFreeAreaZMin", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the camera distance of the object.", - "fullName": "Camera distance", - "functionType": "ExpressionAndCondition", - "group": "Third person camera configuration", - "name": "Distance", - "sentence": "the camera distance", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Distance" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "Distance", - "name": "SetDistance", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Distance", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the lateral distance offset of the object.", - "fullName": "Lateral distance offset", - "functionType": "ExpressionAndCondition", - "group": "Third person camera configuration", - "name": "OffsetX", - "sentence": "the lateral distance offset", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "OffsetX" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "OffsetX", - "name": "SetOffsetX", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "OffsetX", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the ahead distance offset of the object.", - "fullName": "Ahead distance offset", - "functionType": "ExpressionAndCondition", - "group": "Third person camera configuration", - "name": "OffsetY", - "sentence": "the ahead distance offset", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "OffsetY" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "OffsetY", - "name": "SetOffsetY", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "OffsetY", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the z offset of the object.", - "fullName": "Z offset", - "functionType": "ExpressionAndCondition", - "group": "Third person camera configuration", - "name": "OffsetZ", - "sentence": "the z offset", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "OffsetZ" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "OffsetZ", - "name": "SetOffsetZ", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "OffsetZ", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the rotation angle offset of the object.", - "fullName": "Rotation angle offset", - "functionType": "ExpressionAndCondition", - "group": "Third person camera configuration", - "name": "RotationAngleOffset", - "sentence": "the rotation angle offset", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "RotationAngleOffset" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "RotationAngleOffset", - "name": "SetRotationAngleOffset", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "RotationAngleOffset", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the elevation angle offset of the object.", - "fullName": "Elevation angle offset", - "functionType": "ExpressionAndCondition", - "group": "Third person camera configuration", - "name": "ElevationAngleOffset", - "sentence": "the elevation angle offset", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "ElevationAngleOffset" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "ElevationAngleOffset", - "name": "SetElevationAngleOffset", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "ElevationAngleOffset", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the targeted camera rotation angle of the object. When this angle is set, the camera follow this value instead of the object angle.", - "fullName": "Targeted rotation angle", - "functionType": "ExpressionAndCondition", - "group": "Third person camera configuration", - "name": "TargetedRotationAngle", - "sentence": "the targeted camera rotation angle", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "TargetedRotationAngle" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "TargetedRotationAngle", - "name": "SetTargetedRotationAngle", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TargetedRotationAngle", - "=", - "Value" - ] - }, - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsRotatingWithObject", - "False", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "3D capability", - "extraInformation": [ - "Scene3D::Base3DBehavior" - ], - "choices": [], - "name": "Object3D" - }, - { - "value": "0.125", - "type": "Number", - "unit": "Second", - "label": "Halfway time for rotation", - "group": "Catch-up speed", - "quickCustomizationVisibility": "hidden", - "name": "RotationHalfwayDuration" - }, - { - "value": "0", - "type": "Number", - "unit": "Second", - "label": "Halfway time for elevation rotation", - "group": "Catch-up speed", - "quickCustomizationVisibility": "hidden", - "name": "ElevationHalfwayDuration" - }, - { - "value": "0.125", - "type": "Number", - "unit": "Second", - "label": "Halfway time on Z axis", - "group": "Catch-up speed", - "quickCustomizationVisibility": "hidden", - "name": "TranslationZHalfwayDuration" - }, - { - "value": "500", - "type": "Number", - "unit": "Pixel", - "label": "Camera distance", - "group": "Position", - "name": "Distance" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Lateral distance offset", - "group": "Position", - "name": "OffsetX" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Ahead distance offset", - "group": "Position", - "name": "OffsetY" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Z offset", - "group": "Position", - "name": "OffsetZ" - }, - { - "value": "0", - "type": "Number", - "unit": "DegreeAngle", - "label": "Rotation angle offset", - "group": "Position", - "name": "RotationAngleOffset" - }, - { - "value": "20", - "type": "Number", - "unit": "DegreeAngle", - "label": "Elevation angle offset", - "group": "Position", - "name": "ElevationAngleOffset" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Follow free area top border on Z axis", - "group": "Position", - "advanced": true, - "quickCustomizationVisibility": "hidden", - "name": "FollowFreeAreaZMax" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Follow free area bottom border on Z axis", - "group": "Position", - "advanced": true, - "quickCustomizationVisibility": "hidden", - "name": "FollowFreeAreaZMin" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "RotationLogSpeed" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "ElevationLogSpeed" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "TranslationZLogSpeed" - }, - { - "value": "", - "type": "Boolean", - "label": "", - "hidden": true, - "name": "IsCalledManually" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "", - "hidden": true, - "name": "CameraZ" - }, - { - "value": "true", - "type": "Boolean", - "label": "", - "hidden": true, - "name": "HasJustBeenCreated" - }, - { - "value": "true", - "type": "Boolean", - "label": "Automatically rotate the camera with the object", - "quickCustomizationVisibility": "hidden", - "name": "IsRotatingWithObject" - }, - { - "value": "false", - "type": "Boolean", - "label": "Automatically rotate the camera with the object (elevation)", - "quickCustomizationVisibility": "hidden", - "name": "IsElevatingWithObject" - }, - { - "value": "0", - "type": "Number", - "unit": "DegreeAngle", - "label": "Targeted camera rotation angle", - "description": "When this angle is set, the camera follow this value instead of the object angle.", - "hidden": true, - "name": "TargetedRotationAngle" - }, - { - "value": "0", - "type": "Number", - "unit": "DegreeAngle", - "label": "Targeted camera rotation angle", - "description": "When this angle is set, the camera follow this value instead of the object angle.", - "hidden": true, - "name": "TargetedElevationAngle" - } - ], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "Visual effect", - "extensionNamespace": "", - "fullName": "3D particle emitter", - "gdevelopVersion": ">=5.5.222", - "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 in 3D to create visual effects in a 3D game.", - "version": "3.0.1", - "description": [ - "3D particle emitters let you create and display many small particles to simulate visual effects in your game — like fire, explosions, smoke, or dust.", - "", - "The parameters of the object can be configured in multiple different ways to create a specific desired effect. GDevelop will give a set of a pre-configured 3D particle emitters that you should try first.", - "", - "Use these 3D particle emitters in 3D games. For 2D games or particles that appear on a game's 2D user interface, use the 2D particle emitter object instead." - ], - "origin": { - "identifier": "ParticleEmitter3D", - "name": "gdevelop-extension-store" - }, - "tags": [ - "3d", - "particle", - "explosion", - "fire", - "smoke", - "splash", - "light" - ], - "authorIds": [ - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" - ], - "changelog": [ - { - "version": "3.0.0", - "breaking": "- the object rotates the other way around X axis." - }, - { - "version": "2.0.0", - "breaking": "- Object properties for position and rotation have been removed. They must be set with the instance editor or the action." - }, - { - "version": "1.0.0", - "breaking": "- Particles were 3 times too small." - } - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Define helper classes JavaScript code.", - "fullName": "Define helper classes", - "functionType": "Action", - "name": "DefineHelperClasses", - "private": true, - "sentence": "Define helper classes JavaScript code", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "if (gdjs.__particleEmmiter3DExtension) {", - " return;", - "}", - "", - "const game = runtimeScene.getGame();", - "", - "class ParticleEmitter3DRenderer extends gdjs.CustomRuntimeObject3DRenderer {", - " constructor(", - " object,", - " instanceContainer,", - " parent", - " ) {", - " super(object, instanceContainer, parent);", - " }", - "", - " _updateThreeGroup() {", - " const threeObject3D = this.get3DRendererObject();", - "", - " threeObject3D.rotation.set(", - " gdjs.toRad(this._object.getRotationX()),", - " gdjs.toRad(this._object.getRotationY()),", - " gdjs.toRad(this._object.angle)", - " );", - "", - " threeObject3D.position.set(", - " this._object.getX(),", - " this._object.getY(),", - " this._object.getZ()", - " );", - "", - " // Force the scale to 1 because the particle emitter doesn't really has a size.", - " threeObject3D.scale.set(", - " this._object.isFlippedX() ? -1 : 1,", - " this._object.isFlippedY() ? -1 : 1,", - " this._object.isFlippedZ() ? -1 : 1", - " );", - "", - " threeObject3D.visible = !this._object.hidden;", - "", - " this._isContainerDirty = true;", - " }", - "}", - "", - "const coneLength = 64;", - "", - "class ParticleEmitterHelper extends THREE.Object3D {", - " /** @type {gdjs.CustomRuntimeObject3D} */", - " object;", - " /** @type {THREE.LineSegments} */", - " cone;", - " /** @type {THREE.LineSegments} */", - " centerLine;", - " /** @type {THREE.Mesh} */", - " originBox;", - "", - "\t/**", - " * @param gdjs.CustomRuntimeObject3D object", - "\t */", - " constructor(object) {", - " super();", - " this.object = object;", - " this.type = 'ParticleEmitterHelper';", - "", - " const coneGeometry = new THREE.BufferGeometry();", - " const conePositions = [", - " 0, 0, 0, 0, 0, 1,", - " 0, 0, 0, 1, 0, 1,", - " 0, 0, 0, - 1, 0, 1,", - " 0, 0, 0, 0, 1, 1,", - " 0, 0, 0, 0, - 1, 1", - " ];", - " for (let i = 0, j = 1, l = 32; i < l; i++ , j++) {", - " const p1 = (i / l) * Math.PI * 2;", - " const p2 = (j / l) * Math.PI * 2;", - " conePositions.push(", - " Math.cos(p1), Math.sin(p1), 1,", - " Math.cos(p2), Math.sin(p2), 1", - " );", - " }", - " coneGeometry.setAttribute('position', new THREE.Float32BufferAttribute(conePositions, 3));", - " this.cone = new THREE.LineSegments(", - " coneGeometry,", - " new THREE.LineBasicMaterial({ fog: false, toneMapped: false })", - " );", - " this.add(this.cone);", - " const centerLineGeometry = new THREE.BufferGeometry();", - " centerLineGeometry.setAttribute('position', new THREE.Float32BufferAttribute([", - " 0, 0, 0, 0, 0, coneLength", - " ], 3));", - " this.centerLine = new THREE.LineSegments(", - " centerLineGeometry,", - " new THREE.LineBasicMaterial({ fog: false, toneMapped: false })", - " );", - " this.add(this.centerLine);", - "", - " this.originBox = new THREE.Mesh(", - " new THREE.BoxGeometry(16, 16, 16),", - " new THREE.MeshBasicMaterial({ fog: false, toneMapped: false })", - " );", - " this.add(this.originBox);", - " this.update();", - "", - " this.originBox.gdjsRuntimeObject = object;", - " }", - "", - " dispose() {", - " this.cone.geometry.dispose();", - " this.cone.material.dispose();", - " this.centerLine.geometry.dispose();", - " this.centerLine.material.dispose();", - " this.originBox.geometry.dispose();", - " this.originBox.material.dispose();", - " }", - "", - " update() {", - " const coneWidth = coneLength * Math.sin(gdjs.toRad(this.object._getSpayConeAngle()));", - " const coneHeight = coneLength * Math.cos(gdjs.toRad(this.object._getSpayConeAngle()));", - " this.cone.scale.set(coneWidth, coneWidth, coneHeight);", - " const startColor = gdjs.rgbOrHexStringToNumber(this.object._getStartColor())", - " const endColor = gdjs.rgbOrHexStringToNumber(this.object._getEndColor());", - " this.cone.material.color.set(endColor);", - " this.centerLine.material.color.set(startColor);", - " this.originBox.material.color.set(startColor);", - " }", - "}", - "", - "/**", - " * @param {string} colorString", - " * @param {THREE.Vector4} threeColor", - " */", - "const setThreeColor = (colorString, threeColor = new THREE.Vector4()) => {", - " const integerColor = gdjs.rgbOrHexToRGBColor(colorString);", - " threeColor.x = integerColor[0] / 255;", - " threeColor.y = integerColor[1] / 255;", - " threeColor.z = integerColor[2] / 255;", - "};", - "", - "/**", - " * @param {string} integerOpacity", - " * @param {THREE.Vector4} threeColor", - " */", - "const setThreeOpacity = (integerOpacity, threeColor = new THREE.Vector4()) => {", - " threeColor.w = integerOpacity / 255;", - "};", - "", - "class ParticleEmitterAdapter {", - " /**", - " * @param particleSystem {ParticleSystem}", - " * @param colorOverLife {ColorOverLife}", - " * @param sizeOverLife {SizeOverLife}", - " * @param applyForce {ApplyForce}", - " */", - " constructor(particleSystem, colorOverLife, sizeOverLife, applyForce) {", - " this.particleSystem = particleSystem;", - " this.colorOverLife = colorOverLife;", - " this.sizeOverLife = sizeOverLife;", - " this.applyForce = applyForce;", - " }", - "", - " /**", - " * @param startColor {string}", - " */", - " setStartColor(startColor) {", - " setThreeColor(startColor, this.colorOverLife.color.color.keys[0][0]);", - " }", - "", - " /**", - " * @param endColor {string}", - " */", - " setEndColor(endColor) {", - " setThreeColor(endColor, this.colorOverLife.color.color.keys[1][0]);", - " }", - "", - " /**", - " * @param startOpacity {number}", - " */", - " setStartOpacity(startOpacity) {", - " this.colorOverLife.color.alpha.keys[0][0] = startOpacity / 255;", - " }", - "", - " /**", - " * @param endOpacity {number}", - " */", - " setEndOpacity(endOpacity) {", - " this.colorOverLife.color.alpha.keys[1][0] = endOpacity / 255;", - " }", - "", - " /**", - " * @param flow {number}", - " */", - " setFlow(flow) {", - " this.particleSystem.emissionOverTime.value = flow;", - " }", - "", - " /**", - " * @param startMinSize {number}", - " */", - " setStartMinSize(startMinSize) {", - " this.particleSystem.startSize.a = startMinSize;", - " }", - "", - " /**", - " * @param startMaxSize {number}", - " */", - " setStartMaxSize(startMaxSize) {", - " this.particleSystem.startSize.b = startMaxSize;", - " }", - "", - " /**", - " * @param endScale {number}", - " */", - " setEndScale(endScale) {", - " /** @type Bezier */", - " const bezier = this.sizeOverLife.size.functions[0][0];", - " bezier.p[0] = 1;", - " bezier.p[1] = gdjs.evtTools.common.lerp(1, endScale, 1 / 3);", - " bezier.p[2] = gdjs.evtTools.common.lerp(1, endScale, 2 / 3);", - " bezier.p[3] = endScale;", - " }", - "", - " /**", - " * @param startSpeedMin {number}", - " */", - " setStartSpeedMin(startSpeedMin) {", - " this.particleSystem.startSpeed.a = startSpeedMin;", - " }", - "", - " /**", - " * @param startSpeedMax {number}", - " */", - " setStartSpeedMax(startSpeedMax) {", - " this.particleSystem.startSpeed.b = startSpeedMax;", - " }", - "", - " /**", - " * @param lifespanMin {number}", - " */", - " setLifespanMin(lifespanMin) {", - " this.particleSystem.startLife.a = lifespanMin;", - " }", - "", - " /**", - " * @param lifespanMax {number}", - " */", - " setLifespanMax(lifespanMax) {", - " this.particleSystem.startLife.b = lifespanMax;", - " }", - "", - " /**", - " * @param duration {number}", - " */", - " setDuration(duration) {", - " this.particleSystem.duration = duration || Number.POSITIVE_INFINITY;", - " }", - "", - " /**", - " * @param areParticlesRelative {boolean}", - " */", - " setParticlesRelative(areParticlesRelative) {", - " this.particleSystem.worldSpace = !areParticlesRelative;", - " }", - "", - " /**", - " * @param sprayConeAngle {number}", - " */", - " setSprayConeAngle(sprayConeAngle) {", - " if (0 < sprayConeAngle && sprayConeAngle <= 180) {", - " if (!this.particleSystem.emitterShape.angle) {", - " this.particleSystem.emitterShape = new ConeEmitter({ radius: 0.1, angle: Math.PI / 8 });", - " }", - " this.particleSystem.emitterShape.angle = sprayConeAngle * Math.PI / 180;", - " }", - " else {", - " if (this.particleSystem.emitterShape.angle) {", - " this.particleSystem.emitterShape = new PointEmitter();", - " }", - " }", - " }", - "", - " /**", - " * @param blending {string}", - " */", - " setBlending(blendingString) {", - " const blending =", - " blendingString === \"Additive\" ? THREE.AdditiveBlending :", - " blendingString === \"Normal\" ? THREE.NormalBlending :", - " blendingString === \"Subtractive\" ? THREE.SubtractiveBlending :", - " blendingString === \"Multiply\" ? THREE.MultiplyBlending :", - " blendingString === \"None\" ? THREE.NoBlending :", - " THREE.AdditiveBlending;", - " // TODO This doesn't work.", - " this.particleSystem.blending = blending;", - " }", - "", - " /**", - " * @param gravity {number}", - " */", - " setGravity(gravity) {", - " this.applyForce.magnitude.value = gravity;", - " }", - "", - " /**", - " * @param gravityTop {string}", - " */", - " setGravityTop(gravityTop) {", - " // TODO Make gravity absolute even when \"relative\" is enabled. ", - " switch (gravityTop) {", - " case \"Z+\":", - " this.applyForce.direction.set(0, 0, -1);", - " break;", - "", - " case \"Y-\":", - " this.applyForce.direction.set(0, 1, 0);", - " break;", - " }", - " }", - "", - " setImage(resourceName) {", - " const texture = game.getImageManager().getThreeTexture(resourceName);", - " this.particleSystem.texture = texture;", - " }", - "}", - "", - "", - "", - "/**", - " * three.quarks v0.11.2 build Mon Jan 22 2024", - " * https://github.com/Alchemist0823/three.quarks#readme", - " * Copyright 2024 Alchemist0823 , MIT", - " */", - "", - "// The migration to addUpdateRange was backported without updating the library", - "// because GDevelop still uses Three.js 0.160.0.", - "", - "class ParticleEmitter extends THREE.Object3D {", - " constructor(system) {", - " super();", - " this.type = 'ParticleEmitter';", - " this.system = system;", - " }", - " clone() {", - " const system = this.system.clone();", - " system.emitter.copy(this, true);", - " return system.emitter;", - " }", - " dispose() { }", - " extractFromCache(cache) {", - " const values = [];", - " for (const key in cache) {", - " const data = cache[key];", - " delete data.metadata;", - " values.push(data);", - " }", - " return values;", - " }", - " toJSON(meta, options = {}) {", - " const isRootObject = meta === undefined || typeof meta === 'string';", - " const output = {};", - " if (isRootObject) {", - " meta = {", - " geometries: {},", - " materials: {},", - " textures: {},", - " images: {},", - " shapes: {},", - " skeletons: {},", - " animations: {},", - " nodes: {},", - " };", - " output.metadata = {", - " version: 4.5,", - " type: 'Object',", - " generator: 'Object3D.toJSON',", - " };", - " }", - " const object = {};", - " object.uuid = this.uuid;", - " object.type = this.type;", - " if (this.name !== '')", - " object.name = this.name;", - " if (this.castShadow === true)", - " object.castShadow = true;", - " if (this.receiveShadow === true)", - " object.receiveShadow = true;", - " if (this.visible === false)", - " object.visible = false;", - " if (this.frustumCulled === false)", - " object.frustumCulled = false;", - " if (this.renderOrder !== 0)", - " object.renderOrder = this.renderOrder;", - " if (JSON.stringify(this.userData) !== '{}')", - " object.userData = this.userData;", - " object.layers = this.layers.mask;", - " object.matrix = this.matrix.toArray();", - " if (this.matrixAutoUpdate === false)", - " object.matrixAutoUpdate = false;", - " if (this.system !== null)", - " object.ps = this.system.toJSON(meta, options);", - " if (this.children.length > 0) {", - " object.children = [];", - " for (let i = 0; i < this.children.length; i++) {", - " if (this.children[i].type !== 'ParticleSystemPreview') {", - " object.children.push(this.children[i].toJSON(meta).object);", - " }", - " }", - " }", - " if (isRootObject) {", - " const geometries = this.extractFromCache(meta.geometries);", - " const materials = this.extractFromCache(meta.materials);", - " const textures = this.extractFromCache(meta.textures);", - " const images = this.extractFromCache(meta.images);", - " if (geometries.length > 0)", - " output.geometries = geometries;", - " if (materials.length > 0)", - " output.materials = materials;", - " if (textures.length > 0)", - " output.textures = textures;", - " if (images.length > 0)", - " output.images = images;", - " }", - " output.object = object;", - " return output;", - " }", - "}", - "", - "class LinkedListNode {", - " constructor(data) {", - " this.data = data;", - " this.next = null;", - " this.prev = null;", - " }", - " hasPrev() {", - " return this.prev !== null;", - " }", - " hasNext() {", - " return this.next !== null;", - " }", - "}", - "class LinkedList {", - " constructor() {", - " this.length = 0;", - " this.head = this.tail = null;", - " }", - " isEmpty() {", - " return this.head === null;", - " }", - " clear() {", - " this.length = 0;", - " this.head = this.tail = null;", - " }", - " front() {", - " if (this.head === null)", - " return null;", - " return this.head.data;", - " }", - " back() {", - " if (this.tail === null)", - " return null;", - " return this.tail.data;", - " }", - " dequeue() {", - " if (this.head) {", - " const value = this.head.data;", - " this.head = this.head.next;", - " if (!this.head) {", - " this.tail = null;", - " }", - " else {", - " this.head.prev = null;", - " }", - " this.length--;", - " return value;", - " }", - " return undefined;", - " }", - " pop() {", - " if (this.tail) {", - " const value = this.tail.data;", - " this.tail = this.tail.prev;", - " if (!this.tail) {", - " this.head = null;", - " }", - " else {", - " this.tail.next = null;", - " }", - " this.length--;", - " return value;", - " }", - " return undefined;", - " }", - " queue(data) {", - " const node = new LinkedListNode(data);", - " if (!this.tail) {", - " this.tail = node;", - " }", - " if (this.head) {", - " this.head.prev = node;", - " node.next = this.head;", - " }", - " this.head = node;", - " this.length++;", - " }", - " push(data) {", - " const node = new LinkedListNode(data);", - " if (!this.head) {", - " this.head = node;", - " }", - " if (this.tail) {", - " this.tail.next = node;", - " node.prev = this.tail;", - " }", - " this.tail = node;", - " this.length++;", - " }", - " insertBefore(node, data) {", - " const newNode = new LinkedListNode(data);", - " newNode.next = node;", - " newNode.prev = node.prev;", - " if (newNode.prev !== null) {", - " newNode.prev.next = newNode;", - " }", - " newNode.next.prev = newNode;", - " if (node == this.head) {", - " this.head = newNode;", - " }", - " this.length++;", - " }", - " remove(data) {", - " if (this.head === null || this.tail === null) {", - " return;", - " }", - " let tempNode = this.head;", - " if (data === this.head.data) {", - " this.head = this.head.next;", - " }", - " if (data === this.tail.data) {", - " this.tail = this.tail.prev;", - " }", - " while (tempNode.next !== null && tempNode.data !== data) {", - " tempNode = tempNode.next;", - " }", - " if (tempNode.data === data) {", - " if (tempNode.prev !== null)", - " tempNode.prev.next = tempNode.next;", - " if (tempNode.next !== null)", - " tempNode.next.prev = tempNode.prev;", - " this.length--;", - " }", - " }", - " *values() {", - " let current = this.head;", - " while (current !== null) {", - " yield current.data;", - " current = current.next;", - " }", - " }", - "}", - "", - "class NodeParticle {", - " constructor() {", - " this.position = new THREE.Vector3();", - " this.velocity = new THREE.Vector3();", - " this.age = 0;", - " this.life = 1;", - " this.size = 1;", - " this.rotation = 0;", - " this.color = new THREE.Vector4(1, 1, 1, 1);", - " this.uvTile = 0;", - " }", - " get died() {", - " return this.age >= this.life;", - " }", - " reset() {", - " this.position.set(0, 0, 0);", - " this.velocity.set(0, 0, 0);", - " this.age = 0;", - " this.life = 1;", - " this.size = 1;", - " this.rotation = 0;", - " this.color.set(1, 1, 1, 1);", - " this.uvTile = 0;", - " }", - "}", - "class SpriteParticle {", - " constructor() {", - " this.startSpeed = 0;", - " this.startColor = new THREE.Vector4();", - " this.startSize = 1;", - " this.position = new THREE.Vector3();", - " this.velocity = new THREE.Vector3();", - " this.age = 0;", - " this.life = 1;", - " this.size = 1;", - " this.speedModifier = 1;", - " this.rotation = 0;", - " this.color = new THREE.Vector4();", - " this.uvTile = 0;", - " }", - " get died() {", - " return this.age >= this.life;", - " }", - "}", - "class RecordState {", - " constructor(position, size, color) {", - " this.position = position;", - " this.size = size;", - " this.color = color;", - " }", - "}", - "class TrailParticle {", - " constructor() {", - " this.startSpeed = 0;", - " this.startColor = new THREE.Vector4();", - " this.startSize = 1;", - " this.position = new THREE.Vector3();", - " this.velocity = new THREE.Vector3();", - " this.age = 0;", - " this.life = 1;", - " this.size = 1;", - " this.length = 100;", - " this.speedModifier = 1;", - " this.color = new THREE.Vector4();", - " this.previous = new LinkedList();", - " this.uvTile = 0;", - " }", - " update() {", - " if (this.age <= this.life) {", - " this.previous.push(new RecordState(this.position.clone(), this.size, this.color.clone()));", - " }", - " else {", - " if (this.previous.length > 0) {", - " this.previous.dequeue();", - " }", - " }", - " while (this.previous.length > this.length) {", - " this.previous.dequeue();", - " }", - " }", - " get died() {", - " return this.age >= this.life;", - " }", - " reset() {", - " this.previous.clear();", - " }", - "}", - "", - "class Bezier {", - " constructor(p1, p2, p3, p4) {", - " this.p = [p1, p2, p3, p4];", - " }", - " genValue(t) {", - " const t2 = t * t;", - " const t3 = t * t * t;", - " const mt = 1 - t;", - " const mt2 = mt * mt;", - " const mt3 = mt2 * mt;", - " return this.p[0] * mt3 + this.p[1] * mt2 * t * 3 + this.p[2] * mt * t2 * 3 + this.p[3] * t3;", - " }", - " derivativeCoefficients(points) {", - " const dpoints = [];", - " for (let p = points, c = p.length - 1; c > 0; c--) {", - " const list = [];", - " for (let j = 0; j < c; j++) {", - " const dpt = c * (p[j + 1] - p[j]);", - " list.push(dpt);", - " }", - " dpoints.push(list);", - " p = list;", - " }", - " return dpoints;", - " }", - " getSlope(t) {", - " const p = this.derivativeCoefficients(this.p)[0];", - " const mt = 1 - t;", - " const a = mt * mt;", - " const b = mt * t * 2;", - " const c = t * t;", - " return a * p[0] + b * p[1] + c * p[2];", - " }", - " controlCurve(d0, d1) {", - " this.p[1] = d0 / 3 + this.p[0];", - " this.p[2] = this.p[3] - d1 / 3;", - " }", - " hull(t) {", - " let p = this.p;", - " let _p = [], pt, idx = 0, i = 0, l = 0;", - " const q = [];", - " q[idx++] = p[0];", - " q[idx++] = p[1];", - " q[idx++] = p[2];", - " q[idx++] = p[3];", - " while (p.length > 1) {", - " _p = [];", - " for (i = 0, l = p.length - 1; i < l; i++) {", - " pt = t * p[i] + (1 - t) * p[i + 1];", - " q[idx++] = pt;", - " _p.push(pt);", - " }", - " p = _p;", - " }", - " return q;", - " }", - " split(t) {", - " const q = this.hull(t);", - " const result = {", - " left: new Bezier(q[0], q[4], q[7], q[9]),", - " right: new Bezier(q[9], q[8], q[6], q[3]),", - " span: q", - " };", - " return result;", - " }", - " clone() {", - " return new Bezier(this.p[0], this.p[1], this.p[2], this.p[3]);", - " }", - " toJSON() {", - " return {", - " p0: this.p[0],", - " p1: this.p[1],", - " p2: this.p[2],", - " p3: this.p[3],", - " };", - " }", - " static fromJSON(json) {", - " return new Bezier(json.p0, json.p1, json.p2, json.p3);", - " }", - "}", - "", - "const ColorToJSON = (color) => {", - " return { r: color.x, g: color.y, b: color.z, a: color.w };", - "};", - "const JSONToColor = (json) => {", - " return new THREE.Vector4(json.r, json.g, json.b, json.a);", - "};", - "const JSONToValue = (json, type) => {", - " switch (type) {", - " case 'Vector3':", - " return new THREE.Vector3(json.x, json.y, json.z);", - " case 'Vector4':", - " return new THREE.Vector4(json.x, json.y, json.z, json.w);", - " case 'Color':", - " return new THREE.Vector3(json.r, json.g, json.b);", - " case 'Number':", - " return json;", - " default:", - " return json;", - " }", - "};", - "const ValueToJSON = (value, type) => {", - " switch (type) {", - " case 'Vector3':", - " return { x: value.x, y: value.y, z: value.z };", - " case 'Vector4':", - " return { x: value.x, y: value.y, z: value.z, w: value.w };", - " case 'Color':", - " return { r: value.x, g: value.y, b: value.z };", - " case 'Number':", - " return value;", - " default:", - " return value;", - " }", - "};", - "", - "class RandomColor {", - " constructor(a, b) {", - " this.a = a;", - " this.b = b;", - " this.type = \"value\";", - " }", - " genColor(color) {", - " const rand = Math.random();", - " return color.copy(this.a).lerp(this.b, rand);", - " }", - " toJSON() {", - " return {", - " type: \"RandomColor\",", - " a: ColorToJSON(this.a),", - " b: ColorToJSON(this.b),", - " };", - " }", - " static fromJSON(json) {", - " return new RandomColor(JSONToColor(json.a), JSONToColor(json.b));", - " }", - " clone() {", - " return new RandomColor(this.a.clone(), this.b.clone());", - " }", - "}", - "", - "class ColorRange {", - " constructor(a, b) {", - " this.a = a;", - " this.b = b;", - " this.type = 'value';", - " }", - " genColor(color, t) {", - " return color.copy(this.a).lerp(this.b, Math.random());", - " }", - " toJSON() {", - " return {", - " type: 'ColorRange',", - " a: ColorToJSON(this.a),", - " b: ColorToJSON(this.b),", - " };", - " }", - " static fromJSON(json) {", - " return new ColorRange(JSONToColor(json.a), JSONToColor(json.b));", - " }", - " clone() {", - " return new ColorRange(this.a.clone(), this.b.clone());", - " }", - "}", - "", - "class ContinuousLinearFunction {", - " constructor(keys, subType) {", - " this.subType = subType;", - " this.type = 'function';", - " this.keys = keys;", - " }", - " findKey(t) {", - " let mid = 0;", - " let left = 0, right = this.keys.length - 1;", - " while (left + 1 < right) {", - " mid = Math.floor((left + right) / 2);", - " if (t < this.getStartX(mid))", - " right = mid - 1;", - " else if (t > this.getEndX(mid))", - " left = mid + 1;", - " else", - " return mid;", - " }", - " for (let i = left; i <= right; i++) {", - " if (t >= this.getStartX(i) && t <= this.getEndX(i))", - " return i;", - " }", - " return -1;", - " }", - " getStartX(index) {", - " return this.keys[index][1];", - " }", - " getEndX(index) {", - " if (index + 1 < this.keys.length)", - " return this.keys[index + 1][1];", - " return 1;", - " }", - " genValue(value, t) {", - " const index = this.findKey(t);", - " if (this.subType === 'Number') {", - " if (index === -1) {", - " return this.keys[0][0];", - " }", - " else if (index + 1 >= this.keys.length) {", - " return this.keys[this.keys.length - 1][0];", - " }", - " return ((this.keys[index + 1][0] - this.keys[index][0]) *", - " ((t - this.getStartX(index)) / (this.getEndX(index) - this.getStartX(index))) +", - " this.keys[index][0]);", - " }", - " else {", - " if (index === -1) {", - " return value.copy(this.keys[0][0]);", - " }", - " if (index + 1 >= this.keys.length) {", - " return value.copy(this.keys[this.keys.length - 1][0]);", - " }", - " return value", - " .copy(this.keys[index][0])", - " .lerp(this.keys[index + 1][0], (t - this.getStartX(index)) / (this.getEndX(index) - this.getStartX(index)));", - " }", - " }", - " toJSON() {", - " this.keys[0][0].constructor.name;", - " return {", - " type: 'CLinearFunction',", - " subType: this.subType,", - " keys: this.keys.map(([color, pos]) => ({ value: ValueToJSON(color, this.subType), pos: pos })),", - " };", - " }", - " static fromJSON(json) {", - " return new ContinuousLinearFunction(json.keys.map((pair) => [JSONToValue(pair.value, json.subType), pair.pos]), json.subType);", - " }", - " clone() {", - " if (this.subType === 'Number') {", - " return new ContinuousLinearFunction(this.keys.map(([value, pos]) => [value, pos]), this.subType);", - " }", - " else {", - " return new ContinuousLinearFunction(this.keys.map(([value, pos]) => [value.clone(), pos]), this.subType);", - " }", - " }", - "}", - "", - "const tempVec3 = new THREE.Vector3();", - "class Gradient {", - " constructor(color = [", - " [new THREE.Vector3(0, 0, 0), 0],", - " [new THREE.Vector3(1, 1, 1), 0],", - " ], alpha = [", - " [1, 0],", - " [1, 1],", - " ]) {", - " this.type = 'function';", - " this.color = new ContinuousLinearFunction(color, 'Color');", - " this.alpha = new ContinuousLinearFunction(alpha, 'Number');", - " }", - " genColor(color, t) {", - " this.color.genValue(tempVec3, t);", - " return color.set(tempVec3.x, tempVec3.y, tempVec3.z, this.alpha.genValue(1, t));", - " }", - " toJSON() {", - " return {", - " type: 'Gradient',", - " color: this.color.toJSON(),", - " alpha: this.alpha.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " if (json.functions) {", - " const keys = json.functions.map((func) => [ColorRange.fromJSON(func.function).a, func.start]);", - " if (json.functions.length > 0) {", - " keys.push([ColorRange.fromJSON(json.functions[json.functions.length - 1].function).b, 1]);", - " }", - " return new Gradient(keys.map((key) => [new THREE.Vector3(key[0].x, key[0].y, key[0].z), key[1]]), keys.map((key) => [key[0].w, key[1]]));", - " }", - " else {", - " const gradient = new Gradient();", - " gradient.alpha = ContinuousLinearFunction.fromJSON(json.alpha);", - " gradient.color = ContinuousLinearFunction.fromJSON(json.color);", - " return gradient;", - " }", - " }", - " clone() {", - " const gradient = new Gradient();", - " gradient.alpha = this.alpha.clone();", - " gradient.color = this.color.clone();", - " return gradient;", - " }", - "}", - "", - "const tempColor = new THREE.Vector4();", - "class RandomColorBetweenGradient {", - " constructor(gradient1, gradient2) {", - " this.type = 'memorizedFunction';", - " this.gradient1 = gradient1;", - " this.gradient2 = gradient2;", - " }", - " startGen(memory) {", - " memory.rand = Math.random();", - " }", - " genColor(color, t, memory) {", - " this.gradient1.genColor(color, t);", - " this.gradient2.genColor(tempColor, t);", - " if (memory && memory.rand) {", - " color.lerp(tempColor, memory.rand);", - " }", - " else {", - " color.lerp(tempColor, Math.random());", - " }", - " return color;", - " }", - " toJSON() {", - " return {", - " type: 'RandomColorBetweenGradient',", - " gradient1: this.gradient1.toJSON(),", - " gradient2: this.gradient2.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new RandomColorBetweenGradient(Gradient.fromJSON(json.gradient1), Gradient.fromJSON(json.gradient2));", - " }", - " clone() {", - " return new RandomColorBetweenGradient(this.gradient1.clone(), this.gradient2.clone());", - " }", - "}", - "", - "class ConstantColor {", - " constructor(color) {", - " this.color = color;", - " this.type = 'value';", - " }", - " genColor(color) {", - " return color.copy(this.color);", - " }", - " toJSON() {", - " return {", - " type: 'ConstantColor',", - " color: ColorToJSON(this.color),", - " };", - " }", - " static fromJSON(json) {", - " return new ConstantColor(JSONToColor(json.color));", - " }", - " clone() {", - " return new ConstantColor(this.color.clone());", - " }", - "}", - "function ColorGeneratorFromJSON(json) {", - " switch (json.type) {", - " case 'ConstantColor':", - " return ConstantColor.fromJSON(json);", - " case 'ColorRange':", - " return ColorRange.fromJSON(json);", - " case 'RandomColor':", - " return RandomColor.fromJSON(json);", - " case 'Gradient':", - " return Gradient.fromJSON(json);", - " case 'RandomColorBetweenGradient':", - " return RandomColorBetweenGradient.fromJSON(json);", - " default:", - " return new ConstantColor(new THREE.Vector4(1, 1, 1, 1));", - " }", - "}", - "", - "class ConstantValue {", - " constructor(value) {", - " this.value = value;", - " this.type = 'value';", - " }", - " genValue() {", - " return this.value;", - " }", - " toJSON() {", - " return {", - " type: \"ConstantValue\",", - " value: this.value", - " };", - " }", - " static fromJSON(json) {", - " return new ConstantValue(json.value);", - " }", - " clone() {", - " return new ConstantValue(this.value);", - " }", - "}", - "", - "class IntervalValue {", - " constructor(a, b) {", - " this.a = a;", - " this.b = b;", - " this.type = 'value';", - " }", - " genValue() {", - " return THREE.MathUtils.lerp(this.a, this.b, Math.random());", - " }", - " toJSON() {", - " return {", - " type: 'IntervalValue',", - " a: this.a,", - " b: this.b,", - " };", - " }", - " static fromJSON(json) {", - " return new IntervalValue(json.a, json.b);", - " }", - " clone() {", - " return new IntervalValue(this.a, this.b);", - " }", - "}", - "", - "class PiecewiseFunction {", - " constructor() {", - " this.functions = new Array();", - " }", - " findFunction(t) {", - " let mid = 0;", - " let left = 0, right = this.functions.length - 1;", - " while (left + 1 < right) {", - " mid = Math.floor((left + right) / 2);", - " if (t < this.getStartX(mid))", - " right = mid - 1;", - " else if (t > this.getEndX(mid))", - " left = mid + 1;", - " else", - " return mid;", - " }", - " for (let i = left; i <= right; i++) {", - " if (t >= this.functions[i][1] && t <= this.getEndX(i))", - " return i;", - " }", - " return -1;", - " }", - " getStartX(index) {", - " return this.functions[index][1];", - " }", - " setStartX(index, x) {", - " if (index > 0)", - " this.functions[index][1] = x;", - " }", - " getEndX(index) {", - " if (index + 1 < this.functions.length)", - " return this.functions[index + 1][1];", - " return 1;", - " }", - " setEndX(index, x) {", - " if (index + 1 < this.functions.length)", - " this.functions[index + 1][1] = x;", - " }", - " insertFunction(t, func) {", - " const index = this.findFunction(t);", - " this.functions.splice(index + 1, 0, [func, t]);", - " }", - " removeFunction(index) {", - " return this.functions.splice(index, 1)[0][0];", - " }", - " getFunction(index) {", - " return this.functions[index][0];", - " }", - " setFunction(index, func) {", - " this.functions[index][0] = func;", - " }", - " get numOfFunctions() {", - " return this.functions.length;", - " }", - "}", - "", - "class PiecewiseBezier extends PiecewiseFunction {", - " constructor(curves = [[new Bezier(0, 1.0 / 3, 1.0 / 3 * 2, 1), 0]]) {", - " super();", - " this.type = \"function\";", - " this.functions = curves;", - " }", - " genValue(t = 0) {", - " const index = this.findFunction(t);", - " if (index === -1) {", - " return 0;", - " }", - " return this.functions[index][0].genValue((t - this.getStartX(index)) / (this.getEndX(index) - this.getStartX(index)));", - " }", - " toSVG(length, segments) {", - " if (segments < 1)", - " return \"\";", - " let result = [\"M\", 0, this.functions[0][0].p[0]].join(\" \");", - " for (let i = 1.0 / segments; i <= 1; i += 1.0 / segments) {", - " result = [result, \"L\", i * length, this.genValue(i)].join(\" \");", - " }", - " return result;", - " }", - " toJSON() {", - " return {", - " type: \"PiecewiseBezier\",", - " functions: this.functions.map(([bezier, start]) => ({ function: bezier.toJSON(), start: start })),", - " };", - " }", - " static fromJSON(json) {", - " return new PiecewiseBezier(json.functions.map((piecewiseFunction) => ([Bezier.fromJSON(piecewiseFunction.function), piecewiseFunction.start])));", - " }", - " clone() {", - " return new PiecewiseBezier(this.functions.map(([bezier, start]) => ([bezier.clone(), start])));", - " }", - "}", - "", - "function ValueGeneratorFromJSON(json) {", - " switch (json.type) {", - " case 'ConstantValue':", - " return ConstantValue.fromJSON(json);", - " case 'IntervalValue':", - " return IntervalValue.fromJSON(json);", - " case 'PiecewiseBezier':", - " return PiecewiseBezier.fromJSON(json);", - " default:", - " return new ConstantValue(0);", - " }", - "}", - "", - "class RandomQuatGenerator {", - " constructor() {", - " this.type = \"rotation\";", - " }", - " genValue(quat, t) {", - " let x, y, z, u, v, w;", - " do {", - " x = Math.random() * 2 - 1;", - " y = Math.random() * 2 - 1;", - " z = x * x + y * y;", - " } while (z > 1);", - " do {", - " u = Math.random() * 2 - 1;", - " v = Math.random() * 2 - 1;", - " w = u * u + v * v;", - " } while (w > 1);", - " const s = Math.sqrt((1 - z) / w);", - " quat.set(x, y, s * u, s * v);", - " return quat;", - " }", - " toJSON() {", - " return {", - " type: \"RandomQuat\"", - " };", - " }", - " static fromJSON(json) {", - " return new RandomQuatGenerator();", - " }", - " clone() {", - " return new RandomQuatGenerator();", - " }", - "}", - "", - "class AxisAngleGenerator {", - " constructor(axis, angle) {", - " this.axis = axis;", - " this.angle = angle;", - " this.type = 'rotation';", - " }", - " genValue(quat, t) {", - " return quat.setFromAxisAngle(this.axis, this.angle.genValue(t));", - " }", - " toJSON() {", - " return {", - " type: 'AxisAngle',", - " axis: { x: this.axis.x, y: this.axis.y, z: this.axis.z },", - " angle: this.angle.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new AxisAngleGenerator(new THREE.Vector3(json.axis.x, json.axis.y, json.axis.z), ValueGeneratorFromJSON(json.angle));", - " }", - " clone() {", - " return new AxisAngleGenerator(this.axis.clone(), this.angle.clone());", - " }", - "}", - "", - "class EulerGenerator {", - " constructor(angleX, angleY, angleZ, eulerOrder) {", - " this.angleX = angleX;", - " this.angleY = angleY;", - " this.angleZ = angleZ;", - " this.type = 'rotation';", - " this.eular = new THREE.Euler(0, 0, 0, eulerOrder);", - " }", - " genValue(quat, t) {", - " this.eular.set(this.angleX.genValue(t), this.angleY.genValue(t), this.angleZ.genValue(t));", - " return quat.setFromEuler(this.eular);", - " }", - " toJSON() {", - " return {", - " type: 'Euler',", - " angleX: this.angleX.toJSON(),", - " angleY: this.angleY.toJSON(),", - " angleZ: this.angleZ.toJSON(),", - " eulerOrder: this.eular.order,", - " };", - " }", - " static fromJSON(json) {", - " return new EulerGenerator(ValueGeneratorFromJSON(json.angleX), ValueGeneratorFromJSON(json.angleY), ValueGeneratorFromJSON(json.angleZ), json.eulerOrder);", - " }", - " clone() {", - " return new EulerGenerator(this.angleX, this.angleY, this.angleZ, this.eular.order);", - " }", - "}", - "", - "function RotationGeneratorFromJSON(json) {", - " switch (json.type) {", - " case 'AxisAngle':", - " return AxisAngleGenerator.fromJSON(json);", - " case 'Euler':", - " return EulerGenerator.fromJSON(json);", - " case 'RandomQuat':", - " return RandomQuatGenerator.fromJSON(json);", - " default:", - " return new RandomQuatGenerator();", - " }", - "}", - "", - "function GeneratorFromJSON(json) {", - " switch (json.type) {", - " case 'ConstantValue':", - " case 'IntervalValue':", - " case 'PiecewiseBezier':", - " return ValueGeneratorFromJSON(json);", - " case 'AxisAngle':", - " case 'RandomQuat':", - " case 'Euler':", - " return RotationGeneratorFromJSON(json);", - " default:", - " return new ConstantValue(0);", - " }", - "}", - "", - "class ColorOverLife {", - " constructor(color) {", - " this.color = color;", - " this.type = 'ColorOverLife';", - " }", - " initialize(particle) {", - " if (this.color.type === 'memorizedFunction') {", - " particle.colorOverLifeMemory = {};", - " this.color.startGen(particle.colorOverLifeMemory);", - " }", - " }", - " update(particle, delta) {", - " if (this.color.type === 'memorizedFunction') {", - " this.color.genColor(particle.color, particle.age / particle.life, particle.colorOverLifeMemory);", - " }", - " else {", - " this.color.genColor(particle.color, particle.age / particle.life);", - " }", - " particle.color.x *= particle.startColor.x;", - " particle.color.y *= particle.startColor.y;", - " particle.color.z *= particle.startColor.z;", - " particle.color.w *= particle.startColor.w;", - " }", - " frameUpdate(delta) { }", - " toJSON() {", - " return {", - " type: this.type,", - " color: this.color.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new ColorOverLife(ColorGeneratorFromJSON(json.color));", - " }", - " clone() {", - " return new ColorOverLife(this.color.clone());", - " }", - " reset() { }", - "}", - "", - "class RotationOverLife {", - " constructor(angularVelocity) {", - " this.angularVelocity = angularVelocity;", - " this.type = 'RotationOverLife';", - " this.dynamic = !(angularVelocity instanceof ConstantValue || angularVelocity instanceof IntervalValue);", - " }", - " initialize(particle) {", - " this.dynamic = !(this.angularVelocity instanceof ConstantValue || this.angularVelocity instanceof IntervalValue);", - " if (!this.dynamic && typeof particle.rotation === 'number') {", - " particle.angularVelocity = this.angularVelocity.genValue();", - " }", - " }", - " update(particle, delta) {", - " if (!this.dynamic) {", - " if (typeof particle.rotation === 'number') {", - " particle.rotation += delta * particle.angularVelocity;", - " }", - " }", - " else {", - " if (typeof particle.rotation === 'number') {", - " particle.rotation +=", - " delta * this.angularVelocity.genValue(particle.age / particle.life);", - " }", - " }", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " angularVelocity: this.angularVelocity.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new RotationOverLife(ValueGeneratorFromJSON(json.angularVelocity));", - " }", - " frameUpdate(delta) { }", - " clone() {", - " return new RotationOverLife(this.angularVelocity.clone());", - " }", - " reset() { }", - "}", - "", - "const IdentityQuaternion = new THREE.Quaternion();", - "class Rotation3DOverLife {", - " constructor(angularVelocity) {", - " this.angularVelocity = angularVelocity;", - " this.type = 'Rotation3DOverLife';", - " this.tempQuat = new THREE.Quaternion();", - " this.dynamic = !(angularVelocity instanceof RandomQuatGenerator);", - " }", - " initialize(particle) {", - " this.dynamic = !(this.angularVelocity instanceof RandomQuatGenerator);", - " if (particle.rotation instanceof THREE.Quaternion) {", - " particle.angularVelocity = new THREE.Quaternion();", - " this.angularVelocity.genValue(particle.angularVelocity);", - " }", - " }", - " update(particle, delta) {", - " if (particle.rotation instanceof THREE.Quaternion) {", - " if (!this.dynamic) {", - " this.tempQuat.slerpQuaternions(IdentityQuaternion, particle.angularVelocity, delta);", - " particle.rotation.multiply(this.tempQuat);", - " }", - " else {", - " this.angularVelocity.genValue(this.tempQuat, particle.age / particle.life);", - " this.tempQuat.slerpQuaternions(IdentityQuaternion, this.tempQuat, delta);", - " particle.rotation.multiply(this.tempQuat);", - " }", - " }", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " angularVelocity: this.angularVelocity.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new Rotation3DOverLife(RotationGeneratorFromJSON(json.angularVelocity));", - " }", - " frameUpdate(delta) { }", - " clone() {", - " return new Rotation3DOverLife(this.angularVelocity.clone());", - " }", - " reset() { }", - "}", - "", - "class ForceOverLife {", - " initialize(particle) { }", - " constructor(x, y, z) {", - " this.x = x;", - " this.y = y;", - " this.z = z;", - " this.type = 'ForceOverLife';", - " this._temp = new THREE.Vector3();", - " }", - " update(particle, delta) {", - " this._temp.set(this.x.genValue(particle.age / particle.life), this.y.genValue(particle.age / particle.life), this.z.genValue(particle.age / particle.life));", - " particle.velocity.addScaledVector(this._temp, delta);", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " x: this.x.toJSON(),", - " y: this.y.toJSON(),", - " z: this.z.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new ForceOverLife(ValueGeneratorFromJSON(json.x), ValueGeneratorFromJSON(json.y), ValueGeneratorFromJSON(json.z));", - " }", - " frameUpdate(delta) { }", - " clone() {", - " return new ForceOverLife(this.x.clone(), this.y.clone(), this.z.clone());", - " }", - " reset() { }", - "}", - "", - "class SizeOverLife {", - " initialize(particle) {", - " }", - " constructor(size) {", - " this.size = size;", - " this.type = 'SizeOverLife';", - " }", - " update(particle) {", - " particle.size = particle.startSize * this.size.genValue(particle.age / particle.life);", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " size: this.size.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new SizeOverLife(ValueGeneratorFromJSON(json.size));", - " }", - " frameUpdate(delta) {", - " }", - " clone() {", - " return new SizeOverLife(this.size.clone());", - " }", - " reset() {", - " }", - "}", - "", - "class SpeedOverLife {", - " initialize(particle) {", - " }", - " constructor(speed) {", - " this.speed = speed;", - " this.type = 'SpeedOverLife';", - " }", - " update(particle) {", - " particle.speedModifier = this.speed.genValue(particle.age / particle.life);", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " speed: this.speed.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new SpeedOverLife(ValueGeneratorFromJSON(json.speed));", - " }", - " frameUpdate(delta) {", - " }", - " clone() {", - " return new SpeedOverLife(this.speed.clone());", - " }", - " reset() {", - " }", - "}", - "", - "class FrameOverLife {", - " constructor(frame) {", - " this.frame = frame;", - " this.type = 'FrameOverLife';", - " }", - " initialize(particle) {", - " if (!(this.frame instanceof PiecewiseBezier)) {", - " particle.uvTile = Math.floor(this.frame.genValue(0) + 0.001);", - " }", - " }", - " update(particle, delta) {", - " if (this.frame instanceof PiecewiseBezier) {", - " particle.uvTile = Math.floor(this.frame.genValue(particle.age / particle.life) + 0.001);", - " }", - " }", - " frameUpdate(delta) { }", - " toJSON() {", - " return {", - " type: this.type,", - " frame: this.frame.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new FrameOverLife(ValueGeneratorFromJSON(json.frame));", - " }", - " clone() {", - " return new FrameOverLife(this.frame.clone());", - " }", - " reset() { }", - "}", - "", - "new THREE.Vector3(0, 0, 1);", - "class OrbitOverLife {", - " constructor(orbitSpeed, axis = new THREE.Vector3(0, 1, 0)) {", - " this.orbitSpeed = orbitSpeed;", - " this.axis = axis;", - " this.type = 'OrbitOverLife';", - " this.temp = new THREE.Vector3();", - " this.rotation = new THREE.Quaternion();", - " this.line = new THREE.Line3();", - " }", - " initialize(particle) {", - " }", - " update(particle, delta) {", - " this.line.set(new THREE.Vector3(0, 0, 0), this.axis);", - " this.line.closestPointToPoint(particle.position, false, this.temp);", - " this.rotation.setFromAxisAngle(this.axis, this.orbitSpeed.genValue(particle.age / particle.life) * delta);", - " particle.position.sub(this.temp);", - " particle.position.applyQuaternion(this.rotation);", - " particle.position.add(this.temp);", - " }", - " frameUpdate(delta) {", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " orbitSpeed: this.orbitSpeed.toJSON(),", - " axis: [this.axis.x, this.axis.y, this.axis.z],", - " };", - " }", - " static fromJSON(json) {", - " return new OrbitOverLife(ValueGeneratorFromJSON(json.orbitSpeed), json.axis ? new THREE.Vector3(json.axis[0], json.axis[1], json.axis[2]) : undefined);", - " }", - " clone() {", - " return new OrbitOverLife(this.orbitSpeed.clone());", - " }", - " reset() {", - " }", - "}", - "", - "class WidthOverLength {", - " initialize(particle) {", - " }", - " constructor(width) {", - " this.width = width;", - " this.type = 'WidthOverLength';", - " }", - " update(particle) {", - " if (particle instanceof TrailParticle) {", - " const iter = particle.previous.values();", - " for (let i = 0; i < particle.previous.length; i++) {", - " const cur = iter.next();", - " cur.value.size = this.width.genValue((particle.previous.length - i) / particle.length);", - " }", - " }", - " }", - " frameUpdate(delta) {", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " width: this.width.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new WidthOverLength(ValueGeneratorFromJSON(json.width));", - " }", - " clone() {", - " return new WidthOverLength(this.width.clone());", - " }", - " reset() {", - " }", - "}", - "", - "class ApplyForce {", - " constructor(direction, magnitude) {", - " this.direction = direction;", - " this.magnitude = magnitude;", - " this.type = 'ApplyForce';", - " this.magnitudeValue = this.magnitude.genValue();", - " }", - " initialize(particle) {", - " }", - " update(particle, delta) {", - " particle.velocity.addScaledVector(this.direction, this.magnitudeValue * delta);", - " }", - " frameUpdate(delta) {", - " this.magnitudeValue = this.magnitude.genValue();", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " direction: [this.direction.x, this.direction.y, this.direction.z],", - " magnitude: this.magnitude.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " var _a;", - " return new ApplyForce(new THREE.Vector3(json.direction[0], json.direction[1], json.direction[2]), ValueGeneratorFromJSON((_a = json.magnitude) !== null && _a !== void 0 ? _a : json.force));", - " }", - " clone() {", - " return new ApplyForce(this.direction.clone(), this.magnitude.clone());", - " }", - " reset() {", - " }", - "}", - "", - "class GravityForce {", - " constructor(center, magnitude) {", - " this.center = center;", - " this.magnitude = magnitude;", - " this.type = 'GravityForce';", - " this.temp = new THREE.Vector3();", - " }", - " initialize(particle) {", - " }", - " update(particle, delta) {", - " this.temp.copy(this.center).sub(particle.position).normalize();", - " particle.velocity.addScaledVector(this.temp, this.magnitude / particle.position.distanceToSquared(this.center) * delta);", - " }", - " frameUpdate(delta) {", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " center: [this.center.x, this.center.y, this.center.z],", - " magnitude: this.magnitude,", - " };", - " }", - " static fromJSON(json) {", - " return new GravityForce(new THREE.Vector3(json.center[0], json.center[1], json.center[2]), json.magnitude);", - " }", - " clone() {", - " return new GravityForce(this.center.clone(), this.magnitude);", - " }", - " reset() {", - " }", - "}", - "", - "new THREE.Vector3(0, 0, 1);", - "class ChangeEmitDirection {", - " constructor(angle) {", - " this.angle = angle;", - " this.type = 'ChangeEmitDirection';", - " this._temp = new THREE.Vector3();", - " this._q = new THREE.Quaternion();", - " }", - " initialize(particle) {", - " const len = particle.velocity.length();", - " if (len == 0)", - " return;", - " particle.velocity.normalize();", - " if (particle.velocity.x === 0 && particle.velocity.y === 0) {", - " this._temp.set(0, particle.velocity.z, 0);", - " }", - " else {", - " this._temp.set(-particle.velocity.y, particle.velocity.x, 0);", - " }", - " this._q.setFromAxisAngle(this._temp.normalize(), this.angle.genValue());", - " this._temp.copy(particle.velocity);", - " particle.velocity.applyQuaternion(this._q);", - " this._q.setFromAxisAngle(this._temp, Math.random() * Math.PI * 2);", - " particle.velocity.applyQuaternion(this._q);", - " particle.velocity.setLength(len);", - " }", - " update(particle, delta) {", - " }", - " frameUpdate(delta) {", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " angle: this.angle.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new ChangeEmitDirection(ValueGeneratorFromJSON(json.angle));", - " }", - " clone() {", - " return new ChangeEmitDirection(this.angle);", - " }", - " reset() {", - " }", - "}", - "", - "const VECTOR_ONE = new THREE.Vector3(1, 1, 1);", - "const VECTOR_Z = new THREE.Vector3(0, 0, 1);", - "let SubParticleEmitMode = void 0;", - "(function (SubParticleEmitMode) {", - " SubParticleEmitMode[SubParticleEmitMode[\"Death\"] = 0] = \"Death\";", - " SubParticleEmitMode[SubParticleEmitMode[\"Birth\"] = 1] = \"Birth\";", - " SubParticleEmitMode[SubParticleEmitMode[\"Frame\"] = 2] = \"Frame\";", - "})(SubParticleEmitMode || (SubParticleEmitMode = {}));", - "class EmitSubParticleSystem {", - " constructor(particleSystem, useVelocityAsBasis, subParticleSystem, mode = SubParticleEmitMode.Frame, emitProbability = 1) {", - " this.particleSystem = particleSystem;", - " this.useVelocityAsBasis = useVelocityAsBasis;", - " this.subParticleSystem = subParticleSystem;", - " this.mode = mode;", - " this.emitProbability = emitProbability;", - " this.type = 'EmitSubParticleSystem';", - " this.q_ = new THREE.Quaternion();", - " this.v_ = new THREE.Vector3();", - " this.v2_ = new THREE.Vector3();", - " this.subEmissions = new Array();", - " if (this.subParticleSystem && this.subParticleSystem.system) {", - " this.subParticleSystem.system.onlyUsedByOther = true;", - " }", - " }", - " initialize(particle) {", - " }", - " update(particle, delta) {", - " if (this.mode === SubParticleEmitMode.Frame) {", - " this.emit(particle, delta);", - " }", - " else if (this.mode === SubParticleEmitMode.Birth && particle.age === 0) {", - " this.emit(particle, delta);", - " }", - " else if (this.mode === SubParticleEmitMode.Death && particle.age + delta >= particle.life) {", - " this.emit(particle, delta);", - " }", - " }", - " emit(particle, delta) {", - " if (!this.subParticleSystem)", - " return;", - " if (Math.random() > this.emitProbability) {", - " return;", - " }", - " const m = new THREE.Matrix4();", - " this.setMatrixFromParticle(m, particle);", - " this.subEmissions.push({", - " burstIndex: 0,", - " burstWaveIndex: 0,", - " time: 0,", - " waitEmiting: 0,", - " matrix: m,", - " travelDistance: 0,", - " particle: particle,", - " });", - " }", - " frameUpdate(delta) {", - " if (!this.subParticleSystem)", - " return;", - " for (let i = 0; i < this.subEmissions.length; i++) {", - " if (this.subEmissions[i].time >= this.subParticleSystem.system.duration) {", - " this.subEmissions[i] = this.subEmissions[this.subEmissions.length - 1];", - " this.subEmissions.length = this.subEmissions.length - 1;", - " i--;", - " }", - " else {", - " let subEmissionState = this.subEmissions[i];", - " if (subEmissionState.particle && subEmissionState.particle.age < subEmissionState.particle.life) {", - " this.setMatrixFromParticle(subEmissionState.matrix, subEmissionState.particle);", - " }", - " else {", - " subEmissionState.particle = undefined;", - " }", - " this.subParticleSystem.system.emit(delta, subEmissionState, subEmissionState.matrix);", - " }", - " }", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " subParticleSystem: this.subParticleSystem ? this.subParticleSystem.uuid : '',", - " useVelocityAsBasis: this.useVelocityAsBasis,", - " mode: this.mode,", - " emitProbability: this.emitProbability,", - " };", - " }", - " static fromJSON(json, particleSystem) {", - " return new EmitSubParticleSystem(particleSystem, json.useVelocityAsBasis, json.subParticleSystem, json.mode, json.emitProbability);", - " }", - " clone() {", - " return new EmitSubParticleSystem(this.particleSystem, this.useVelocityAsBasis, this.subParticleSystem, this.mode, this.emitProbability);", - " }", - " reset() { }", - " setMatrixFromParticle(m, particle) {", - " let rotation;", - " if (particle.rotation === undefined || this.useVelocityAsBasis) {", - " if (particle.velocity.x === 0 &&", - " particle.velocity.y === 0 &&", - " (particle.velocity.z === 1 || particle.velocity.z === 0)) {", - " m.set(1, 0, 0, particle.position.x, 0, 1, 0, particle.position.y, 0, 0, 1, particle.position.z, 0, 0, 0, 1);", - " }", - " else {", - " this.v_.copy(VECTOR_Z).cross(particle.velocity);", - " this.v2_.copy(particle.velocity).cross(this.v_);", - " const len = this.v_.length();", - " const len2 = this.v2_.length();", - " m.set(this.v_.x / len, this.v2_.x / len2, particle.velocity.x, particle.position.x, this.v_.y / len, this.v2_.y / len2, particle.velocity.y, particle.position.y, this.v_.z / len, this.v2_.z / len2, particle.velocity.z, particle.position.z, 0, 0, 0, 1);", - " }", - " }", - " else {", - " if (particle.rotation instanceof THREE.Quaternion) {", - " rotation = particle.rotation;", - " }", - " else {", - " this.q_.setFromAxisAngle(VECTOR_Z, particle.rotation);", - " rotation = this.q_;", - " }", - " m.compose(particle.position, rotation, VECTOR_ONE);", - " }", - " if (!this.particleSystem.worldSpace) {", - " m.multiplyMatrices(this.particleSystem.emitter.matrixWorld, m);", - " }", - " }", - "}", - "", - "const F2 = 0.5 * (Math.sqrt(3.0) - 1.0);", - "const G2 = (3.0 - Math.sqrt(3.0)) / 6.0;", - "const F3 = 1.0 / 3.0;", - "const G3 = 1.0 / 6.0;", - "const F4 = (Math.sqrt(5.0) - 1.0) / 4.0;", - "const G4 = (5.0 - Math.sqrt(5.0)) / 20.0;", - "const grad3 = new Float32Array([1, 1, 0,", - " -1, 1, 0,", - " 1, -1, 0,", - " -1, -1, 0,", - " 1, 0, 1,", - " -1, 0, 1,", - " 1, 0, -1,", - " -1, 0, -1,", - " 0, 1, 1,", - " 0, -1, 1,", - " 0, 1, -1,", - " 0, -1, -1]);", - "const grad4 = new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,", - " 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,", - " 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,", - " -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,", - " 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,", - " -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,", - " 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,", - " -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]);", - "class SimplexNoise {", - " constructor(randomOrSeed = Math.random) {", - " const random = typeof randomOrSeed == 'function' ? randomOrSeed : alea(randomOrSeed);", - " this.p = buildPermutationTable(random);", - " this.perm = new Uint8Array(512);", - " this.permMod12 = new Uint8Array(512);", - " for (let i = 0; i < 512; i++) {", - " this.perm[i] = this.p[i & 255];", - " this.permMod12[i] = this.perm[i] % 12;", - " }", - " }", - " noise2D(x, y) {", - " const permMod12 = this.permMod12;", - " const perm = this.perm;", - " let n0 = 0;", - " let n1 = 0;", - " let n2 = 0;", - " const s = (x + y) * F2;", - " const i = Math.floor(x + s);", - " const j = Math.floor(y + s);", - " const t = (i + j) * G2;", - " const X0 = i - t;", - " const Y0 = j - t;", - " const x0 = x - X0;", - " const y0 = y - Y0;", - " let i1, j1;", - " if (x0 > y0) {", - " i1 = 1;", - " j1 = 0;", - " }", - " else {", - " i1 = 0;", - " j1 = 1;", - " }", - " const x1 = x0 - i1 + G2;", - " const y1 = y0 - j1 + G2;", - " const x2 = x0 - 1.0 + 2.0 * G2;", - " const y2 = y0 - 1.0 + 2.0 * G2;", - " const ii = i & 255;", - " const jj = j & 255;", - " let t0 = 0.5 - x0 * x0 - y0 * y0;", - " if (t0 >= 0) {", - " const gi0 = permMod12[ii + perm[jj]] * 3;", - " t0 *= t0;", - " n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0);", - " }", - " let t1 = 0.5 - x1 * x1 - y1 * y1;", - " if (t1 >= 0) {", - " const gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;", - " t1 *= t1;", - " n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);", - " }", - " let t2 = 0.5 - x2 * x2 - y2 * y2;", - " if (t2 >= 0) {", - " const gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;", - " t2 *= t2;", - " n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);", - " }", - " return 70.0 * (n0 + n1 + n2);", - " }", - " noise3D(x, y, z) {", - " const permMod12 = this.permMod12;", - " const perm = this.perm;", - " let n0, n1, n2, n3;", - " const s = (x + y + z) * F3;", - " const i = Math.floor(x + s);", - " const j = Math.floor(y + s);", - " const k = Math.floor(z + s);", - " const t = (i + j + k) * G3;", - " const X0 = i - t;", - " const Y0 = j - t;", - " const Z0 = k - t;", - " const x0 = x - X0;", - " const y0 = y - Y0;", - " const z0 = z - Z0;", - " let i1, j1, k1;", - " let i2, j2, k2;", - " if (x0 >= y0) {", - " if (y0 >= z0) {", - " i1 = 1;", - " j1 = 0;", - " k1 = 0;", - " i2 = 1;", - " j2 = 1;", - " k2 = 0;", - " }", - " else if (x0 >= z0) {", - " i1 = 1;", - " j1 = 0;", - " k1 = 0;", - " i2 = 1;", - " j2 = 0;", - " k2 = 1;", - " }", - " else {", - " i1 = 0;", - " j1 = 0;", - " k1 = 1;", - " i2 = 1;", - " j2 = 0;", - " k2 = 1;", - " }", - " }", - " else {", - " if (y0 < z0) {", - " i1 = 0;", - " j1 = 0;", - " k1 = 1;", - " i2 = 0;", - " j2 = 1;", - " k2 = 1;", - " }", - " else if (x0 < z0) {", - " i1 = 0;", - " j1 = 1;", - " k1 = 0;", - " i2 = 0;", - " j2 = 1;", - " k2 = 1;", - " }", - " else {", - " i1 = 0;", - " j1 = 1;", - " k1 = 0;", - " i2 = 1;", - " j2 = 1;", - " k2 = 0;", - " }", - " }", - " const x1 = x0 - i1 + G3;", - " const y1 = y0 - j1 + G3;", - " const z1 = z0 - k1 + G3;", - " const x2 = x0 - i2 + 2.0 * G3;", - " const y2 = y0 - j2 + 2.0 * G3;", - " const z2 = z0 - k2 + 2.0 * G3;", - " const x3 = x0 - 1.0 + 3.0 * G3;", - " const y3 = y0 - 1.0 + 3.0 * G3;", - " const z3 = z0 - 1.0 + 3.0 * G3;", - " const ii = i & 255;", - " const jj = j & 255;", - " const kk = k & 255;", - " let t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0;", - " if (t0 < 0)", - " n0 = 0.0;", - " else {", - " const gi0 = permMod12[ii + perm[jj + perm[kk]]] * 3;", - " t0 *= t0;", - " n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0 + grad3[gi0 + 2] * z0);", - " }", - " let t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1;", - " if (t1 < 0)", - " n1 = 0.0;", - " else {", - " const gi1 = permMod12[ii + i1 + perm[jj + j1 + perm[kk + k1]]] * 3;", - " t1 *= t1;", - " n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1 + grad3[gi1 + 2] * z1);", - " }", - " let t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2;", - " if (t2 < 0)", - " n2 = 0.0;", - " else {", - " const gi2 = permMod12[ii + i2 + perm[jj + j2 + perm[kk + k2]]] * 3;", - " t2 *= t2;", - " n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2 + grad3[gi2 + 2] * z2);", - " }", - " let t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3;", - " if (t3 < 0)", - " n3 = 0.0;", - " else {", - " const gi3 = permMod12[ii + 1 + perm[jj + 1 + perm[kk + 1]]] * 3;", - " t3 *= t3;", - " n3 = t3 * t3 * (grad3[gi3] * x3 + grad3[gi3 + 1] * y3 + grad3[gi3 + 2] * z3);", - " }", - " return 32.0 * (n0 + n1 + n2 + n3);", - " }", - " noise4D(x, y, z, w) {", - " const perm = this.perm;", - " let n0, n1, n2, n3, n4;", - " const s = (x + y + z + w) * F4;", - " const i = Math.floor(x + s);", - " const j = Math.floor(y + s);", - " const k = Math.floor(z + s);", - " const l = Math.floor(w + s);", - " const t = (i + j + k + l) * G4;", - " const X0 = i - t;", - " const Y0 = j - t;", - " const Z0 = k - t;", - " const W0 = l - t;", - " const x0 = x - X0;", - " const y0 = y - Y0;", - " const z0 = z - Z0;", - " const w0 = w - W0;", - " let rankx = 0;", - " let ranky = 0;", - " let rankz = 0;", - " let rankw = 0;", - " if (x0 > y0)", - " rankx++;", - " else", - " ranky++;", - " if (x0 > z0)", - " rankx++;", - " else", - " rankz++;", - " if (x0 > w0)", - " rankx++;", - " else", - " rankw++;", - " if (y0 > z0)", - " ranky++;", - " else", - " rankz++;", - " if (y0 > w0)", - " ranky++;", - " else", - " rankw++;", - " if (z0 > w0)", - " rankz++;", - " else", - " rankw++;", - " const i1 = rankx >= 3 ? 1 : 0;", - " const j1 = ranky >= 3 ? 1 : 0;", - " const k1 = rankz >= 3 ? 1 : 0;", - " const l1 = rankw >= 3 ? 1 : 0;", - " const i2 = rankx >= 2 ? 1 : 0;", - " const j2 = ranky >= 2 ? 1 : 0;", - " const k2 = rankz >= 2 ? 1 : 0;", - " const l2 = rankw >= 2 ? 1 : 0;", - " const i3 = rankx >= 1 ? 1 : 0;", - " const j3 = ranky >= 1 ? 1 : 0;", - " const k3 = rankz >= 1 ? 1 : 0;", - " const l3 = rankw >= 1 ? 1 : 0;", - " const x1 = x0 - i1 + G4;", - " const y1 = y0 - j1 + G4;", - " const z1 = z0 - k1 + G4;", - " const w1 = w0 - l1 + G4;", - " const x2 = x0 - i2 + 2.0 * G4;", - " const y2 = y0 - j2 + 2.0 * G4;", - " const z2 = z0 - k2 + 2.0 * G4;", - " const w2 = w0 - l2 + 2.0 * G4;", - " const x3 = x0 - i3 + 3.0 * G4;", - " const y3 = y0 - j3 + 3.0 * G4;", - " const z3 = z0 - k3 + 3.0 * G4;", - " const w3 = w0 - l3 + 3.0 * G4;", - " const x4 = x0 - 1.0 + 4.0 * G4;", - " const y4 = y0 - 1.0 + 4.0 * G4;", - " const z4 = z0 - 1.0 + 4.0 * G4;", - " const w4 = w0 - 1.0 + 4.0 * G4;", - " const ii = i & 255;", - " const jj = j & 255;", - " const kk = k & 255;", - " const ll = l & 255;", - " let t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;", - " if (t0 < 0)", - " n0 = 0.0;", - " else {", - " const gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;", - " t0 *= t0;", - " n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);", - " }", - " let t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;", - " if (t1 < 0)", - " n1 = 0.0;", - " else {", - " const gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;", - " t1 *= t1;", - " n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);", - " }", - " let t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;", - " if (t2 < 0)", - " n2 = 0.0;", - " else {", - " const gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;", - " t2 *= t2;", - " n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);", - " }", - " let t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;", - " if (t3 < 0)", - " n3 = 0.0;", - " else {", - " const gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;", - " t3 *= t3;", - " n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);", - " }", - " let t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;", - " if (t4 < 0)", - " n4 = 0.0;", - " else {", - " const gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;", - " t4 *= t4;", - " n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);", - " }", - " return 27.0 * (n0 + n1 + n2 + n3 + n4);", - " }", - "}", - "function buildPermutationTable(random) {", - " const p = new Uint8Array(256);", - " for (let i = 0; i < 256; i++) {", - " p[i] = i;", - " }", - " for (let i = 0; i < 255; i++) {", - " const r = i + ~~(random() * (256 - i));", - " const aux = p[i];", - " p[i] = p[r];", - " p[r] = aux;", - " }", - " return p;", - "}", - "function alea(seed) {", - " let s0 = 0;", - " let s1 = 0;", - " let s2 = 0;", - " let c = 1;", - " const mash = masher();", - " s0 = mash(' ');", - " s1 = mash(' ');", - " s2 = mash(' ');", - " s0 -= mash(seed);", - " if (s0 < 0) {", - " s0 += 1;", - " }", - " s1 -= mash(seed);", - " if (s1 < 0) {", - " s1 += 1;", - " }", - " s2 -= mash(seed);", - " if (s2 < 0) {", - " s2 += 1;", - " }", - " return function () {", - " const t = 2091639 * s0 + c * 2.3283064365386963e-10;", - " s0 = s1;", - " s1 = s2;", - " return s2 = t - (c = t | 0);", - " };", - "}", - "function masher() {", - " let n = 0xefc8249d;", - " return function (data) {", - " data = data.toString();", - " for (let i = 0; i < data.length; i++) {", - " n += data.charCodeAt(i);", - " let h = 0.02519603282416938 * n;", - " n = h >>> 0;", - " h -= n;", - " h *= n;", - " n = h >>> 0;", - " h -= n;", - " n += h * 0x100000000;", - " }", - " return (n >>> 0) * 2.3283064365386963e-10;", - " };", - "}", - "", - "class TurbulenceField {", - " constructor(scale, octaves, velocityMultiplier, timeScale) {", - " this.scale = scale;", - " this.octaves = octaves;", - " this.velocityMultiplier = velocityMultiplier;", - " this.timeScale = timeScale;", - " this.type = 'TurbulenceField';", - " this.generator = new SimplexNoise();", - " this.timeOffset = new THREE.Vector3();", - " this.temp = new THREE.Vector3();", - " this.temp2 = new THREE.Vector3();", - " this.timeOffset.x = Math.random() / this.scale.x * this.timeScale.x;", - " this.timeOffset.y = Math.random() / this.scale.y * this.timeScale.y;", - " this.timeOffset.z = Math.random() / this.scale.z * this.timeScale.z;", - " }", - " initialize(particle) {", - " }", - " update(particle, delta) {", - " const x = particle.position.x / this.scale.x;", - " const y = particle.position.y / this.scale.y;", - " const z = particle.position.z / this.scale.z;", - " this.temp.set(0, 0, 0);", - " let lvl = 1;", - " for (let i = 0; i < this.octaves; i++) {", - " this.temp2.set(this.generator.noise4D(x * lvl, y * lvl, z * lvl, this.timeOffset.x * lvl) / lvl, this.generator.noise4D(x * lvl, y * lvl, z * lvl, this.timeOffset.y * lvl) / lvl, this.generator.noise4D(x * lvl, y * lvl, z * lvl, this.timeOffset.z * lvl) / lvl);", - " this.temp.add(this.temp2);", - " lvl *= 2;", - " }", - " this.temp.multiply(this.velocityMultiplier);", - " particle.velocity.addScaledVector(this.temp, delta);", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " scale: [this.scale.x, this.scale.y, this.scale.z],", - " octaves: this.octaves,", - " velocityMultiplier: [this.velocityMultiplier.x, this.velocityMultiplier.y, this.velocityMultiplier.z],", - " timeScale: [this.timeScale.x, this.timeScale.y, this.timeScale.z],", - " };", - " }", - " frameUpdate(delta) {", - " this.timeOffset.x += delta * this.timeScale.x;", - " this.timeOffset.y += delta * this.timeScale.y;", - " this.timeOffset.z += delta * this.timeScale.z;", - " }", - " static fromJSON(json) {", - " return new TurbulenceField(new THREE.Vector3(json.scale[0], json.scale[1], json.scale[2]), json.octaves, new THREE.Vector3(json.velocityMultiplier[0], json.velocityMultiplier[1], json.velocityMultiplier[2]), new THREE.Vector3(json.timeScale[0], json.timeScale[1], json.timeScale[2]));", - " }", - " clone() {", - " return new TurbulenceField(this.scale.clone(), this.octaves, this.velocityMultiplier.clone(), this.timeScale.clone());", - " }", - " reset() {", - " }", - "}", - "", - "function randomInt(a, b) {", - " return Math.floor(Math.random() * (b - a)) + a;", - "}", - "", - "const generators = [];", - "const tempV$2 = new THREE.Vector3();", - "const tempQ$2 = new THREE.Quaternion();", - "class Noise {", - " constructor(frequency, power, positionAmount = new ConstantValue(1), rotationAmount = new ConstantValue(0)) {", - " this.frequency = frequency;", - " this.power = power;", - " this.positionAmount = positionAmount;", - " this.rotationAmount = rotationAmount;", - " this.type = 'Noise';", - " this.duration = 0;", - " if (generators.length === 0) {", - " for (let i = 0; i < 100; i++) {", - " generators.push(new SimplexNoise());", - " }", - " }", - " }", - " initialize(particle) {", - " particle.lastPosNoise = new THREE.Vector3();", - " if (typeof particle.rotation === 'number') {", - " particle.lastRotNoise = 0;", - " }", - " else {", - " particle.lastRotNoise = new THREE.Quaternion();", - " }", - " particle.generatorIndex = [randomInt(0, 100), randomInt(0, 100), randomInt(0, 100), randomInt(0, 100)];", - " }", - " update(particle, _) {", - " let frequency = this.frequency.genValue(particle.age / particle.life);", - " let power = this.power.genValue(particle.age / particle.life);", - " let positionAmount = this.positionAmount.genValue(particle.age / particle.life);", - " let rotationAmount = this.rotationAmount.genValue(particle.age / particle.life);", - " if (positionAmount > 0 && particle.lastPosNoise !== undefined) {", - " particle.position.sub(particle.lastPosNoise);", - " tempV$2.set(generators[particle.generatorIndex[0]].noise2D(0, particle.age * frequency) *", - " power *", - " positionAmount, generators[particle.generatorIndex[1]].noise2D(0, particle.age * frequency) *", - " power *", - " positionAmount, generators[particle.generatorIndex[2]].noise2D(0, particle.age * frequency) *", - " power *", - " positionAmount);", - " particle.position.add(tempV$2);", - " particle.lastPosNoise.copy(tempV$2);", - " }", - " if (rotationAmount > 0 && particle.lastRotNoise !== undefined) {", - " if (typeof particle.rotation === 'number') {", - " particle.rotation -= particle.lastRotNoise;", - " particle.rotation +=", - " generators[particle.generatorIndex[3]].noise2D(0, particle.age * frequency) *", - " Math.PI *", - " power *", - " rotationAmount;", - " }", - " else {", - " particle.lastRotNoise.invert();", - " particle.rotation.multiply(particle.lastRotNoise);", - " tempQ$2", - " .set(generators[particle.generatorIndex[0]].noise2D(0, particle.age * frequency) *", - " power *", - " rotationAmount, generators[particle.generatorIndex[1]].noise2D(0, particle.age * frequency) *", - " power *", - " rotationAmount, generators[particle.generatorIndex[2]].noise2D(0, particle.age * frequency) *", - " power *", - " rotationAmount, generators[particle.generatorIndex[3]].noise2D(0, particle.age * frequency) *", - " power *", - " rotationAmount)", - " .normalize();", - " particle.rotation.multiply(tempQ$2);", - " particle.lastRotNoise.copy(tempQ$2);", - " }", - " }", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " frequency: this.frequency.toJSON(),", - " power: this.power.toJSON(),", - " positionAmount: this.positionAmount.toJSON(),", - " rotationAmount: this.rotationAmount.toJSON(),", - " };", - " }", - " frameUpdate(delta) {", - " this.duration += delta;", - " }", - " static fromJSON(json) {", - " return new Noise(ValueGeneratorFromJSON(json.frequency), ValueGeneratorFromJSON(json.power), ValueGeneratorFromJSON(json.positionAmount), ValueGeneratorFromJSON(json.rotationAmount));", - " }", - " clone() {", - " return new Noise(this.frequency.clone(), this.power.clone(), this.positionAmount.clone(), this.rotationAmount.clone());", - " }", - " reset() { }", - "}", - "", - "class TextureSequencer {", - " constructor(scaleX = 0, scaleY = 0, position = new THREE.Vector3()) {", - " this.scaleX = scaleX;", - " this.scaleY = scaleY;", - " this.position = position;", - " this.locations = [];", - " }", - " transform(position, index) {", - " position.x = this.locations[index % this.locations.length].x * this.scaleX + this.position.x;", - " position.y = this.locations[index % this.locations.length].y * this.scaleY + this.position.y;", - " position.z = this.position.z;", - " }", - " static fromJSON(json) {", - " const textureSequencer = new TextureSequencer(json.scaleX, json.scaleY, new THREE.Vector3(json.position[0], json.position[1], json.position[2]));", - " textureSequencer.locations = json.locations.map((loc) => new THREE.Vector2(loc.x, loc.y));", - " return textureSequencer;", - " }", - " clone() {", - " const textureSequencer = new TextureSequencer(this.scaleX, this.scaleY, this.position.clone());", - " textureSequencer.locations = this.locations.map(loc => loc.clone());", - " return textureSequencer;", - " }", - " toJSON() {", - " return {", - " scaleX: this.scaleX,", - " scaleY: this.scaleY,", - " position: this.position,", - " locations: this.locations.map(loc => ({", - " x: loc.x,", - " y: loc.y,", - " }))", - " };", - " }", - " fromImage(img, threshold) {", - " const canvas = document.createElement(\"canvas\");", - " canvas.width = img.width;", - " canvas.height = img.height;", - " const ctx = canvas.getContext(\"2d\");", - " if (!ctx) {", - " return;", - " }", - " ctx.drawImage(img, 0, 0);", - " const data = ctx.getImageData(0, 0, canvas.width, canvas.height, { colorSpace: \"srgb\" });", - " canvas.remove();", - " this.locations.length = 0;", - " for (let i = 0; i < data.height; i++) {", - " for (let j = 0; j < data.width; j++) {", - " if (data.data[(i * data.width + j) * 4 + 3] > threshold) {", - " this.locations.push(new THREE.Vector2(j, data.height - i));", - " }", - " }", - " }", - " }", - "}", - "", - "function SequencerFromJSON(json) {", - " switch (json.type) {", - " case 'TextureSequencer':", - " return TextureSequencer.fromJSON(json);", - " default:", - " return new TextureSequencer();", - " }", - "}", - "", - "class ApplySequences {", - " constructor(delayBetweenParticles) {", - " this.type = 'ApplySequences';", - " this.sequencers = [];", - " this.time = 0;", - " this.index = 0;", - " this.pCount = 0;", - " this.tempV = new THREE.Vector3();", - " this.delay = delayBetweenParticles;", - " }", - " initialize(particle) {", - " particle.id = this.pCount;", - " particle.dst = new THREE.Vector3();", - " particle.begin = new THREE.Vector3();", - " particle.inMotion = false;", - " this.pCount++;", - " }", - " reset() {", - " this.time = 0;", - " this.index = 0;", - " this.pCount = 0;", - " }", - " update(particle, delta) {", - " const sequencer = this.sequencers[this.index];", - " const delay = particle.id * this.delay;", - " if (this.time >= sequencer[0].a + delay && this.time <= sequencer[0].b + delay) {", - " if (!particle.inMotion) {", - " particle.inMotion = true;", - " particle.begin.copy(particle.position);", - " sequencer[1].transform(particle.dst, particle.id);", - " }", - " particle.position.lerpVectors(particle.begin, particle.dst, ApplySequences.BEZIER.genValue((this.time - sequencer[0].a - delay) / (sequencer[0].b - sequencer[0].a)));", - " }", - " else if (this.time > sequencer[0].b + delay) {", - " particle.inMotion = false;", - " }", - " }", - " frameUpdate(delta) {", - " while (this.index + 1 < this.sequencers.length && this.time >= this.sequencers[this.index + 1][0].a) {", - " this.index++;", - " }", - " this.time += delta;", - " }", - " appendSequencer(range, sequencer) {", - " this.sequencers.push([range, sequencer]);", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " delay: this.delay,", - " sequencers: this.sequencers.map(([range, sequencer]) => ({", - " range: range.toJSON(),", - " sequencer: sequencer.toJSON(),", - " })),", - " };", - " }", - " static fromJSON(json) {", - " const seq = new ApplySequences(json.delay);", - " json.sequencers.forEach((sequencerJson) => {", - " seq.sequencers.push([ValueGeneratorFromJSON(sequencerJson.range), SequencerFromJSON(sequencerJson.sequencer)]);", - " });", - " return seq;", - " }", - " clone() {", - " const applySequences = new ApplySequences(this.delay);", - " applySequences.sequencers = this.sequencers.map(seq => [seq[0].clone(), seq[1].clone()]);", - " return applySequences;", - " }", - "}", - "ApplySequences.BEZIER = new Bezier(0, 0, 1, 1);", - "", - "let physicsResolver;", - "function setPhysicsResolver(resolver) {", - " physicsResolver = resolver;", - "}", - "function getPhysicsResolver() {", - " return physicsResolver;", - "}", - "class ApplyCollision {", - " constructor(resolver, bounce) {", - " this.resolver = resolver;", - " this.bounce = bounce;", - " this.type = 'ApplyCollision';", - " this.tempV = new THREE.Vector3();", - " }", - " initialize(particle) {", - " }", - " update(particle, delta) {", - " if (this.resolver.resolve(particle.position, this.tempV)) {", - " particle.velocity.reflect(this.tempV).multiplyScalar(this.bounce);", - " }", - " }", - " frameUpdate(delta) {", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " bounce: this.bounce,", - " };", - " }", - " static fromJSON(json) {", - " return new ApplyCollision(getPhysicsResolver(), json.bounce);", - " }", - " clone() {", - " return new ApplyCollision(this.resolver, this.bounce);", - " }", - " reset() {", - " }", - "}", - "", - "class ColorBySpeed {", - " constructor(color, speedRange) {", - " this.color = color;", - " this.speedRange = speedRange;", - " this.type = 'ColorBySpeed';", - " }", - " initialize(particle) {", - " if (this.color.type === 'memorizedFunction') {", - " particle.colorOverLifeMemory = {};", - " this.color.startGen(particle.colorOverLifeMemory);", - " }", - " }", - " update(particle, delta) {", - " const t = (particle.startSpeed - this.speedRange.a) / (this.speedRange.b - this.speedRange.a);", - " if (this.color.type === 'memorizedFunction') {", - " this.color.genColor(particle.color, t, particle.colorOverLifeMemory);", - " }", - " else {", - " this.color.genColor(particle.color, t);", - " }", - " particle.color.x *= particle.startColor.x;", - " particle.color.y *= particle.startColor.y;", - " particle.color.z *= particle.startColor.z;", - " particle.color.w *= particle.startColor.w;", - " }", - " frameUpdate(delta) { }", - " toJSON() {", - " return {", - " type: this.type,", - " color: this.color.toJSON(),", - " speedRange: this.speedRange.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new ColorBySpeed(ColorGeneratorFromJSON(json.color), IntervalValue.fromJSON(json.speedRange));", - " }", - " clone() {", - " return new ColorBySpeed(this.color.clone(), this.speedRange.clone());", - " }", - " reset() { }", - "}", - "", - "class SizeBySpeed {", - " initialize(particle) { }", - " constructor(size, speedRange) {", - " this.size = size;", - " this.speedRange = speedRange;", - " this.type = 'SizeBySpeed';", - " }", - " update(particle) {", - " const t = (particle.startSpeed - this.speedRange.a) / (this.speedRange.b - this.speedRange.a);", - " particle.size = particle.startSize * this.size.genValue(t);", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " size: this.size.toJSON(),", - " speedRange: this.speedRange.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new SizeBySpeed(ValueGeneratorFromJSON(json.size), IntervalValue.fromJSON(json.speedRange));", - " }", - " frameUpdate(delta) { }", - " clone() {", - " return new SizeBySpeed(this.size.clone(), this.speedRange.clone());", - " }", - " reset() { }", - "}", - "", - "class RotationBySpeed {", - " constructor(angularVelocity, speedRange) {", - " this.angularVelocity = angularVelocity;", - " this.speedRange = speedRange;", - " this.type = 'RotationBySpeed';", - " this.tempQuat = new THREE.Quaternion();", - " }", - " initialize(particle) { }", - " update(particle, delta) {", - " const t = (particle.startSpeed - this.speedRange.a) / (this.speedRange.b - this.speedRange.a);", - " particle.rotation += delta * this.angularVelocity.genValue(t);", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " angularVelocity: this.angularVelocity.toJSON(),", - " speedRange: this.speedRange.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new RotationBySpeed(ValueGeneratorFromJSON(json.angularVelocity), IntervalValue.fromJSON(json.speedRange));", - " }", - " frameUpdate(delta) { }", - " clone() {", - " return new RotationBySpeed(this.angularVelocity.clone(), this.speedRange.clone());", - " }", - " reset() { }", - "}", - "", - "class LimitSpeedOverLife {", - " initialize(particle) { }", - " constructor(speed, dampen) {", - " this.speed = speed;", - " this.dampen = dampen;", - " this.type = 'LimitSpeedOverLife';", - " }", - " update(particle, delta) {", - " let speed = particle.velocity.length();", - " let limit = this.speed.genValue(particle.age / particle.life);", - " if (speed > limit) {", - " const percent = (speed - limit) / speed;", - " particle.velocity.multiplyScalar(1 - percent * this.dampen * delta * 20);", - " }", - " }", - " toJSON() {", - " return {", - " type: this.type,", - " speed: this.speed.toJSON(),", - " dampen: this.dampen,", - " };", - " }", - " static fromJSON(json) {", - " return new LimitSpeedOverLife(ValueGeneratorFromJSON(json.speed), json.dampen);", - " }", - " frameUpdate(delta) { }", - " clone() {", - " return new LimitSpeedOverLife(this.speed.clone(), this.dampen);", - " }", - " reset() { }", - "}", - "", - "const BehaviorTypes = {", - " ApplyForce: {", - " type: 'ApplyForce',", - " constructor: ApplyForce,", - " params: [", - " ['direction', 'vec3'],", - " ['magnitude', 'value'],", - " ],", - " loadJSON: ApplyForce.fromJSON,", - " },", - " Noise: {", - " type: 'Noise',", - " constructor: Noise,", - " params: [", - " ['frequency', 'value'],", - " ['power', 'value'],", - " ['positionAmount', 'value'],", - " ['rotationAmount', 'value'],", - " ],", - " loadJSON: Noise.fromJSON,", - " },", - " TurbulenceField: {", - " type: 'TurbulenceField',", - " constructor: TurbulenceField,", - " params: [", - " ['scale', 'vec3'],", - " ['octaves', 'number'],", - " ['velocityMultiplier', 'vec3'],", - " ['timeScale', 'vec3'],", - " ],", - " loadJSON: TurbulenceField.fromJSON,", - " },", - " GravityForce: {", - " type: 'GravityForce',", - " constructor: GravityForce,", - " params: [", - " ['center', 'vec3'],", - " ['magnitude', 'number'],", - " ],", - " loadJSON: GravityForce.fromJSON,", - " },", - " ColorOverLife: {", - " type: 'ColorOverLife',", - " constructor: ColorOverLife,", - " params: [['color', 'colorFunc']],", - " loadJSON: ColorOverLife.fromJSON,", - " },", - " RotationOverLife: {", - " type: 'RotationOverLife',", - " constructor: RotationOverLife,", - " params: [['angularVelocity', 'valueFunc']],", - " loadJSON: RotationOverLife.fromJSON,", - " },", - " Rotation3DOverLife: {", - " type: 'Rotation3DOverLife',", - " constructor: Rotation3DOverLife,", - " params: [['angularVelocity', 'rotationFunc']],", - " loadJSON: Rotation3DOverLife.fromJSON,", - " },", - " SizeOverLife: {", - " type: 'SizeOverLife',", - " constructor: SizeOverLife,", - " params: [['size', 'valueFunc']],", - " loadJSON: SizeOverLife.fromJSON,", - " },", - " ColorBySpeed: {", - " type: 'ColorBySpeed',", - " constructor: ColorBySpeed,", - " params: [", - " ['color', 'colorFunc'],", - " ['speedRange', 'range'],", - " ],", - " loadJSON: ColorBySpeed.fromJSON,", - " },", - " RotationBySpeed: {", - " type: 'RotationBySpeed',", - " constructor: RotationBySpeed,", - " params: [", - " ['angularVelocity', 'valueFunc'],", - " ['speedRange', 'range'],", - " ],", - " loadJSON: RotationBySpeed.fromJSON,", - " },", - " SizeBySpeed: {", - " type: 'SizeBySpeed',", - " constructor: SizeBySpeed,", - " params: [", - " ['size', 'valueFunc'],", - " ['speedRange', 'range'],", - " ],", - " loadJSON: SizeBySpeed.fromJSON,", - " },", - " SpeedOverLife: {", - " type: 'SpeedOverLife',", - " constructor: SpeedOverLife,", - " params: [['speed', 'valueFunc']],", - " loadJSON: SpeedOverLife.fromJSON,", - " },", - " FrameOverLife: {", - " type: 'FrameOverLife',", - " constructor: FrameOverLife,", - " params: [['frame', 'valueFunc']],", - " loadJSON: FrameOverLife.fromJSON,", - " },", - " ForceOverLife: {", - " type: 'ForceOverLife',", - " constructor: ForceOverLife,", - " params: [", - " ['x', 'valueFunc'],", - " ['y', 'valueFunc'],", - " ['z', 'valueFunc'],", - " ],", - " loadJSON: ForceOverLife.fromJSON,", - " },", - " OrbitOverLife: {", - " type: 'OrbitOverLife',", - " constructor: OrbitOverLife,", - " params: [", - " ['orbitSpeed', 'valueFunc'],", - " ['axis', 'vec3'],", - " ],", - " loadJSON: OrbitOverLife.fromJSON,", - " },", - " WidthOverLength: {", - " type: 'WidthOverLength',", - " constructor: WidthOverLength,", - " params: [['width', 'valueFunc']],", - " loadJSON: WidthOverLength.fromJSON,", - " },", - " ChangeEmitDirection: {", - " type: 'ChangeEmitDirection',", - " constructor: ChangeEmitDirection,", - " params: [['angle', 'value']],", - " loadJSON: ChangeEmitDirection.fromJSON,", - " },", - " EmitSubParticleSystem: {", - " type: 'EmitSubParticleSystem',", - " constructor: EmitSubParticleSystem,", - " params: [", - " ['particleSystem', 'self'],", - " ['useVelocityAsBasis', 'boolean'],", - " ['subParticleSystem', 'particleSystem'],", - " ['mode', 'number'],", - " ['emitProbability', 'number'],", - " ],", - " loadJSON: EmitSubParticleSystem.fromJSON,", - " },", - " LimitSpeedOverLife: {", - " type: 'LimitSpeedOverLife',", - " constructor: LimitSpeedOverLife,", - " params: [", - " ['speed', 'valueFunc'],", - " ['dampen', 'number'],", - " ],", - " loadJSON: LimitSpeedOverLife.fromJSON,", - " },", - "};", - "function BehaviorFromJSON(json, particleSystem) {", - " return BehaviorTypes[json.type].loadJSON(json, particleSystem);", - "}", - "", - "let EmitterMode = void 0;", - "(function (EmitterMode) {", - " EmitterMode[EmitterMode[\"Random\"] = 0] = \"Random\";", - " EmitterMode[EmitterMode[\"Loop\"] = 1] = \"Loop\";", - " EmitterMode[EmitterMode[\"PingPong\"] = 2] = \"PingPong\";", - " EmitterMode[EmitterMode[\"Burst\"] = 3] = \"Burst\";", - "})(EmitterMode || (EmitterMode = {}));", - "function getValueFromEmitterMode(mode, currentValue, spread) {", - " let u;", - " if (EmitterMode.Random === mode) {", - " currentValue = Math.random();", - " }", - " if (spread > 0) {", - " u = Math.floor(currentValue / spread) * spread;", - " }", - " else {", - " u = currentValue;", - " }", - " switch (mode) {", - " case EmitterMode.Loop:", - " u = u % 1;", - " break;", - " case EmitterMode.PingPong:", - " u = Math.abs((u % 2) - 1);", - " break;", - " }", - " return u;", - "}", - "", - "class ConeEmitter {", - " constructor(parameters = {}) {", - " var _a, _b, _c, _d, _e, _f, _g;", - " this.type = 'cone';", - " this.currentValue = 0;", - " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", - " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", - " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", - " this.angle = (_d = parameters.angle) !== null && _d !== void 0 ? _d : Math.PI / 6;", - " this.mode = (_e = parameters.mode) !== null && _e !== void 0 ? _e : EmitterMode.Random;", - " this.spread = (_f = parameters.spread) !== null && _f !== void 0 ? _f : 0;", - " this.speed = (_g = parameters.speed) !== null && _g !== void 0 ? _g : new ConstantValue(1);", - " }", - " update(system, delta) {", - " if (EmitterMode.Random != this.mode) {", - " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", - " }", - " }", - " initialize(p) {", - " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", - " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", - " const theta = u * this.arc;", - " const r = Math.sqrt(rand);", - " const sinTheta = Math.sin(theta);", - " const cosTheta = Math.cos(theta);", - " p.position.x = r * cosTheta;", - " p.position.y = r * sinTheta;", - " p.position.z = 0;", - " const angle = this.angle * r;", - " p.velocity.set(0, 0, Math.cos(angle)).addScaledVector(p.position, Math.sin(angle)).multiplyScalar(p.startSpeed);", - " p.position.multiplyScalar(this.radius);", - " }", - " toJSON() {", - " return {", - " type: 'cone',", - " radius: this.radius,", - " arc: this.arc,", - " thickness: this.thickness,", - " angle: this.angle,", - " mode: this.mode,", - " spread: this.spread,", - " speed: this.speed.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new ConeEmitter({", - " radius: json.radius,", - " arc: json.arc,", - " thickness: json.thickness,", - " angle: json.angle,", - " mode: json.mode,", - " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", - " spread: json.spread,", - " });", - " }", - " clone() {", - " return new ConeEmitter({", - " radius: this.radius,", - " arc: this.arc,", - " thickness: this.thickness,", - " angle: this.angle,", - " mode: this.mode,", - " speed: this.speed.clone(),", - " spread: this.spread,", - " });", - " }", - "}", - "", - "class CircleEmitter {", - " constructor(parameters = {}) {", - " var _a, _b, _c, _d, _e, _f;", - " this.type = 'circle';", - " this.currentValue = 0;", - " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", - " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", - " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", - " this.mode = (_d = parameters.mode) !== null && _d !== void 0 ? _d : EmitterMode.Random;", - " this.spread = (_e = parameters.spread) !== null && _e !== void 0 ? _e : 0;", - " this.speed = (_f = parameters.speed) !== null && _f !== void 0 ? _f : new ConstantValue(1);", - " }", - " update(system, delta) {", - " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", - " }", - " initialize(p) {", - " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", - " const r = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", - " const theta = u * this.arc;", - " p.position.x = Math.cos(theta);", - " p.position.y = Math.sin(theta);", - " p.position.z = 0;", - " p.velocity.copy(p.position).multiplyScalar(p.startSpeed);", - " p.position.multiplyScalar(this.radius * r);", - " }", - " toJSON() {", - " return {", - " type: 'circle',", - " radius: this.radius,", - " arc: this.arc,", - " thickness: this.thickness,", - " mode: this.mode,", - " spread: this.spread,", - " speed: this.speed.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new CircleEmitter({", - " radius: json.radius,", - " arc: json.arc,", - " thickness: json.thickness,", - " mode: json.mode,", - " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", - " spread: json.spread,", - " });", - " }", - " clone() {", - " return new CircleEmitter({", - " radius: this.radius,", - " arc: this.arc,", - " thickness: this.thickness,", - " mode: this.mode,", - " speed: this.speed.clone(),", - " spread: this.spread,", - " });", - " }", - "}", - "", - "class DonutEmitter {", - " constructor(parameters = {}) {", - " var _a, _b, _c, _d, _e, _f, _g;", - " this.type = 'donut';", - " this.currentValue = 0;", - " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", - " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", - " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", - " this.donutRadius = (_d = parameters.donutRadius) !== null && _d !== void 0 ? _d : this.radius * 0.2;", - " this.mode = (_e = parameters.mode) !== null && _e !== void 0 ? _e : EmitterMode.Random;", - " this.spread = (_f = parameters.spread) !== null && _f !== void 0 ? _f : 0;", - " this.speed = (_g = parameters.speed) !== null && _g !== void 0 ? _g : new ConstantValue(1);", - " }", - " update(system, delta) {", - " if (EmitterMode.Random != this.mode) {", - " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", - " }", - " }", - " initialize(p) {", - " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", - " const v = Math.random();", - " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", - " const theta = u * this.arc;", - " const phi = v * Math.PI * 2;", - " const sinTheta = Math.sin(theta);", - " const cosTheta = Math.cos(theta);", - " p.position.x = this.radius * cosTheta;", - " p.position.y = this.radius * sinTheta;", - " p.position.z = 0;", - " p.velocity.z = this.donutRadius * rand * Math.sin(phi);", - " p.velocity.x = this.donutRadius * rand * Math.cos(phi) * cosTheta;", - " p.velocity.y = this.donutRadius * rand * Math.cos(phi) * sinTheta;", - " p.position.add(p.velocity);", - " p.velocity.normalize().multiplyScalar(p.startSpeed);", - " }", - " toJSON() {", - " return {", - " type: 'donut',", - " radius: this.radius,", - " arc: this.arc,", - " thickness: this.thickness,", - " donutRadius: this.donutRadius,", - " mode: this.mode,", - " spread: this.spread,", - " speed: this.speed.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new DonutEmitter({", - " radius: json.radius,", - " arc: json.arc,", - " thickness: json.thickness,", - " donutRadius: json.donutRadius,", - " mode: json.mode,", - " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", - " spread: json.spread,", - " });", - " }", - " clone() {", - " return new DonutEmitter({", - " radius: this.radius,", - " arc: this.arc,", - " thickness: this.thickness,", - " donutRadius: this.donutRadius,", - " mode: this.mode,", - " speed: this.speed.clone(),", - " spread: this.spread,", - " });", - " }", - "}", - "", - "class PointEmitter {", - " constructor() {", - " this.type = 'point';", - " }", - " update(system, delta) { }", - " initialize(p) {", - " const u = Math.random();", - " const v = Math.random();", - " const theta = u * Math.PI * 2;", - " const phi = Math.acos(2.0 * v - 1.0);", - " const r = Math.cbrt(Math.random());", - " const sinTheta = Math.sin(theta);", - " const cosTheta = Math.cos(theta);", - " const sinPhi = Math.sin(phi);", - " const cosPhi = Math.cos(phi);", - " p.velocity.x = r * sinPhi * cosTheta;", - " p.velocity.y = r * sinPhi * sinTheta;", - " p.velocity.z = r * cosPhi;", - " p.velocity.multiplyScalar(p.startSpeed);", - " p.position.setScalar(0);", - " }", - " toJSON() {", - " return {", - " type: 'point',", - " };", - " }", - " static fromJSON(json) {", - " return new PointEmitter();", - " }", - " clone() {", - " return new PointEmitter();", - " }", - "}", - "", - "class SphereEmitter {", - " constructor(parameters = {}) {", - " var _a, _b, _c, _d, _e, _f;", - " this.type = 'sphere';", - " this.currentValue = 0;", - " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", - " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", - " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", - " this.mode = (_d = parameters.mode) !== null && _d !== void 0 ? _d : EmitterMode.Random;", - " this.spread = (_e = parameters.spread) !== null && _e !== void 0 ? _e : 0;", - " this.speed = (_f = parameters.speed) !== null && _f !== void 0 ? _f : new ConstantValue(1);", - " }", - " update(system, delta) {", - " if (EmitterMode.Random != this.mode) {", - " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", - " }", - " }", - " initialize(p) {", - " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", - " const v = Math.random();", - " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", - " const theta = u * this.arc;", - " const phi = Math.acos(2.0 * v - 1.0);", - " const sinTheta = Math.sin(theta);", - " const cosTheta = Math.cos(theta);", - " const sinPhi = Math.sin(phi);", - " const cosPhi = Math.cos(phi);", - " p.position.x = sinPhi * cosTheta;", - " p.position.y = sinPhi * sinTheta;", - " p.position.z = cosPhi;", - " p.velocity.copy(p.position).multiplyScalar(p.startSpeed);", - " p.position.multiplyScalar(this.radius * rand);", - " }", - " toJSON() {", - " return {", - " type: 'sphere',", - " radius: this.radius,", - " arc: this.arc,", - " thickness: this.thickness,", - " mode: this.mode,", - " spread: this.spread,", - " speed: this.speed.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new SphereEmitter({", - " radius: json.radius,", - " arc: json.arc,", - " thickness: json.thickness,", - " mode: json.mode,", - " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", - " spread: json.spread,", - " });", - " }", - " clone() {", - " return new SphereEmitter({", - " radius: this.radius,", - " arc: this.arc,", - " thickness: this.thickness,", - " mode: this.mode,", - " speed: this.speed.clone(),", - " spread: this.spread,", - " });", - " }", - "}", - "", - "class HemisphereEmitter {", - " constructor(parameters = {}) {", - " var _a, _b, _c, _d, _e, _f;", - " this.type = 'sphere';", - " this.currentValue = 0;", - " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", - " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", - " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", - " this.mode = (_d = parameters.mode) !== null && _d !== void 0 ? _d : EmitterMode.Random;", - " this.spread = (_e = parameters.spread) !== null && _e !== void 0 ? _e : 0;", - " this.speed = (_f = parameters.speed) !== null && _f !== void 0 ? _f : new ConstantValue(1);", - " }", - " update(system, delta) {", - " if (EmitterMode.Random != this.mode) {", - " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", - " }", - " }", - " initialize(p) {", - " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", - " const v = Math.random();", - " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", - " const theta = u * this.arc;", - " const phi = Math.acos(v);", - " const sinTheta = Math.sin(theta);", - " const cosTheta = Math.cos(theta);", - " const sinPhi = Math.sin(phi);", - " const cosPhi = Math.cos(phi);", - " p.position.x = sinPhi * cosTheta;", - " p.position.y = sinPhi * sinTheta;", - " p.position.z = cosPhi;", - " p.velocity.copy(p.position).multiplyScalar(p.startSpeed);", - " p.position.multiplyScalar(this.radius * rand);", - " }", - " toJSON() {", - " return {", - " type: 'hemisphere',", - " radius: this.radius,", - " arc: this.arc,", - " thickness: this.thickness,", - " mode: this.mode,", - " spread: this.spread,", - " speed: this.speed.toJSON(),", - " };", - " }", - " static fromJSON(json) {", - " return new HemisphereEmitter({", - " radius: json.radius,", - " arc: json.arc,", - " thickness: json.thickness,", - " mode: json.mode,", - " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", - " spread: json.spread,", - " });", - " }", - " clone() {", - " return new HemisphereEmitter({", - " radius: this.radius,", - " arc: this.arc,", - " thickness: this.thickness,", - " mode: this.mode,", - " speed: this.speed.clone(),", - " spread: this.spread,", - " });", - " }", - "}", - "", - "class GridEmitter {", - " constructor(parameters = {}) {", - " var _a, _b, _c, _d;", - " this.type = 'grid';", - " this.width = (_a = parameters.width) !== null && _a !== void 0 ? _a : 1;", - " this.height = (_b = parameters.height) !== null && _b !== void 0 ? _b : 1;", - " this.column = (_c = parameters.column) !== null && _c !== void 0 ? _c : 10;", - " this.row = (_d = parameters.row) !== null && _d !== void 0 ? _d : 10;", - " }", - " initialize(p) {", - " const r = Math.floor(Math.random() * this.row);", - " const c = Math.floor(Math.random() * this.column);", - " p.position.x = (c * this.width) / this.column - this.width / 2;", - " p.position.y = (r * this.height) / this.row - this.height / 2;", - " p.position.z = 0;", - " p.velocity.set(0, 0, p.startSpeed);", - " }", - " toJSON() {", - " return {", - " type: 'grid',", - " width: this.width,", - " height: this.height,", - " column: this.column,", - " row: this.row,", - " };", - " }", - " static fromJSON(json) {", - " return new GridEmitter(json);", - " }", - " clone() {", - " return new GridEmitter({", - " width: this.width,", - " height: this.height,", - " column: this.column,", - " row: this.row,", - " });", - " }", - " update(system, delta) { }", - "}", - "", - "class MeshSurfaceEmitter {", - " get geometry() {", - " return this._geometry;", - " }", - " set geometry(geometry) {", - " this._geometry = geometry;", - " if (geometry === undefined) {", - " return;", - " }", - " if (typeof geometry === 'string') {", - " return;", - " }", - " const tri = new THREE.Triangle();", - " this._triangleIndexToArea.length = 0;", - " let area = 0;", - " if (!geometry.getIndex()) {", - " return;", - " }", - " const array = geometry.getIndex().array;", - " const triCount = array.length / 3;", - " this._triangleIndexToArea.push(0);", - " for (let i = 0; i < triCount; i++) {", - " tri.setFromAttributeAndIndices(geometry.getAttribute('position'), array[i * 3], array[i * 3 + 1], array[i * 3 + 2]);", - " area += tri.getArea();", - " this._triangleIndexToArea.push(area);", - " }", - " geometry.userData.triangleIndexToArea = this._triangleIndexToArea;", - " }", - " constructor(geometry) {", - " this.type = 'mesh_surface';", - " this._triangleIndexToArea = [];", - " this._tempA = new THREE.Vector3();", - " this._tempB = new THREE.Vector3();", - " this._tempC = new THREE.Vector3();", - " if (!geometry) {", - " return;", - " }", - " this.geometry = geometry;", - " }", - " initialize(p) {", - " const geometry = this._geometry;", - " if (!geometry || geometry.getIndex() === null) {", - " p.position.set(0, 0, 0);", - " p.velocity.set(0, 0, 1).multiplyScalar(p.startSpeed);", - " return;", - " }", - " const triCount = this._triangleIndexToArea.length - 1;", - " let left = 0, right = triCount;", - " const target = Math.random() * this._triangleIndexToArea[triCount];", - " while (left + 1 < right) {", - " const mid = Math.floor((left + right) / 2);", - " if (target < this._triangleIndexToArea[mid]) {", - " right = mid;", - " }", - " else {", - " left = mid;", - " }", - " }", - " let u1 = Math.random();", - " let u2 = Math.random();", - " if (u1 + u2 > 1) {", - " u1 = 1 - u1;", - " u2 = 1 - u2;", - " }", - " const index1 = geometry.getIndex().array[left * 3];", - " const index2 = geometry.getIndex().array[left * 3 + 1];", - " const index3 = geometry.getIndex().array[left * 3 + 2];", - " const positionBuffer = geometry.getAttribute('position');", - " this._tempA.fromBufferAttribute(positionBuffer, index1);", - " this._tempB.fromBufferAttribute(positionBuffer, index2);", - " this._tempC.fromBufferAttribute(positionBuffer, index3);", - " this._tempB.sub(this._tempA);", - " this._tempC.sub(this._tempA);", - " this._tempA.addScaledVector(this._tempB, u1).addScaledVector(this._tempC, u2);", - " p.position.copy(this._tempA);", - " this._tempA.copy(this._tempB).cross(this._tempC).normalize();", - " p.velocity.copy(this._tempA).normalize().multiplyScalar(p.startSpeed);", - " }", - " toJSON() {", - " return {", - " type: 'mesh_surface',", - " mesh: this._geometry ? this._geometry.uuid : '',", - " };", - " }", - " static fromJSON(json, meta) {", - " return new MeshSurfaceEmitter(meta.geometries[json.geometry]);", - " }", - " clone() {", - " return new MeshSurfaceEmitter(this._geometry);", - " }", - " update(system, delta) { }", - "}", - "", - "const EmitterShapes = {", - " circle: {", - " type: 'circle',", - " params: [", - " ['radius', 'number'],", - " ['arc', 'radian'],", - " ['thickness', 'number'],", - " ['mode', 'emitterMode'],", - " ['spread', 'number'],", - " ['speed', 'valueFunc'],", - " ],", - " constructor: CircleEmitter,", - " loadJSON: CircleEmitter.fromJSON,", - " },", - " cone: {", - " type: 'cone',", - " params: [", - " ['radius', 'number'],", - " ['arc', 'radian'],", - " ['thickness', 'number'],", - " ['angle', 'radian'],", - " ['mode', 'emitterMode'],", - " ['spread', 'number'],", - " ['speed', 'valueFunc'],", - " ],", - " constructor: ConeEmitter,", - " loadJSON: ConeEmitter.fromJSON,", - " },", - " donut: {", - " type: 'donut',", - " params: [", - " ['radius', 'number'],", - " ['arc', 'radian'],", - " ['thickness', 'number'],", - " ['donutRadius', 'number'],", - " ['mode', 'emitterMode'],", - " ['spread', 'number'],", - " ['speed', 'valueFunc'],", - " ],", - " constructor: DonutEmitter,", - " loadJSON: DonutEmitter.fromJSON,", - " },", - " point: { type: 'point', params: [], constructor: PointEmitter, loadJSON: PointEmitter.fromJSON },", - " sphere: {", - " type: 'sphere',", - " params: [", - " ['radius', 'number'],", - " ['arc', 'radian'],", - " ['thickness', 'number'],", - " ['angle', 'radian'],", - " ['mode', 'emitterMode'],", - " ['spread', 'number'],", - " ['speed', 'valueFunc'],", - " ],", - " constructor: SphereEmitter,", - " loadJSON: SphereEmitter.fromJSON,", - " },", - " hemisphere: {", - " type: 'hemisphere',", - " params: [", - " ['radius', 'number'],", - " ['arc', 'radian'],", - " ['thickness', 'number'],", - " ['angle', 'radian'],", - " ['mode', 'emitterMode'],", - " ['spread', 'number'],", - " ['speed', 'valueFunc'],", - " ],", - " constructor: HemisphereEmitter,", - " loadJSON: HemisphereEmitter.fromJSON,", - " },", - " grid: {", - " type: 'grid',", - " params: [", - " ['width', 'number'],", - " ['height', 'number'],", - " ['rows', 'number'],", - " ['column', 'number'],", - " ],", - " constructor: GridEmitter,", - " loadJSON: GridEmitter.fromJSON,", - " },", - " mesh_surface: {", - " type: 'mesh_surface',", - " params: [['geometry', 'geometry']],", - " constructor: MeshSurfaceEmitter,", - " loadJSON: MeshSurfaceEmitter.fromJSON,", - " },", - "};", - "function EmitterFromJSON(json, meta) {", - " return EmitterShapes[json.type].loadJSON(json, meta);", - "}", - "", - "let RenderMode = void 0;", - "(function (RenderMode) {", - " RenderMode[RenderMode[\"BillBoard\"] = 0] = \"BillBoard\";", - " RenderMode[RenderMode[\"StretchedBillBoard\"] = 1] = \"StretchedBillBoard\";", - " RenderMode[RenderMode[\"Mesh\"] = 2] = \"Mesh\";", - " RenderMode[RenderMode[\"Trail\"] = 3] = \"Trail\";", - " RenderMode[RenderMode[\"HorizontalBillBoard\"] = 4] = \"HorizontalBillBoard\";", - " RenderMode[RenderMode[\"VerticalBillBoard\"] = 5] = \"VerticalBillBoard\";", - "})(RenderMode || (RenderMode = {}));", - "class VFXBatch extends THREE.Mesh {", - " constructor(settings) {", - " super();", - " this.type = 'VFXBatch';", - " this.maxParticles = 1000;", - " this.systems = new Set();", - " const layers = new THREE.Layers();", - " layers.mask = settings.layers.mask;", - " const newMat = settings.material.clone();", - " newMat.defines = {};", - " Object.assign(newMat.defines, settings.material.defines);", - " this.settings = {", - " instancingGeometry: settings.instancingGeometry,", - " renderMode: settings.renderMode,", - " renderOrder: settings.renderOrder,", - " material: newMat,", - " uTileCount: settings.uTileCount,", - " vTileCount: settings.vTileCount,", - " layers: layers,", - " };", - " this.frustumCulled = false;", - " this.renderOrder = this.settings.renderOrder;", - " }", - " addSystem(system) {", - " this.systems.add(system);", - " }", - " removeSystem(system) {", - " this.systems.delete(system);", - " }", - "}", - "", - "const UP = new THREE.Vector3(0, 0, 1);", - "const tempQ$1 = new THREE.Quaternion();", - "const tempV$1 = new THREE.Vector3();", - "const tempV2$1 = new THREE.Vector3();", - "new THREE.Vector3();", - "const PREWARM_FPS$1 = 60;", - "const DEFAULT_GEOMETRY$1 = new THREE.PlaneGeometry(1, 1, 1, 1);", - "class ParticleSystem {", - " set time(time) {", - " this.emissionState.time = time;", - " }", - " get time() {", - " return this.emissionState.time;", - " }", - " get layers() {", - " return this.rendererSettings.layers;", - " }", - " get texture() {", - " return this.rendererSettings.material.map;", - " }", - " set texture(texture) {", - " this.rendererSettings.material.map = texture;", - " this.neededToUpdateRender = true;", - " }", - " get material() {", - " return this.rendererSettings.material;", - " }", - " set material(material) {", - " this.rendererSettings.material = material;", - " this.neededToUpdateRender = true;", - " }", - " get uTileCount() {", - " return this.rendererSettings.uTileCount;", - " }", - " set uTileCount(u) {", - " this.rendererSettings.uTileCount = u;", - " this.neededToUpdateRender = true;", - " }", - " get vTileCount() {", - " return this.rendererSettings.vTileCount;", - " }", - " set vTileCount(v) {", - " this.rendererSettings.vTileCount = v;", - " this.neededToUpdateRender = true;", - " }", - " get instancingGeometry() {", - " return this.rendererSettings.instancingGeometry;", - " }", - " set instancingGeometry(geometry) {", - " this.restart();", - " this.particles.length = 0;", - " this.rendererSettings.instancingGeometry = geometry;", - " this.neededToUpdateRender = true;", - " }", - " get renderMode() {", - " return this.rendererSettings.renderMode;", - " }", - " set renderMode(renderMode) {", - " if ((this.rendererSettings.renderMode != RenderMode.Trail && renderMode === RenderMode.Trail) ||", - " (this.rendererSettings.renderMode == RenderMode.Trail && renderMode !== RenderMode.Trail)) {", - " this.restart();", - " this.particles.length = 0;", - " }", - " if (this.rendererSettings.renderMode !== renderMode) {", - " switch (renderMode) {", - " case RenderMode.Trail:", - " this.rendererEmitterSettings = {", - " startLength: new ConstantValue(30),", - " followLocalOrigin: false,", - " };", - " break;", - " case RenderMode.Mesh:", - " this.rendererEmitterSettings = {", - " geometry: new THREE.PlaneGeometry(1, 1),", - " };", - " this.startRotation = new AxisAngleGenerator(new THREE.Vector3(0, 1, 0), new ConstantValue(0));", - " break;", - " case RenderMode.StretchedBillBoard:", - " this.rendererEmitterSettings = { speedFactor: 0, lengthFactor: 2 };", - " if (this.rendererSettings.renderMode === RenderMode.Mesh) {", - " this.startRotation = new ConstantValue(0);", - " }", - " break;", - " case RenderMode.BillBoard:", - " case RenderMode.VerticalBillBoard:", - " case RenderMode.HorizontalBillBoard:", - " this.rendererEmitterSettings = {};", - " if (this.rendererSettings.renderMode === RenderMode.Mesh) {", - " this.startRotation = new ConstantValue(0);", - " }", - " break;", - " }", - " }", - " this.rendererSettings.renderMode = renderMode;", - " this.neededToUpdateRender = true;", - " }", - " get renderOrder() {", - " return this.rendererSettings.renderOrder;", - " }", - " set renderOrder(renderOrder) {", - " this.rendererSettings.renderOrder = renderOrder;", - " this.neededToUpdateRender = true;", - " }", - " get blending() {", - " return this.rendererSettings.material.blending;", - " }", - " set blending(blending) {", - " this.rendererSettings.material.blending = blending;", - " this.neededToUpdateRender = true;", - " }", - " constructor(parameters) {", - " var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;", - " this.temp = new THREE.Vector3();", - " this.travelDistance = 0;", - " this.normalMatrix = new THREE.Matrix3();", - " this.firstTimeUpdate = true;", - " this.autoDestroy = parameters.autoDestroy === undefined ? false : parameters.autoDestroy;", - " this.duration = (_a = parameters.duration) !== null && _a !== void 0 ? _a : 1;", - " this.looping = parameters.looping === undefined ? true : parameters.looping;", - " this.prewarm = parameters.prewarm === undefined ? false : parameters.prewarm;", - " this.startLife = (_b = parameters.startLife) !== null && _b !== void 0 ? _b : new ConstantValue(5);", - " this.startSpeed = (_c = parameters.startSpeed) !== null && _c !== void 0 ? _c : new ConstantValue(0);", - " this.startRotation = (_d = parameters.startRotation) !== null && _d !== void 0 ? _d : new ConstantValue(0);", - " this.startSize = (_e = parameters.startSize) !== null && _e !== void 0 ? _e : new ConstantValue(1);", - " this.startColor = (_f = parameters.startColor) !== null && _f !== void 0 ? _f : new ConstantColor(new THREE.Vector4(1, 1, 1, 1));", - " this.emissionOverTime = (_g = parameters.emissionOverTime) !== null && _g !== void 0 ? _g : new ConstantValue(10);", - " this.emissionOverDistance = (_h = parameters.emissionOverDistance) !== null && _h !== void 0 ? _h : new ConstantValue(0);", - " this.emissionBursts = (_j = parameters.emissionBursts) !== null && _j !== void 0 ? _j : [];", - " this.onlyUsedByOther = (_k = parameters.onlyUsedByOther) !== null && _k !== void 0 ? _k : false;", - " this.emitterShape = (_l = parameters.shape) !== null && _l !== void 0 ? _l : new SphereEmitter();", - " this.behaviors = (_m = parameters.behaviors) !== null && _m !== void 0 ? _m : new Array();", - " this.worldSpace = (_o = parameters.worldSpace) !== null && _o !== void 0 ? _o : false;", - " this.rendererEmitterSettings = (_p = parameters.rendererEmitterSettings) !== null && _p !== void 0 ? _p : {};", - " if (parameters.renderMode === RenderMode.StretchedBillBoard) {", - " const stretchedBillboardSettings = this.rendererEmitterSettings;", - " if (parameters.speedFactor !== undefined) {", - " stretchedBillboardSettings.speedFactor = parameters.speedFactor;", - " }", - " stretchedBillboardSettings.speedFactor = (_q = stretchedBillboardSettings.speedFactor) !== null && _q !== void 0 ? _q : 0;", - " stretchedBillboardSettings.lengthFactor = (_r = stretchedBillboardSettings.lengthFactor) !== null && _r !== void 0 ? _r : 0;", - " }", - " this.rendererSettings = {", - " instancingGeometry: (_s = parameters.instancingGeometry) !== null && _s !== void 0 ? _s : DEFAULT_GEOMETRY$1,", - " renderMode: (_t = parameters.renderMode) !== null && _t !== void 0 ? _t : RenderMode.BillBoard,", - " renderOrder: (_u = parameters.renderOrder) !== null && _u !== void 0 ? _u : 0,", - " material: parameters.material,", - " uTileCount: (_v = parameters.uTileCount) !== null && _v !== void 0 ? _v : 1,", - " vTileCount: (_w = parameters.vTileCount) !== null && _w !== void 0 ? _w : 1,", - " layers: (_x = parameters.layers) !== null && _x !== void 0 ? _x : new THREE.Layers(),", - " };", - " this.neededToUpdateRender = true;", - " this.particles = new Array();", - " this.startTileIndex = parameters.startTileIndex || new ConstantValue(0);", - " this.emitter = new ParticleEmitter(this);", - " this.paused = false;", - " this.particleNum = 0;", - " this.emissionState = {", - " burstIndex: 0,", - " burstWaveIndex: 0,", - " time: 0,", - " waitEmiting: 0,", - " travelDistance: 0,", - " };", - " this.emitEnded = false;", - " this.markForDestroy = false;", - " this.prewarmed = false;", - " }", - " pause() {", - " this.paused = true;", - " }", - " play() {", - " this.paused = false;", - " }", - " spawn(count, emissionState, matrix) {", - " tempQ$1.setFromRotationMatrix(matrix);", - " const translation = tempV$1;", - " const quaternion = tempQ$1;", - " const scale = tempV2$1;", - " matrix.decompose(translation, quaternion, scale);", - " for (let i = 0; i < count; i++) {", - " this.particleNum++;", - " while (this.particles.length < this.particleNum) {", - " if (this.rendererSettings.renderMode === RenderMode.Trail) {", - " this.particles.push(new TrailParticle());", - " }", - " else {", - " this.particles.push(new SpriteParticle());", - " }", - " }", - " const particle = this.particles[this.particleNum - 1];", - " particle.speedModifier = 1;", - " this.startColor.genColor(particle.startColor, this.emissionState.time, {});", - " particle.color.copy(particle.startColor);", - " particle.startSpeed = this.startSpeed.genValue(emissionState.time / this.duration);", - " particle.life = this.startLife.genValue(emissionState.time / this.duration);", - " particle.age = 0;", - " particle.startSize = this.startSize.genValue(emissionState.time / this.duration);", - " particle.uvTile = Math.floor(this.startTileIndex.genValue() + 0.001);", - " particle.size = particle.startSize;", - " if (this.rendererSettings.renderMode === RenderMode.Mesh ||", - " this.rendererSettings.renderMode === RenderMode.BillBoard ||", - " this.rendererSettings.renderMode === RenderMode.VerticalBillBoard ||", - " this.rendererSettings.renderMode === RenderMode.HorizontalBillBoard ||", - " this.rendererSettings.renderMode === RenderMode.StretchedBillBoard) {", - " const sprite = particle;", - " if (this.rendererSettings.renderMode === RenderMode.Mesh) {", - " if (!(sprite.rotation instanceof THREE.Quaternion)) {", - " sprite.rotation = new THREE.Quaternion();", - " }", - " if (this.startRotation.type === 'rotation') {", - " this.startRotation.genValue(sprite.rotation, emissionState.time / this.duration);", - " }", - " else {", - " sprite.rotation.setFromAxisAngle(UP, this.startRotation.genValue((emissionState.time / this.duration)));", - " }", - " }", - " else {", - " if (this.startRotation.type === 'rotation') {", - " sprite.rotation = 0;", - " }", - " else {", - " sprite.rotation = this.startRotation.genValue(emissionState.time / this.duration);", - " }", - " }", - " }", - " else if (this.rendererSettings.renderMode === RenderMode.Trail) {", - " const trail = particle;", - " trail.length = this.rendererEmitterSettings.startLength.genValue(emissionState.time / this.duration);", - " }", - " this.emitterShape.initialize(particle);", - " if (this.rendererSettings.renderMode === RenderMode.Trail &&", - " this.rendererEmitterSettings.followLocalOrigin) {", - " const trail = particle;", - " trail.localPosition = new THREE.Vector3().copy(trail.position);", - " }", - " if (this.worldSpace) {", - " particle.position.applyMatrix4(matrix);", - " particle.startSize =", - " (particle.startSize * (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z))) / 3;", - " particle.size = particle.startSize;", - " particle.velocity.multiply(scale).applyMatrix3(this.normalMatrix);", - " if (particle.rotation && particle.rotation instanceof THREE.Quaternion) {", - " particle.rotation.multiplyQuaternions(tempQ$1, particle.rotation);", - " }", - " }", - " else {", - " if (this.onlyUsedByOther) {", - " particle.parentMatrix = matrix;", - " }", - " }", - " for (let j = 0; j < this.behaviors.length; j++) {", - " this.behaviors[j].initialize(particle);", - " }", - " }", - " }", - " endEmit() {", - " this.emitEnded = true;", - " if (this.autoDestroy) {", - " this.markForDestroy = true;", - " }", - " }", - " dispose() {", - " if (this._renderer)", - " this._renderer.deleteSystem(this);", - " this.emitter.dispose();", - " if (this.emitter.parent)", - " this.emitter.parent.remove(this.emitter);", - " }", - " restart() {", - " this.paused = false;", - " this.particleNum = 0;", - " this.emissionState.burstIndex = 0;", - " this.emissionState.burstWaveIndex = 0;", - " this.emissionState.time = 0;", - " this.emissionState.waitEmiting = 0;", - " this.behaviors.forEach((behavior) => {", - " behavior.reset();", - " });", - " this.emitEnded = false;", - " this.markForDestroy = false;", - " this.prewarmed = false;", - " }", - " update(delta) {", - " if (this.paused)", - " return;", - " let currentParent = this.emitter;", - " while (currentParent.parent) {", - " currentParent = currentParent.parent;", - " }", - " if (currentParent.type !== 'Scene') {", - " this.dispose();", - " return;", - " }", - " if (this.firstTimeUpdate) {", - " this.firstTimeUpdate = false;", - " this.emitter.updateWorldMatrix(true, false);", - " }", - " if (this.emitEnded && this.particleNum === 0) {", - " if (this.markForDestroy && this.emitter.parent)", - " this.dispose();", - " return;", - " }", - " if (this.looping && this.prewarm && !this.prewarmed) {", - " this.prewarmed = true;", - " for (let i = 0; i < this.duration * PREWARM_FPS$1; i++) {", - " this.update(1.0 / PREWARM_FPS$1);", - " }", - " }", - " if (delta > 0.1) {", - " delta = 0.1;", - " }", - " if (this.neededToUpdateRender) {", - " if (this._renderer)", - " this._renderer.updateSystem(this);", - " this.neededToUpdateRender = false;", - " }", - " if (!this.onlyUsedByOther) {", - " this.emit(delta, this.emissionState, this.emitter.matrixWorld);", - " }", - " this.emitterShape.update(this, delta);", - " for (let j = 0; j < this.behaviors.length; j++) {", - " for (let i = 0; i < this.particleNum; i++) {", - " if (!this.particles[i].died) {", - " this.behaviors[j].update(this.particles[i], delta);", - " }", - " }", - " this.behaviors[j].frameUpdate(delta);", - " }", - " for (let i = 0; i < this.particleNum; i++) {", - " if (this.rendererEmitterSettings.followLocalOrigin &&", - " this.particles[i].localPosition) {", - " this.particles[i].position.copy(this.particles[i].localPosition);", - " if (this.particles[i].parentMatrix) {", - " this.particles[i].position.applyMatrix4(this.particles[i].parentMatrix);", - " }", - " else {", - " this.particles[i].position.applyMatrix4(this.emitter.matrixWorld);", - " }", - " }", - " else {", - " this.particles[i].position.addScaledVector(this.particles[i].velocity, delta * this.particles[i].speedModifier);", - " }", - " this.particles[i].age += delta;", - " }", - " if (this.rendererSettings.renderMode === RenderMode.Trail) {", - " for (let i = 0; i < this.particleNum; i++) {", - " const particle = this.particles[i];", - " particle.update();", - " }", - " }", - " for (let i = 0; i < this.particleNum; i++) {", - " const particle = this.particles[i];", - " if (particle.died && (!(particle instanceof TrailParticle) || particle.previous.length === 0)) {", - " this.particles[i] = this.particles[this.particleNum - 1];", - " this.particles[this.particleNum - 1] = particle;", - " this.particleNum--;", - " i--;", - " }", - " }", - " }", - " emit(delta, emissionState, emitterMatrix) {", - " if (emissionState.time > this.duration) {", - " if (this.looping) {", - " emissionState.time -= this.duration;", - " emissionState.burstIndex = 0;", - " this.behaviors.forEach((behavior) => {", - " behavior.reset();", - " });", - " }", - " else {", - " if (!this.emitEnded && !this.onlyUsedByOther) {", - " this.endEmit();", - " }", - " }", - " }", - " this.normalMatrix.getNormalMatrix(emitterMatrix);", - " const totalSpawn = Math.ceil(emissionState.waitEmiting);", - " this.spawn(totalSpawn, emissionState, emitterMatrix);", - " emissionState.waitEmiting -= totalSpawn;", - " while (emissionState.burstIndex < this.emissionBursts.length &&", - " this.emissionBursts[emissionState.burstIndex].time <= emissionState.time) {", - " if (Math.random() < this.emissionBursts[emissionState.burstIndex].probability) {", - " const count = this.emissionBursts[emissionState.burstIndex].count.genValue(this.time);", - " this.spawn(count, emissionState, emitterMatrix);", - " }", - " emissionState.burstIndex++;", - " }", - " if (!this.emitEnded) {", - " emissionState.waitEmiting += delta * this.emissionOverTime.genValue(emissionState.time / this.duration);", - " if (emissionState.previousWorldPos != undefined) {", - " this.temp.set(emitterMatrix.elements[12], emitterMatrix.elements[13], emitterMatrix.elements[14]);", - " emissionState.travelDistance += emissionState.previousWorldPos.distanceTo(this.temp);", - " const emitPerMeter = this.emissionOverDistance.genValue(emissionState.time / this.duration);", - " if (emissionState.travelDistance * emitPerMeter > 0) {", - " const count = Math.floor(emissionState.travelDistance * emitPerMeter);", - " emissionState.travelDistance -= count / emitPerMeter;", - " emissionState.waitEmiting += count;", - " }", - " }", - " }", - " if (emissionState.previousWorldPos === undefined)", - " emissionState.previousWorldPos = new THREE.Vector3();", - " emissionState.previousWorldPos.set(emitterMatrix.elements[12], emitterMatrix.elements[13], emitterMatrix.elements[14]);", - " emissionState.time += delta;", - " }", - " toJSON(meta, options = {}) {", - " const isRootObject = meta === undefined || typeof meta === 'string';", - " if (isRootObject) {", - " meta = {", - " geometries: {},", - " materials: {},", - " textures: {},", - " images: {},", - " shapes: {},", - " skeletons: {},", - " animations: {},", - " nodes: {},", - " };", - " }", - " meta.materials[this.rendererSettings.material.uuid] = this.rendererSettings.material.toJSON(meta);", - " if (options.useUrlForImage) {", - " if (this.texture.source !== undefined) {", - " const image = this.texture.source;", - " meta.images[image.uuid] = {", - " uuid: image.uuid,", - " url: this.texture.image.url,", - " };", - " }", - " }", - " let rendererSettingsJSON;", - " if (this.renderMode === RenderMode.Trail) {", - " rendererSettingsJSON = {", - " startLength: this.rendererEmitterSettings.startLength.toJSON(),", - " followLocalOrigin: this.rendererEmitterSettings.followLocalOrigin,", - " };", - " }", - " else if (this.renderMode === RenderMode.Mesh) {", - " rendererSettingsJSON = {};", - " }", - " else if (this.renderMode === RenderMode.StretchedBillBoard) {", - " rendererSettingsJSON = {", - " speedFactor: this.rendererEmitterSettings.speedFactor,", - " lengthFactor: this.rendererEmitterSettings.lengthFactor,", - " };", - " }", - " else {", - " rendererSettingsJSON = {};", - " }", - " const geometry = this.rendererSettings.instancingGeometry;", - " if (meta.geometries && !meta.geometries[geometry.uuid]) {", - " meta.geometries[geometry.uuid] = geometry.toJSON();", - " }", - " return {", - " version: '2.0',", - " autoDestroy: this.autoDestroy,", - " looping: this.looping,", - " prewarm: this.prewarm,", - " duration: this.duration,", - " shape: this.emitterShape.toJSON(),", - " startLife: this.startLife.toJSON(),", - " startSpeed: this.startSpeed.toJSON(),", - " startRotation: this.startRotation.toJSON(),", - " startSize: this.startSize.toJSON(),", - " startColor: this.startColor.toJSON(),", - " emissionOverTime: this.emissionOverTime.toJSON(),", - " emissionOverDistance: this.emissionOverDistance.toJSON(),", - " emissionBursts: this.emissionBursts.map((burst) => ({", - " time: burst.time,", - " count: burst.count.toJSON(),", - " probability: burst.probability,", - " interval: burst.interval,", - " cycle: burst.cycle,", - " })),", - " onlyUsedByOther: this.onlyUsedByOther,", - " instancingGeometry: this.rendererSettings.instancingGeometry.uuid,", - " renderOrder: this.renderOrder,", - " renderMode: this.renderMode,", - " rendererEmitterSettings: rendererSettingsJSON,", - " material: this.rendererSettings.material.uuid,", - " layers: this.layers.mask,", - " startTileIndex: this.startTileIndex.toJSON(),", - " uTileCount: this.uTileCount,", - " vTileCount: this.vTileCount,", - " behaviors: this.behaviors.map((behavior) => behavior.toJSON()),", - " worldSpace: this.worldSpace,", - " };", - " }", - " static fromJSON(json, meta, dependencies) {", - " var _a, _b;", - " const shape = EmitterFromJSON(json.shape, meta);", - " let rendererEmitterSettings;", - " if (json.renderMode === RenderMode.Trail) {", - " let trailSettings = json.rendererEmitterSettings;", - " rendererEmitterSettings = {", - " startLength: trailSettings.startLength != undefined", - " ? ValueGeneratorFromJSON(trailSettings.startLength)", - " : new ConstantValue(30),", - " followLocalOrigin: trailSettings.followLocalOrigin,", - " };", - " }", - " else if (json.renderMode === RenderMode.Mesh) {", - " rendererEmitterSettings = {};", - " }", - " else if (json.renderMode === RenderMode.StretchedBillBoard) {", - " rendererEmitterSettings = json.rendererEmitterSettings;", - " if (json.speedFactor != undefined) {", - " rendererEmitterSettings.speedFactor = json.speedFactor;", - " }", - " }", - " else {", - " rendererEmitterSettings = {};", - " }", - " const layers = new THREE.Layers();", - " if (json.layers) {", - " layers.mask = json.layers;", - " }", - " const ps = new ParticleSystem({", - " autoDestroy: json.autoDestroy,", - " looping: json.looping,", - " prewarm: json.prewarm,", - " duration: json.duration,", - " shape: shape,", - " startLife: ValueGeneratorFromJSON(json.startLife),", - " startSpeed: ValueGeneratorFromJSON(json.startSpeed),", - " startRotation: GeneratorFromJSON(json.startRotation),", - " startSize: ValueGeneratorFromJSON(json.startSize),", - " startColor: ColorGeneratorFromJSON(json.startColor),", - " emissionOverTime: ValueGeneratorFromJSON(json.emissionOverTime),", - " emissionOverDistance: ValueGeneratorFromJSON(json.emissionOverDistance),", - " emissionBursts: (_a = json.emissionBursts) === null || _a === void 0 ? void 0 : _a.map((burst) => ({", - " time: burst.time,", - " count: typeof burst.count === 'number'", - " ? new ConstantValue(burst.count)", - " : ValueGeneratorFromJSON(burst.count),", - " probability: burst.probability,", - " interval: burst.interval,", - " cycle: burst.cycle,", - " })),", - " onlyUsedByOther: json.onlyUsedByOther,", - " instancingGeometry: meta.geometries[json.instancingGeometry],", - " renderMode: json.renderMode,", - " rendererEmitterSettings: rendererEmitterSettings,", - " renderOrder: json.renderOrder,", - " layers: layers,", - " material: json.material", - " ? meta.materials[json.material]", - " : json.texture", - " ? new THREE.MeshBasicMaterial({", - " map: meta.textures[json.texture],", - " transparent: (_b = json.transparent) !== null && _b !== void 0 ? _b : true,", - " blending: json.blending,", - " side: THREE.DoubleSide,", - " })", - " : new THREE.MeshBasicMaterial({", - " color: 0xffffff,", - " transparent: true,", - " blending: THREE.AdditiveBlending,", - " side: THREE.DoubleSide,", - " }),", - " startTileIndex: typeof json.startTileIndex === 'number'", - " ? new ConstantValue(json.startTileIndex)", - " : ValueGeneratorFromJSON(json.startTileIndex),", - " uTileCount: json.uTileCount,", - " vTileCount: json.vTileCount,", - " behaviors: [],", - " worldSpace: json.worldSpace,", - " });", - " ps.behaviors = json.behaviors.map((behaviorJson) => {", - " const behavior = BehaviorFromJSON(behaviorJson, ps);", - " if (behavior.type === 'EmitSubParticleSystem') {", - " dependencies[behaviorJson.subParticleSystem] = behavior;", - " }", - " return behavior;", - " });", - " return ps;", - " }", - " addBehavior(behavior) {", - " this.behaviors.push(behavior);", - " }", - " getRendererSettings() {", - " return this.rendererSettings;", - " }", - " clone() {", - " const newEmissionBursts = [];", - " for (const emissionBurst of this.emissionBursts) {", - " const newEmissionBurst = {};", - " Object.assign(newEmissionBurst, emissionBurst);", - " newEmissionBursts.push(newEmissionBurst);", - " }", - " const newBehaviors = [];", - " for (const behavior of this.behaviors) {", - " newBehaviors.push(behavior.clone());", - " }", - " let rendererEmitterSettings;", - " if (this.renderMode === RenderMode.Trail) {", - " rendererEmitterSettings = {", - " startLength: this.rendererEmitterSettings.startLength.clone(),", - " followLocalOrigin: this.rendererEmitterSettings.followLocalOrigin,", - " };", - " }", - " else {", - " rendererEmitterSettings = {};", - " }", - " const layers = new THREE.Layers();", - " layers.mask = this.layers.mask;", - " return new ParticleSystem({", - " autoDestroy: this.autoDestroy,", - " looping: this.looping,", - " duration: this.duration,", - " shape: this.emitterShape.clone(),", - " startLife: this.startLife.clone(),", - " startSpeed: this.startSpeed.clone(),", - " startRotation: this.startRotation.clone(),", - " startSize: this.startSize.clone(),", - " startColor: this.startColor.clone(),", - " emissionOverTime: this.emissionOverTime.clone(),", - " emissionOverDistance: this.emissionOverDistance.clone(),", - " emissionBursts: newEmissionBursts,", - " onlyUsedByOther: this.onlyUsedByOther,", - " instancingGeometry: this.rendererSettings.instancingGeometry,", - " renderMode: this.renderMode,", - " renderOrder: this.renderOrder,", - " rendererEmitterSettings: rendererEmitterSettings,", - " material: this.rendererSettings.material,", - " startTileIndex: this.startTileIndex,", - " uTileCount: this.uTileCount,", - " vTileCount: this.vTileCount,", - " behaviors: newBehaviors,", - " worldSpace: this.worldSpace,", - " layers: layers,", - " });", - " }", - "}", - "", - "var particle_frag = `", - "", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "", - "void main() {", - "", - " #include ", - " ", - " vec3 outgoingLight = vec3( 0.0 );", - " vec4 diffuseColor = vColor;", - " ", - " #include ", - " ", - " #ifdef USE_MAP", - " diffuseColor *= texture2D( map, vMapUv);", - " #endif", - " ", - " #include ", - "", - " outgoingLight = diffuseColor.rgb;", - " ", - " #ifdef USE_COLOR_AS_ALPHA", - " gl_FragColor = vec4( outgoingLight, diffuseColor.r );", - " #else", - " gl_FragColor = vec4( outgoingLight, diffuseColor.a );", - " #endif", - " ", - " ", - " #include ", - "", - "}", - "`;", - "", - "var particle_physics_frag = `", - "#define STANDARD", - "#ifdef PHYSICAL", - "#define IOR", - "#define SPECULAR", - "#endif", - "uniform vec3 diffuse;", - "uniform vec3 emissive;", - "uniform float roughness;", - "uniform float metalness;", - "uniform float opacity;", - "#ifdef IOR", - "uniform float ior;", - "#endif", - "#ifdef SPECULAR", - "uniform float specularIntensity;", - "uniform vec3 specularColor;", - "#ifdef USE_SPECULARINTENSITYMAP", - "uniform sampler2D specularIntensityMap;", - "#endif", - "#ifdef USE_SPECULARCOLORMAP", - "uniform sampler2D specularColorMap;", - "#endif", - "#endif", - "#ifdef USE_CLEARCOAT", - "uniform float clearcoat;", - "uniform float clearcoatRoughness;", - "#endif", - "#ifdef USE_IRIDESCENCE", - "uniform float iridescence;", - "uniform float iridescenceIOR;", - "uniform float iridescenceThicknessMinimum;", - "uniform float iridescenceThicknessMaximum;", - "#endif", - "#ifdef USE_SHEEN", - "uniform vec3 sheenColor;", - "uniform float sheenRoughness;", - "#ifdef USE_SHEENCOLORMAP", - "uniform sampler2D sheenColorMap;", - "#endif", - "#ifdef USE_SHEENROUGHNESSMAP", - "uniform sampler2D sheenRoughnessMap;", - "#endif", - "#endif", - "", - "varying vec3 vViewPosition;", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "", - "void main() {", - " #include ", - " vec4 diffuseColor = vec4( diffuse, opacity );", - " ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );", - " vec3 totalEmissiveRadiance = emissive;", - " #include ", - " #include ", - " #include ", - " #include ", - " #include ", - " #include ", - " #include ", - " #include ", - " #include ", - " #include ", - " #include ", - " #include ", - " // accumulation", - " #include ", - " #include ", - " #include ", - " #include ", - " // modulation", - " #include ", - " vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;", - " vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;", - " #include ", - " vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;", - " #ifdef USE_SHEEN", - " // Sheen energy compensation approximation calculation can be found at the end of", - " // https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing", - " float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );", - " outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;", - " #endif", - " #ifdef USE_CLEARCOAT", - " float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );", - " vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );", - " outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;", - " #endif", - " #include ", - " #include ", - " #include ", - " #include ", - " #include ", - " #include ", - "}`;", - "", - "var uv_vertex_tile = `", - "", - " #ifdef UV_TILE", - " float col = mod(uvTile, tileCount.x);", - " float row = (tileCount.y - floor(uvTile / tileCount.x) - 1.0);", - " ", - " mat3 tileTransform = mat3(", - " 1.0 / tileCount.x, 0.0, 0.0,", - " 0.0, 1.0 / tileCount.y, 0.0, ", - " col / tileCount.x, row / tileCount.y, 1.0);", - " #else", - " mat3 tileTransform = mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);", - " #endif", - "", - "#if defined( USE_UV ) || defined( USE_ANISOTROPY )", - "", - "vUv = (tileTransform *vec3( uv, 1 )).xy;", - "", - "#endif", - "#ifdef USE_MAP", - "", - "vMapUv = ( tileTransform * (mapTransform * vec3( MAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_ALPHAMAP", - "", - "vAlphaMapUv = ( tileTransform * (alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_LIGHTMAP", - "", - "vLightMapUv = ( tileTransform * (lightMapTransform * vec3( LIGHTMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_AOMAP", - "", - "vAoMapUv = ( tileTransform * (aoMapTransform * vec3( AOMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_BUMPMAP", - "", - "vBumpMapUv = ( tileTransform * (bumpMapTransform * vec3( BUMPMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_NORMALMAP", - "", - "vNormalMapUv = ( tileTransform * (normalMapTransform * vec3( NORMALMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_DISPLACEMENTMAP", - "", - "vDisplacementMapUv = ( tileTransform * (displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_EMISSIVEMAP", - "", - "vEmissiveMapUv = ( tileTransform * (emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_METALNESSMAP", - "", - "vMetalnessMapUv = ( tileTransform * (metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_ROUGHNESSMAP", - "", - "vRoughnessMapUv = ( tileTransform * (roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_ANISOTROPYMAP", - "", - "vAnisotropyMapUv = ( tileTransform * (anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_CLEARCOATMAP", - "", - "vClearcoatMapUv = ( tileTransform * (clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_CLEARCOAT_NORMALMAP", - "", - "vClearcoatNormalMapUv = ( tileTransform * (clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_CLEARCOAT_ROUGHNESSMAP", - "", - "vClearcoatRoughnessMapUv = ( tileTransform * (clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_IRIDESCENCEMAP", - "", - "vIridescenceMapUv = ( tileTransform * (iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_IRIDESCENCE_THICKNESSMAP", - "", - "vIridescenceThicknessMapUv = ( tileTransform * (iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_SHEEN_COLORMAP", - "", - "vSheenColorMapUv = ( tileTransform * (sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_SHEEN_ROUGHNESSMAP", - "", - "vSheenRoughnessMapUv = ( tileTransform * (sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_SPECULARMAP", - "", - "vSpecularMapUv = ( tileTransform * (specularMapTransform * vec3( SPECULARMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_SPECULAR_COLORMAP", - "", - "vSpecularColorMapUv = ( tileTransform * (specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_SPECULAR_INTENSITYMAP", - "", - "vSpecularIntensityMapUv = ( tileTransform * (specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_TRANSMISSIONMAP", - "", - "vTransmissionMapUv = ( tileTransform * transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) )).xy;", - "", - "#endif", - "#ifdef USE_THICKNESSMAP", - "", - "vThicknessMapUv = ( tileTransform * thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) )).xy;", - "", - "#endif", - "`;", - "", - "var particle_vert = `", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "", - "attribute vec3 offset;", - "attribute float rotation;", - "attribute float size;", - "attribute float uvTile;", - "", - "#ifdef UV_TILE", - "uniform vec2 tileCount;", - "#endif", - "", - "void main() {", - "", - " ${uv_vertex_tile}", - "\t", - " vec2 alignedPosition = ( position.xy ) * size;", - " ", - " vec2 rotatedPosition;", - " rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", - " rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", - "#ifdef HORIZONTAL", - " vec4 mvPosition = modelMatrix * vec4( offset, 1.0 );", - " mvPosition.x += rotatedPosition.x;", - " mvPosition.z -= rotatedPosition.y;", - " mvPosition = viewMatrix * mvPosition;", - "#elif defined(VERTICAL)", - " vec4 mvPosition = modelMatrix * vec4( offset, 1.0 );", - " mvPosition.y += rotatedPosition.y;", - " mvPosition = viewMatrix * mvPosition;", - " mvPosition.x += rotatedPosition.x;", - "#else", - " vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );", - " mvPosition.xy += rotatedPosition;", - "#endif", - "", - "\tvColor = color;", - "", - "\tgl_Position = projectionMatrix * mvPosition;", - "", - "\t#include ", - "\t#include ", - "", - "}", - "`;", - "", - "var local_particle_vert = `", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "", - "attribute vec3 offset;", - "attribute vec4 rotation;", - "attribute float size;", - "// attribute vec4 color;", - "attribute float uvTile;", - "", - "#ifdef UV_TILE", - "uniform vec2 tileCount;", - "#endif", - "", - "void main() {", - "", - " ${uv_vertex_tile}", - " ", - " float x2 = rotation.x + rotation.x, y2 = rotation.y + rotation.y, z2 = rotation.z + rotation.z;", - " float xx = rotation.x * x2, xy = rotation.x * y2, xz = rotation.x * z2;", - " float yy = rotation.y * y2, yz = rotation.y * z2, zz = rotation.z * z2;", - " float wx = rotation.w * x2, wy = rotation.w * y2, wz = rotation.w * z2;", - " float sx = size, sy = size, sz = size;", - " ", - " mat4 matrix = mat4(( 1.0 - ( yy + zz ) ) * sx, ( xy + wz ) * sx, ( xz - wy ) * sx, 0.0, // 1. column", - " ( xy - wz ) * sy, ( 1.0 - ( xx + zz ) ) * sy, ( yz + wx ) * sy, 0.0, // 2. column", - " ( xz + wy ) * sz, ( yz - wx ) * sz, ( 1.0 - ( xx + yy ) ) * sz, 0.0, // 3. column", - " offset.x, offset.y, offset.z, 1.0);", - " ", - " vec4 mvPosition = modelViewMatrix * (matrix * vec4( position, 1.0 ));", - "", - "\tvColor = color;", - "", - "\tgl_Position = projectionMatrix * mvPosition;", - "", - "\t#include ", - "\t#include ", - "", - "}", - "`;", - "", - "var local_particle_physics_vert = `", - "#define STANDARD", - "varying vec3 vViewPosition;", - "#ifdef USE_TRANSMISSION", - "\tvarying vec3 vWorldPosition;", - "#endif", - "#include ", - "#include ", - "", - "attribute vec3 offset;", - "attribute vec4 rotation;", - "attribute float size;", - "attribute float uvTile;", - "", - "#ifdef UV_TILE", - "uniform vec2 tileCount;", - "#endif", - "", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "", - "void main() {", - " ${uv_vertex_tile}", - "", - " float x2 = rotation.x + rotation.x, y2 = rotation.y + rotation.y, z2 = rotation.z + rotation.z;", - " float xx = rotation.x * x2, xy = rotation.x * y2, xz = rotation.x * z2;", - " float yy = rotation.y * y2, yz = rotation.y * z2, zz = rotation.z * z2;", - " float wx = rotation.w * x2, wy = rotation.w * y2, wz = rotation.w * z2;", - " float sx = size, sy = size, sz = size;", - "", - " mat4 particleMatrix = mat4(( 1.0 - ( yy + zz ) ) * sx, ( xy + wz ) * sx, ( xz - wy ) * sx, 0.0, // 1. column", - " ( xy - wz ) * sy, ( 1.0 - ( xx + zz ) ) * sy, ( yz + wx ) * sy, 0.0, // 2. column", - " ( xz + wy ) * sz, ( yz - wx ) * sz, ( 1.0 - ( xx + yy ) ) * sz, 0.0, // 3. column", - " offset.x, offset.y, offset.z, 1.0);", - "", - "\t#include ", - "\t#include ", - "\t#include ", - "\t#include ", - "\t#include ", - "\t#include ", - "", - "\t// replace defaultnormal_vertex", - "\tvec3 transformedNormal = objectNormal;", - " mat3 m = mat3( particleMatrix );", - " transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );", - " transformedNormal = m * transformedNormal;", - " transformedNormal = normalMatrix * transformedNormal;", - " #ifdef FLIP_SIDED", - " transformedNormal = - transformedNormal;", - " #endif", - " #ifdef USE_TANGENT", - " vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;", - " #ifdef FLIP_SIDED", - " transformedTangent = - transformedTangent;", - " #endif", - " #endif", - "", - "\t#include ", - "\t#include ", - "\t#include ", - "\t#include ", - "\t#include ", - "", - "\t// replace include ", - " vec4 mvPosition = vec4( transformed, 1.0 );", - " mvPosition = modelViewMatrix * (particleMatrix * mvPosition);", - "\tgl_Position = projectionMatrix * mvPosition;", - "", - "\t#include ", - "\t#include ", - "\t", - "\tvViewPosition = - mvPosition.xyz;", - "\t", - "\t#include ", - "\t#include ", - "\t#include ", - "#ifdef USE_TRANSMISSION", - "\tvWorldPosition = worldPosition.xyz;", - "#endif", - "}", - "`;", - "", - "var stretched_bb_particle_vert = `", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "", - "attribute vec3 offset;", - "attribute float rotation;", - "attribute float size;", - "attribute vec4 velocity;", - "attribute float uvTile;", - "", - "#ifdef UV_TILE", - "uniform vec2 tileCount;", - "#endif", - "", - "uniform float speedFactor;", - "", - "void main() {", - "", - " ${uv_vertex_tile}", - " ", - " float lengthFactor = velocity.w;", - "#ifdef USE_SKEW", - " vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );", - " vec3 viewVelocity = normalMatrix * velocity.xyz;", - "", - " vec3 scaledPos = vec3(position.xy * size, position.z);", - " float vlength = length(viewVelocity);", - " vec3 projVelocity = dot(scaledPos, viewVelocity) * viewVelocity / vlength;", - " mvPosition.xyz += scaledPos + projVelocity * (speedFactor / size + lengthFactor / vlength);", - "#else", - " vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );", - " vec3 viewVelocity = normalMatrix * velocity.xyz;", - " float vlength = length(viewVelocity); ", - " mvPosition.xyz += position.y * normalize(cross(mvPosition.xyz, viewVelocity)) * size; // switch the cross to match unity implementation", - " mvPosition.xyz -= (position.x + 0.5) * viewVelocity * (1.0 + lengthFactor / vlength) * size; // minus position.x to match unity implementation", - "#endif", - "\tvColor = color;", - "\tgl_Position = projectionMatrix * mvPosition;", - "\t#include ", - "\t#include ", - "}", - "`;", - "", - "function getMaterialUVChannelName(value) {", - " if (value === 0)", - " return 'uv';", - " return `uv${value}`;", - "}", - "", - "new THREE.Vector3(0, 0, 1);", - "class SpriteBatch extends VFXBatch {", - " constructor(settings) {", - " super(settings);", - " this.vector_ = new THREE.Vector3();", - " this.vector2_ = new THREE.Vector3();", - " this.vector3_ = new THREE.Vector3();", - " this.quaternion_ = new THREE.Quaternion();", - " this.quaternion2_ = new THREE.Quaternion();", - " this.quaternion3_ = new THREE.Quaternion();", - " this.rotationMat_ = new THREE.Matrix3();", - " this.rotationMat2_ = new THREE.Matrix3();", - " this.maxParticles = 1000;", - " this.setupBuffers();", - " this.rebuildMaterial();", - " }", - " buildExpandableBuffers() {", - " this.offsetBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 3), 3);", - " this.offsetBuffer.setUsage(THREE.DynamicDrawUsage);", - " this.geometry.setAttribute('offset', this.offsetBuffer);", - " this.colorBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 4), 4);", - " this.colorBuffer.setUsage(THREE.DynamicDrawUsage);", - " this.geometry.setAttribute('color', this.colorBuffer);", - " if (this.settings.renderMode === RenderMode.Mesh) {", - " this.rotationBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 4), 4);", - " this.rotationBuffer.setUsage(THREE.DynamicDrawUsage);", - " this.geometry.setAttribute('rotation', this.rotationBuffer);", - " }", - " else if (this.settings.renderMode === RenderMode.BillBoard ||", - " this.settings.renderMode === RenderMode.HorizontalBillBoard ||", - " this.settings.renderMode === RenderMode.VerticalBillBoard ||", - " this.settings.renderMode === RenderMode.StretchedBillBoard) {", - " this.rotationBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles), 1);", - " this.rotationBuffer.setUsage(THREE.DynamicDrawUsage);", - " this.geometry.setAttribute('rotation', this.rotationBuffer);", - " }", - " this.sizeBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles), 1);", - " this.sizeBuffer.setUsage(THREE.DynamicDrawUsage);", - " this.geometry.setAttribute('size', this.sizeBuffer);", - " this.uvTileBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles), 1);", - " this.uvTileBuffer.setUsage(THREE.DynamicDrawUsage);", - " this.geometry.setAttribute('uvTile', this.uvTileBuffer);", - " if (this.settings.renderMode === RenderMode.StretchedBillBoard) {", - " this.velocityBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 4), 4);", - " this.velocityBuffer.setUsage(THREE.DynamicDrawUsage);", - " this.geometry.setAttribute('velocity', this.velocityBuffer);", - " }", - " }", - " setupBuffers() {", - " if (this.geometry)", - " this.geometry.dispose();", - " this.geometry = new THREE.InstancedBufferGeometry();", - " this.geometry.setIndex(this.settings.instancingGeometry.getIndex());", - " if (this.settings.instancingGeometry.hasAttribute('normal')) {", - " this.geometry.setAttribute('normal', this.settings.instancingGeometry.getAttribute('normal'));", - " }", - " this.geometry.setAttribute('position', this.settings.instancingGeometry.getAttribute('position'));", - " this.geometry.setAttribute('uv', this.settings.instancingGeometry.getAttribute('uv'));", - " this.buildExpandableBuffers();", - " }", - " expandBuffers(target) {", - " while (target >= this.maxParticles) {", - " this.maxParticles *= 2;", - " }", - " this.setupBuffers();", - " }", - " rebuildMaterial() {", - " this.layers.mask = this.settings.layers.mask;", - " let uniforms;", - " const defines = {};", - " if (this.settings.material.type === 'MeshStandardMaterial' ||", - " this.settings.material.type === 'MeshPhysicalMaterial') {", - " const mat = this.settings.material;", - " uniforms = THREE.UniformsUtils.merge([", - " THREE.UniformsLib.common,", - " THREE.UniformsLib.envmap,", - " THREE.UniformsLib.aomap,", - " THREE.UniformsLib.lightmap,", - " THREE.UniformsLib.emissivemap,", - " THREE.UniformsLib.bumpmap,", - " THREE.UniformsLib.normalmap,", - " THREE.UniformsLib.displacementmap,", - " THREE.UniformsLib.roughnessmap,", - " THREE.UniformsLib.metalnessmap,", - " THREE.UniformsLib.fog,", - " THREE.UniformsLib.lights,", - " {", - " emissive: { value: new THREE.Color(0x000000) },", - " roughness: { value: 1.0 },", - " metalness: { value: 0.0 },", - " envMapIntensity: { value: 1 },", - " },", - " ]);", - " uniforms['diffuse'].value = mat.color;", - " uniforms['opacity'].value = mat.opacity;", - " uniforms['emissive'].value = mat.emissive;", - " uniforms['roughness'].value = mat.roughness;", - " uniforms['metalness'].value = mat.metalness;", - " if (mat.envMap) {", - " uniforms['envMap'].value = mat.envMap;", - " uniforms['envMapIntensity'].value = mat.envMapIntensity;", - " }", - " if (mat.normalMap) {", - " uniforms['normalMap'].value = mat.normalMap;", - " uniforms['normalScale'].value = mat.normalScale;", - " }", - " if (mat.roughnessMap) {", - " uniforms['roughnessMap'].value = mat.roughnessMap;", - " }", - " if (mat.metalnessMap) {", - " uniforms['metalnessMap'].value = mat.metalnessMap;", - " }", - " if (mat.map) {", - " uniforms['map'] = new THREE.Uniform(mat.map);", - " }", - " }", - " else {", - " uniforms = {};", - " uniforms['map'] = new THREE.Uniform(this.settings.material.map);", - " }", - " if (this.settings.material.alphaTest) {", - " defines['USE_ALPHATEST'] = '';", - " uniforms['alphaTest'] = new THREE.Uniform(this.settings.material.alphaTest);", - " }", - " defines['USE_UV'] = '';", - " const uTileCount = this.settings.uTileCount;", - " const vTileCount = this.settings.vTileCount;", - " if (uTileCount > 1 || vTileCount > 1) {", - " defines['UV_TILE'] = '';", - " uniforms['tileCount'] = new THREE.Uniform(new THREE.Vector2(uTileCount, vTileCount));", - " }", - " if (this.settings.material.defines &&", - " this.settings.material.defines['USE_COLOR_AS_ALPHA'] !== undefined) {", - " defines['USE_COLOR_AS_ALPHA'] = '';", - " }", - " if (this.settings.material.normalMap) {", - " defines['USE_NORMALMAP'] = '';", - " defines['NORMALMAP_UV'] = getMaterialUVChannelName(this.settings.material.normalMap.channel);", - " uniforms['normalMapTransform'] = new THREE.Uniform(new THREE.Matrix3().copy(this.settings.material.normalMap.matrix));", - " }", - " if (this.settings.material.map) {", - " defines['USE_MAP'] = '';", - " defines['MAP_UV'] = getMaterialUVChannelName(this.settings.material.map.channel);", - " uniforms['mapTransform'] = new THREE.Uniform(new THREE.Matrix3().copy(this.settings.material.map.matrix));", - " }", - " defines['USE_COLOR_ALPHA'] = '';", - " let needLights = false;", - " if (this.settings.renderMode === RenderMode.BillBoard ||", - " this.settings.renderMode === RenderMode.VerticalBillBoard ||", - " this.settings.renderMode === RenderMode.HorizontalBillBoard ||", - " this.settings.renderMode === RenderMode.Mesh) {", - " let vertexShader;", - " let fragmentShader;", - " if (this.settings.renderMode === RenderMode.Mesh) {", - " if (this.settings.material.type === 'MeshStandardMaterial' ||", - " this.settings.material.type === 'MeshPhysicalMaterial') {", - " defines['USE_COLOR'] = '';", - " vertexShader = local_particle_physics_vert;", - " fragmentShader = particle_physics_frag;", - " needLights = true;", - " }", - " else {", - " vertexShader = local_particle_vert;", - " fragmentShader = particle_frag;", - " }", - " }", - " else {", - " vertexShader = particle_vert;", - " fragmentShader = particle_frag;", - " }", - " if (this.settings.renderMode === RenderMode.VerticalBillBoard) {", - " defines['VERTICAL'] = '';", - " }", - " else if (this.settings.renderMode === RenderMode.HorizontalBillBoard) {", - " defines['HORIZONTAL'] = '';", - " }", - " this.material = new THREE.ShaderMaterial({", - " uniforms: uniforms,", - " defines: defines,", - " vertexShader: vertexShader,", - " fragmentShader: fragmentShader,", - " transparent: this.settings.material.transparent,", - " depthWrite: !this.settings.material.transparent,", - " blending: this.settings.material.blending,", - " side: this.settings.material.side,", - " alphaTest: this.settings.material.alphaTest,", - " lights: needLights,", - " });", - " }", - " else if (this.settings.renderMode === RenderMode.StretchedBillBoard) {", - " uniforms['speedFactor'] = new THREE.Uniform(1.0);", - " this.material = new THREE.ShaderMaterial({", - " uniforms: uniforms,", - " defines: defines,", - " vertexShader: stretched_bb_particle_vert,", - " fragmentShader: particle_frag,", - " transparent: this.settings.material.transparent,", - " depthWrite: !this.settings.material.transparent,", - " blending: this.settings.material.blending,", - " side: this.settings.material.side,", - " alphaTest: this.settings.material.alphaTest,", - " });", - " }", - " else {", - " throw new Error('render mode unavailable');", - " }", - " }", - " update() {", - " let index = 0;", - " let particleCount = 0;", - " this.systems.forEach((system) => {", - " particleCount += system.particleNum;", - " });", - " if (particleCount > this.maxParticles) {", - " this.expandBuffers(particleCount);", - " }", - " this.systems.forEach((system) => {", - " const particles = system.particles;", - " const particleNum = system.particleNum;", - " const rotation = this.quaternion2_;", - " const translation = this.vector2_;", - " const scale = this.vector3_;", - " system.emitter.matrixWorld.decompose(translation, rotation, scale);", - " this.rotationMat_.setFromMatrix4(system.emitter.matrixWorld);", - " for (let j = 0; j < particleNum; j++ , index++) {", - " const particle = particles[j];", - " if (this.settings.renderMode === RenderMode.Mesh) {", - " let q;", - " if (system.worldSpace) {", - " q = particle.rotation;", - " }", - " else {", - " let parentQ;", - " if (particle.parentMatrix) {", - " parentQ = this.quaternion3_.setFromRotationMatrix(particle.parentMatrix);", - " }", - " else {", - " parentQ = rotation;", - " }", - " q = this.quaternion_;", - " q.copy(particle.rotation).multiply(parentQ);", - " }", - " this.rotationBuffer.setXYZW(index, q.x, q.y, q.z, q.w);", - " }", - " else if (this.settings.renderMode === RenderMode.StretchedBillBoard ||", - " this.settings.renderMode === RenderMode.VerticalBillBoard ||", - " this.settings.renderMode === RenderMode.HorizontalBillBoard ||", - " this.settings.renderMode === RenderMode.BillBoard) {", - " this.rotationBuffer.setX(index, particle.rotation);", - " }", - " let vec;", - " if (system.worldSpace) {", - " vec = particle.position;", - " }", - " else {", - " vec = this.vector_;", - " if (particle.parentMatrix) {", - " vec.copy(particle.position).applyMatrix4(particle.parentMatrix);", - " }", - " else {", - " vec.copy(particle.position).applyMatrix4(system.emitter.matrixWorld);", - " }", - " }", - " this.offsetBuffer.setXYZ(index, vec.x, vec.y, vec.z);", - " this.colorBuffer.setXYZW(index, particle.color.x, particle.color.y, particle.color.z, particle.color.w);", - " if (system.worldSpace) {", - " this.sizeBuffer.setX(index, particle.size);", - " }", - " else {", - " if (particle.parentMatrix) {", - " this.sizeBuffer.setX(index, particle.size);", - " }", - " else {", - " this.sizeBuffer.setX(index, (particle.size * (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z))) / 3);", - " }", - " }", - " this.uvTileBuffer.setX(index, particle.uvTile);", - " if (this.settings.renderMode === RenderMode.StretchedBillBoard && this.velocityBuffer) {", - " let speedFactor = system.rendererEmitterSettings.speedFactor;", - " if (speedFactor === 0)", - " speedFactor = 0.001;", - " const lengthFactor = system.rendererEmitterSettings.lengthFactor;", - " let vec;", - " if (system.worldSpace) {", - " vec = particle.velocity;", - " }", - " else {", - " vec = this.vector_;", - " if (particle.parentMatrix) {", - " this.rotationMat2_.setFromMatrix4(particle.parentMatrix);", - " vec.copy(particle.velocity).applyMatrix3(this.rotationMat2_);", - " }", - " else {", - " vec.copy(particle.velocity).applyMatrix3(this.rotationMat_);", - " }", - " }", - " this.velocityBuffer.setXYZW(index, vec.x * speedFactor, vec.y * speedFactor, vec.z * speedFactor, lengthFactor);", - " }", - " }", - " });", - " this.geometry.instanceCount = index;", - " if (index > 0) {", - " this.offsetBuffer.clearUpdateRanges();", - " this.offsetBuffer.addUpdateRange(0, index * 3);", - " this.offsetBuffer.needsUpdate = true;", - " this.sizeBuffer.clearUpdateRanges();", - " this.sizeBuffer.addUpdateRange(0, index);", - " this.sizeBuffer.needsUpdate = true;", - " this.colorBuffer.clearUpdateRanges();", - " this.colorBuffer.addUpdateRange(0, index * 4);", - " this.colorBuffer.needsUpdate = true;", - " this.uvTileBuffer.clearUpdateRanges();", - " this.uvTileBuffer.addUpdateRange(0, index);", - " this.uvTileBuffer.needsUpdate = true;", - " if (this.settings.renderMode === RenderMode.StretchedBillBoard && this.velocityBuffer) {", - " this.velocityBuffer.clearUpdateRanges();", - " this.velocityBuffer.addUpdateRange(0, index * 4);", - " this.velocityBuffer.needsUpdate = true;", - " }", - " if (this.settings.renderMode === RenderMode.Mesh) {", - " this.rotationBuffer.clearUpdateRanges();", - " this.rotationBuffer.addUpdateRange(0, index * 4);", - " this.rotationBuffer.needsUpdate = true;", - " }", - " else if (this.settings.renderMode === RenderMode.StretchedBillBoard ||", - " this.settings.renderMode === RenderMode.HorizontalBillBoard ||", - " this.settings.renderMode === RenderMode.VerticalBillBoard ||", - " this.settings.renderMode === RenderMode.BillBoard) {", - " this.rotationBuffer.clearUpdateRanges();", - " this.rotationBuffer.addUpdateRange(0, index);", - " this.rotationBuffer.needsUpdate = true;", - " }", - " }", - " }", - " dispose() {", - " this.geometry.dispose();", - " }", - "}", - "", - "var trail_frag = `", - "", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "", - "uniform sampler2D alphaMap;", - "uniform float useAlphaMap;", - "uniform float visibility;", - "uniform float alphaTest;", - "uniform vec2 repeat;", - "", - "varying vec4 vColor;", - " ", - "void main() {", - " #include ", - " #include ", - "", - " vec4 c = vColor;", - " ", - " #ifdef USE_MAP", - " #ifdef USE_COLOR_AS_ALPHA", - " vec4 tex = texture2D( map, vUv * repeat );", - " c *= vec4(tex.rgb, tex.r);", - " #else", - " c *= texture2D( map, vUv * repeat );", - " #endif", - " #endif", - " if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUv * repeat ).a;", - " if( c.a < alphaTest ) discard;", - " gl_FragColor = c;", - "", - " #include ", - " #include ", - "}`;", - "", - "var trail_vert = `", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "#include ", - "", - "attribute vec3 previous;", - "attribute vec3 next;", - "attribute float side;", - "attribute float width;", - "", - "uniform vec2 resolution;", - "uniform float lineWidth;", - "uniform float sizeAttenuation;", - " ", - "vec2 fix(vec4 i, float aspect) {", - " vec2 res = i.xy / i.w;", - " res.x *= aspect;", - " return res;", - "}", - " ", - "void main() {", - "", - " ${uv_vertex_tile}", - " ", - " float aspect = resolution.x / resolution.y;", - "", - " vColor = color;", - "", - " mat4 m = projectionMatrix * modelViewMatrix;", - " vec4 finalPosition = m * vec4( position, 1.0 );", - " vec4 prevPos = m * vec4( previous, 1.0 );", - " vec4 nextPos = m * vec4( next, 1.0 );", - "", - " vec2 currentP = fix( finalPosition, aspect );", - " vec2 prevP = fix( prevPos, aspect );", - " vec2 nextP = fix( nextPos, aspect );", - "", - " float w = lineWidth * width;", - "", - " vec2 dir;", - " if( nextP == currentP ) dir = normalize( currentP - prevP );", - " else if( prevP == currentP ) dir = normalize( nextP - currentP );", - " else {", - " vec2 dir1 = normalize( currentP - prevP );", - " vec2 dir2 = normalize( nextP - currentP );", - " dir = normalize( dir1 + dir2 );", - "", - " vec2 perp = vec2( -dir1.y, dir1.x );", - " vec2 miter = vec2( -dir.y, dir.x );", - " //w = clamp( w / dot( miter, perp ), 0., 4., * lineWidth * width );", - "", - " }", - "", - " //vec2 normal = ( cross( vec3( dir, 0. ) vec3( 0., 0., 1. ) ) ).xy;", - " vec4 normal = vec4( -dir.y, dir.x, 0., 1. );", - " normal.xy *= .5 * w;", - " normal *= projectionMatrix;", - " if( sizeAttenuation == 0. ) {", - " normal.xy *= finalPosition.w;", - " normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;", - " }", - "", - " finalPosition.xy += normal.xy * side;", - "", - " gl_Position = finalPosition;", - "", - "\t#include ", - "\t#include ", - "\t", - " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", - " ", - "\t#include ", - "}`;", - "", - "new THREE.Vector3(0, 0, 1);", - "class TrailBatch extends VFXBatch {", - " constructor(settings) {", - " super(settings);", - " this.vector_ = new THREE.Vector3();", - " this.vector2_ = new THREE.Vector3();", - " this.vector3_ = new THREE.Vector3();", - " this.quaternion_ = new THREE.Quaternion();", - " this.maxParticles = 10000;", - " this.setupBuffers();", - " this.rebuildMaterial();", - " }", - " setupBuffers() {", - " if (this.geometry)", - " this.geometry.dispose();", - " this.geometry = new THREE.BufferGeometry();", - " this.indexBuffer = new THREE.BufferAttribute(new Uint32Array(this.maxParticles * 6), 1);", - " this.indexBuffer.setUsage(THREE.DynamicDrawUsage);", - " this.geometry.setIndex(this.indexBuffer);", - " this.positionBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 6), 3);", - " this.positionBuffer.setUsage(THREE.DynamicDrawUsage);", - " this.geometry.setAttribute('position', this.positionBuffer);", - " this.previousBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 6), 3);", - " this.previousBuffer.setUsage(THREE.DynamicDrawUsage);", - " this.geometry.setAttribute('previous', this.previousBuffer);", - " this.nextBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 6), 3);", - " this.nextBuffer.setUsage(THREE.DynamicDrawUsage);", - " this.geometry.setAttribute('next', this.nextBuffer);", - " this.widthBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 2), 1);", - " this.widthBuffer.setUsage(THREE.DynamicDrawUsage);", - " this.geometry.setAttribute('width', this.widthBuffer);", - " this.sideBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 2), 1);", - " this.sideBuffer.setUsage(THREE.DynamicDrawUsage);", - " this.geometry.setAttribute('side', this.sideBuffer);", - " this.uvBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 4), 2);", - " this.uvBuffer.setUsage(THREE.DynamicDrawUsage);", - " this.geometry.setAttribute('uv', this.uvBuffer);", - " this.colorBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 8), 4);", - " this.colorBuffer.setUsage(THREE.DynamicDrawUsage);", - " this.geometry.setAttribute('color', this.colorBuffer);", - " }", - " expandBuffers(target) {", - " while (target >= this.maxParticles) {", - " this.maxParticles *= 2;", - " }", - " this.setupBuffers();", - " }", - " rebuildMaterial() {", - " this.layers.mask = this.settings.layers.mask;", - " const uniforms = {", - " lineWidth: { value: 1 },", - " map: { value: null },", - " useMap: { value: 0 },", - " alphaMap: { value: null },", - " useAlphaMap: { value: 0 },", - " resolution: { value: new THREE.Vector2(1, 1) },", - " sizeAttenuation: { value: 1 },", - " visibility: { value: 1 },", - " alphaTest: { value: 0 },", - " repeat: { value: new THREE.Vector2(1, 1) },", - " };", - " const defines = {};", - " defines['USE_UV'] = '';", - " defines['USE_COLOR_ALPHA'] = '';", - " if (this.settings.material.map) {", - " defines['USE_MAP'] = '';", - " defines['MAP_UV'] = getMaterialUVChannelName(this.settings.material.map.channel);", - " uniforms['map'] = new THREE.Uniform(this.settings.material.map);", - " uniforms['mapTransform'] = new THREE.Uniform(new THREE.Matrix3().copy(this.settings.material.map.matrix));", - " }", - " if (this.settings.material.defines &&", - " this.settings.material.defines['USE_COLOR_AS_ALPHA'] !== undefined) {", - " defines['USE_COLOR_AS_ALPHA'] = '';", - " }", - " if (this.settings.renderMode === RenderMode.Trail) {", - " this.material = new THREE.ShaderMaterial({", - " uniforms: uniforms,", - " defines: defines,", - " vertexShader: trail_vert,", - " fragmentShader: trail_frag,", - " transparent: this.settings.material.transparent,", - " depthWrite: !this.settings.material.transparent,", - " side: this.settings.material.side,", - " blending: this.settings.material.blending || THREE.AdditiveBlending,", - " });", - " }", - " else {", - " throw new Error('render mode unavailable');", - " }", - " }", - " update() {", - " let index = 0;", - " let triangles = 0;", - " let particleCount = 0;", - " this.systems.forEach((system) => {", - " for (let j = 0; j < system.particleNum; j++) {", - " particleCount += system.particles[j].previous.length * 2;", - " }", - " });", - " if (particleCount > this.maxParticles) {", - " this.expandBuffers(particleCount);", - " }", - " this.systems.forEach((system) => {", - " const rotation = this.quaternion_;", - " const translation = this.vector2_;", - " const scale = this.vector3_;", - " system.emitter.matrixWorld.decompose(translation, rotation, scale);", - " const particles = system.particles;", - " const particleNum = system.particleNum;", - " const uTileCount = this.settings.uTileCount;", - " const vTileCount = this.settings.vTileCount;", - " const tileWidth = 1 / uTileCount;", - " const tileHeight = 1 / vTileCount;", - " for (let j = 0; j < particleNum; j++) {", - " const particle = particles[j];", - " const col = particle.uvTile % vTileCount;", - " const row = Math.floor(particle.uvTile / vTileCount + 0.001);", - " const iter = particle.previous.values();", - " let curIter = iter.next();", - " let previous = curIter.value;", - " let current = previous;", - " if (!curIter.done)", - " curIter = iter.next();", - " let next;", - " if (curIter.value !== undefined) {", - " next = curIter.value;", - " }", - " else {", - " next = current;", - " }", - " for (let i = 0; i < particle.previous.length; i++ , index += 2) {", - " this.positionBuffer.setXYZ(index, current.position.x, current.position.y, current.position.z);", - " this.positionBuffer.setXYZ(index + 1, current.position.x, current.position.y, current.position.z);", - " if (system.worldSpace) {", - " this.positionBuffer.setXYZ(index, current.position.x, current.position.y, current.position.z);", - " this.positionBuffer.setXYZ(index + 1, current.position.x, current.position.y, current.position.z);", - " }", - " else {", - " if (particle.parentMatrix) {", - " this.vector_.copy(current.position).applyMatrix4(particle.parentMatrix);", - " }", - " else {", - " this.vector_.copy(current.position).applyMatrix4(system.emitter.matrixWorld);", - " }", - " this.positionBuffer.setXYZ(index, this.vector_.x, this.vector_.y, this.vector_.z);", - " this.positionBuffer.setXYZ(index + 1, this.vector_.x, this.vector_.y, this.vector_.z);", - " }", - " if (system.worldSpace) {", - " this.previousBuffer.setXYZ(index, previous.position.x, previous.position.y, previous.position.z);", - " this.previousBuffer.setXYZ(index + 1, previous.position.x, previous.position.y, previous.position.z);", - " }", - " else {", - " if (particle.parentMatrix) {", - " this.vector_.copy(previous.position).applyMatrix4(particle.parentMatrix);", - " }", - " else {", - " this.vector_.copy(previous.position).applyMatrix4(system.emitter.matrixWorld);", - " }", - " this.previousBuffer.setXYZ(index, this.vector_.x, this.vector_.y, this.vector_.z);", - " this.previousBuffer.setXYZ(index + 1, this.vector_.x, this.vector_.y, this.vector_.z);", - " }", - " if (system.worldSpace) {", - " this.nextBuffer.setXYZ(index, next.position.x, next.position.y, next.position.z);", - " this.nextBuffer.setXYZ(index + 1, next.position.x, next.position.y, next.position.z);", - " }", - " else {", - " if (particle.parentMatrix) {", - " this.vector_.copy(next.position).applyMatrix4(particle.parentMatrix);", - " }", - " else {", - " this.vector_.copy(next.position).applyMatrix4(system.emitter.matrixWorld);", - " }", - " this.nextBuffer.setXYZ(index, this.vector_.x, this.vector_.y, this.vector_.z);", - " this.nextBuffer.setXYZ(index + 1, this.vector_.x, this.vector_.y, this.vector_.z);", - " }", - " this.sideBuffer.setX(index, -1);", - " this.sideBuffer.setX(index + 1, 1);", - " if (system.worldSpace) {", - " this.widthBuffer.setX(index, current.size);", - " this.widthBuffer.setX(index + 1, current.size);", - " }", - " else {", - " if (particle.parentMatrix) {", - " this.widthBuffer.setX(index, current.size);", - " this.widthBuffer.setX(index + 1, current.size);", - " }", - " else {", - " const objectScale = (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z)) / 3;", - " this.widthBuffer.setX(index, current.size * objectScale);", - " this.widthBuffer.setX(index + 1, current.size * objectScale);", - " }", - " }", - " this.uvBuffer.setXY(index, (i / particle.previous.length + col) * tileWidth, (vTileCount - row - 1) * tileHeight);", - " this.uvBuffer.setXY(index + 1, (i / particle.previous.length + col) * tileWidth, (vTileCount - row) * tileHeight);", - " this.colorBuffer.setXYZW(index, current.color.x, current.color.y, current.color.z, current.color.w);", - " this.colorBuffer.setXYZW(index + 1, current.color.x, current.color.y, current.color.z, current.color.w);", - " if (i + 1 < particle.previous.length) {", - " this.indexBuffer.setX(triangles * 3, index);", - " this.indexBuffer.setX(triangles * 3 + 1, index + 1);", - " this.indexBuffer.setX(triangles * 3 + 2, index + 2);", - " triangles++;", - " this.indexBuffer.setX(triangles * 3, index + 2);", - " this.indexBuffer.setX(triangles * 3 + 1, index + 1);", - " this.indexBuffer.setX(triangles * 3 + 2, index + 3);", - " triangles++;", - " }", - " previous = current;", - " current = next;", - " if (!curIter.done) {", - " curIter = iter.next();", - " if (curIter.value !== undefined) {", - " next = curIter.value;", - " }", - " }", - " }", - " }", - " });", - " this.positionBuffer.clearUpdateRanges();", - " this.positionBuffer.addUpdateRange(0, index * 3);", - " this.positionBuffer.needsUpdate = true;", - " this.previousBuffer.clearUpdateRanges();", - " this.previousBuffer.addUpdateRange(0, index * 3);", - " this.previousBuffer.needsUpdate = true;", - " this.nextBuffer.clearUpdateRanges();", - " this.nextBuffer.addUpdateRange(0, index * 3);", - " this.nextBuffer.needsUpdate = true;", - " this.sideBuffer.clearUpdateRanges();", - " this.sideBuffer.addUpdateRange(0, index);", - " this.sideBuffer.needsUpdate = true;", - " this.widthBuffer.clearUpdateRanges();", - " this.widthBuffer.addUpdateRange(0, index);", - " this.widthBuffer.needsUpdate = true;", - " this.uvBuffer.clearUpdateRanges();", - " this.uvBuffer.addUpdateRange(0, index * 2);", - " this.uvBuffer.needsUpdate = true;", - " this.colorBuffer.clearUpdateRanges();", - " this.colorBuffer.addUpdateRange(0, index * 4);", - " this.colorBuffer.needsUpdate = true;", - " this.indexBuffer.clearUpdateRanges();", - " this.indexBuffer.addUpdateRange(0, triangles * 3);", - " this.indexBuffer.needsUpdate = true;", - " this.geometry.setDrawRange(0, triangles * 3);", - " }", - " dispose() {", - " this.geometry.dispose();", - " }", - "}", - "", - "class BatchedRenderer extends THREE.Object3D {", - " constructor() {", - " super();", - " this.batches = [];", - " this.systemToBatchIndex = new Map();", - " this.type = 'BatchedRenderer';", - " }", - " static equals(a, b) {", - " return (a.material.side === b.material.side &&", - " a.material.blending === b.material.blending &&", - " a.material.transparent === b.material.transparent &&", - " a.material.type === b.material.type &&", - " a.material.alphaTest === b.material.alphaTest &&", - " a.material.map === b.material.map &&", - " a.renderMode === b.renderMode &&", - " a.uTileCount === b.uTileCount &&", - " a.vTileCount === b.vTileCount &&", - " a.instancingGeometry === b.instancingGeometry &&", - " a.renderOrder === b.renderOrder &&", - " a.layers.mask === b.layers.mask);", - " }", - " addSystem(system) {", - " system._renderer = this;", - " const settings = system.getRendererSettings();", - " for (let i = 0; i < this.batches.length; i++) {", - " if (BatchedRenderer.equals(this.batches[i].settings, settings)) {", - " this.batches[i].addSystem(system);", - " this.systemToBatchIndex.set(system, i);", - " return;", - " }", - " }", - " let batch;", - " switch (settings.renderMode) {", - " case RenderMode.Trail:", - " batch = new TrailBatch(settings);", - " break;", - " case RenderMode.Mesh:", - " case RenderMode.BillBoard:", - " case RenderMode.VerticalBillBoard:", - " case RenderMode.HorizontalBillBoard:", - " case RenderMode.StretchedBillBoard:", - " batch = new SpriteBatch(settings);", - " break;", - " }", - " batch.addSystem(system);", - " this.batches.push(batch);", - " this.systemToBatchIndex.set(system, this.batches.length - 1);", - " this.add(batch);", - " }", - " deleteSystem(system) {", - " const batchIndex = this.systemToBatchIndex.get(system);", - " if (batchIndex != undefined) {", - " this.batches[batchIndex].removeSystem(system);", - " this.systemToBatchIndex.delete(system);", - " }", - " }", - " updateSystem(system) {", - " this.deleteSystem(system);", - " this.addSystem(system);", - " }", - " update(delta) {", - " this.systemToBatchIndex.forEach((value, ps) => {", - " ps.update(delta);", - " });", - " for (let i = 0; i < this.batches.length; i++) {", - " this.batches[i].update();", - " }", - " }", - "}", - "", - "const BatchedParticleRenderer = BatchedRenderer;", - "", - "class QuarksLoader extends THREE.ObjectLoader {", - " constructor(manager) {", - " super(manager);", - " }", - " linkReference(object) {", - " const objectsMap = {};", - " object.traverse(function (child) {", - " objectsMap[child.uuid] = child;", - " });", - " object.traverse(function (child) {", - " if (child.type === 'ParticleEmitter') {", - " const system = child.system;", - " system.emitterShape;", - " for (let i = 0; i < system.behaviors.length; i++) {", - " if (system.behaviors[i] instanceof EmitSubParticleSystem) {", - " system.behaviors[i].subParticleSystem = objectsMap[system.behaviors[i].subParticleSystem];", - " }", - " }", - " }", - " });", - " }", - " parse(json, onLoad) {", - " const object = super.parse(json, onLoad);", - " this.linkReference(object);", - " return object;", - " }", - " parseObject(data, geometries, materials, textures, animations) {", - " let object;", - " function getGeometry(name) {", - " if (geometries[name] === undefined) {", - " console.warn('THREE.ObjectLoader: Undefined geometry', name);", - " }", - " return geometries[name];", - " }", - " function getMaterial(name) {", - " if (name === undefined)", - " return undefined;", - " if (Array.isArray(name)) {", - " const array = [];", - " for (let i = 0, l = name.length; i < l; i++) {", - " const uuid = name[i];", - " if (materials[uuid] === undefined) {", - " console.warn('THREE.ObjectLoader: Undefined material', uuid);", - " }", - " array.push(materials[uuid]);", - " }", - " return array;", - " }", - " if (materials[name] === undefined) {", - " console.warn('THREE.ObjectLoader: Undefined material', name);", - " }", - " return materials[name];", - " }", - " function getTexture(uuid) {", - " if (textures[uuid] === undefined) {", - " console.warn('THREE.ObjectLoader: Undefined texture', uuid);", - " }", - " return textures[uuid];", - " }", - " let geometry, material;", - " const meta = {", - " textures: textures,", - " geometries: geometries,", - " materials: materials,", - " };", - " const dependencies = {};", - " switch (data.type) {", - " case 'ParticleEmitter':", - " object = ParticleSystem.fromJSON(data.ps, meta, dependencies).emitter;", - " break;", - " case 'Scene':", - " object = new THREE.Scene();", - " if (data.background !== undefined) {", - " if (Number.isInteger(data.background)) {", - " object.background = new THREE.Color(data.background);", - " }", - " else {", - " object.background = getTexture(data.background);", - " }", - " }", - " if (data.environment !== undefined) {", - " object.environment = getTexture(data.environment);", - " }", - " if (data.fog !== undefined) {", - " if (data.fog.type === 'Fog') {", - " object.fog = new THREE.Fog(data.fog.color, data.fog.near, data.fog.far);", - " }", - " else if (data.fog.type === 'FogExp2') {", - " object.fog = new THREE.FogExp2(data.fog.color, data.fog.density);", - " }", - " }", - " if (data.backgroundBlurriness !== undefined)", - " object.backgroundBlurriness = data.backgroundBlurriness;", - " break;", - " case 'PerspectiveCamera':", - " object = new THREE.PerspectiveCamera(data.fov, data.aspect, data.near, data.far);", - " if (data.focus !== undefined)", - " object.focus = data.focus;", - " if (data.zoom !== undefined)", - " object.zoom = data.zoom;", - " if (data.filmGauge !== undefined)", - " object.filmGauge = data.filmGauge;", - " if (data.filmOffset !== undefined)", - " object.filmOffset = data.filmOffset;", - " if (data.view !== undefined)", - " object.view = Object.assign({}, data.view);", - " break;", - " case 'OrthographicCamera':", - " object = new THREE.OrthographicCamera(data.left, data.right, data.top, data.bottom, data.near, data.far);", - " if (data.zoom !== undefined)", - " object.zoom = data.zoom;", - " if (data.view !== undefined)", - " object.view = Object.assign({}, data.view);", - " break;", - " case 'AmbientLight':", - " object = new THREE.AmbientLight(data.color, data.intensity);", - " break;", - " case 'DirectionalLight':", - " object = new THREE.DirectionalLight(data.color, data.intensity);", - " break;", - " case 'PointLight':", - " object = new THREE.PointLight(data.color, data.intensity, data.distance, data.decay);", - " break;", - " case 'RectAreaLight':", - " object = new THREE.RectAreaLight(data.color, data.intensity, data.width, data.height);", - " break;", - " case 'SpotLight':", - " object = new THREE.SpotLight(data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay);", - " break;", - " case 'HemisphereLight':", - " object = new THREE.HemisphereLight(data.color, data.groundColor, data.intensity);", - " break;", - " case 'LightProbe':", - " object = new THREE.LightProbe().fromJSON(data);", - " break;", - " case 'SkinnedMesh':", - " geometry = getGeometry(data.geometry);", - " material = getMaterial(data.material);", - " object = new THREE.SkinnedMesh(geometry, material);", - " if (data.bindMode !== undefined)", - " object.bindMode = data.bindMode;", - " if (data.bindMatrix !== undefined)", - " object.bindMatrix.fromArray(data.bindMatrix);", - " if (data.skeleton !== undefined)", - " object.skeleton = data.skeleton;", - " break;", - " case 'Mesh':", - " geometry = getGeometry(data.geometry);", - " material = getMaterial(data.material);", - " object = new THREE.Mesh(geometry, material);", - " break;", - " case 'InstancedMesh': {", - " geometry = getGeometry(data.geometry);", - " material = getMaterial(data.material);", - " const count = data.count;", - " const instanceMatrix = data.instanceMatrix;", - " const instanceColor = data.instanceColor;", - " object = new THREE.InstancedMesh(geometry, material, count);", - " object.instanceMatrix = new THREE.InstancedBufferAttribute(new Float32Array(instanceMatrix.array), 16);", - " if (instanceColor !== undefined)", - " object.instanceColor = new THREE.InstancedBufferAttribute(new Float32Array(instanceColor.array), instanceColor.itemSize);", - " break;", - " }", - " case 'LOD':", - " object = new THREE.LOD();", - " break;", - " case 'Line':", - " object = new THREE.Line(getGeometry(data.geometry), getMaterial(data.material));", - " break;", - " case 'LineLoop':", - " object = new THREE.LineLoop(getGeometry(data.geometry), getMaterial(data.material));", - " break;", - " case 'LineSegments':", - " object = new THREE.LineSegments(getGeometry(data.geometry), getMaterial(data.material));", - " break;", - " case 'PointCloud':", - " case 'Points':", - " object = new THREE.Points(getGeometry(data.geometry), getMaterial(data.material));", - " break;", - " case 'Sprite':", - " object = new THREE.Sprite(getMaterial(data.material));", - " break;", - " case 'Group':", - " object = new THREE.Group();", - " break;", - " case 'Bone':", - " object = new THREE.Bone();", - " break;", - " default:", - " object = new THREE.Object3D();", - " }", - " object.uuid = data.uuid;", - " if (data.name !== undefined)", - " object.name = data.name;", - " if (data.matrix !== undefined) {", - " object.matrix.fromArray(data.matrix);", - " if (data.matrixAutoUpdate !== undefined)", - " object.matrixAutoUpdate = data.matrixAutoUpdate;", - " if (object.matrixAutoUpdate)", - " object.matrix.decompose(object.position, object.quaternion, object.scale);", - " }", - " else {", - " if (data.position !== undefined)", - " object.position.fromArray(data.position);", - " if (data.rotation !== undefined)", - " object.rotation.fromArray(data.rotation);", - " if (data.quaternion !== undefined)", - " object.quaternion.fromArray(data.quaternion);", - " if (data.scale !== undefined)", - " object.scale.fromArray(data.scale);", - " }", - " if (data.castShadow !== undefined)", - " object.castShadow = data.castShadow;", - " if (data.receiveShadow !== undefined)", - " object.receiveShadow = data.receiveShadow;", - " if (data.shadow) {", - " if (data.shadow.bias !== undefined)", - " object.shadow.bias = data.shadow.bias;", - " if (data.shadow.normalBias !== undefined)", - " object.normalBias = data.shadow.normalBias;", - " if (data.shadow.radius !== undefined)", - " object.radius = data.shadow.radius;", - " if (data.shadow.mapSize !== undefined)", - " object.mapSize.fromArray(data.shadow.mapSize);", - " if (data.shadow.camera !== undefined) {", - " object.camera = this.parseObject(data.shadow.camera);", - " }", - " }", - " if (data.visible !== undefined)", - " object.visible = data.visible;", - " if (data.frustumCulled !== undefined)", - " object.frustumCulled = data.frustumCulled;", - " if (data.renderOrder !== undefined)", - " object.renderOrder = data.renderOrder;", - " if (data.userData !== undefined)", - " object.userData = data.userData;", - " if (data.layers !== undefined)", - " object.layers.mask = data.layers;", - " if (data.children !== undefined) {", - " const children = data.children;", - " for (let i = 0; i < children.length; i++) {", - " object.add(this.parseObject(children[i], geometries, materials, textures, animations));", - " }", - " }", - " if (data.animations !== undefined) {", - " const objectAnimations = data.animations;", - " for (let i = 0; i < objectAnimations.length; i++) {", - " const uuid = objectAnimations[i];", - " object.animations.push(animations[uuid]);", - " }", - " }", - " if (data.type === 'LOD') {", - " if (data.autoUpdate !== undefined)", - " object.autoUpdate = data.autoUpdate;", - " const levels = data.levels;", - " for (let l = 0; l < levels.length; l++) {", - " const level = levels[l];", - " const child = object.getObjectByProperty('uuid', level.object);", - " if (child !== undefined) {", - " object.addLevel(child, level.distance);", - " }", - " }", - " }", - " return object;", - " }", - "}", - "", - "const Plugins = [];", - "function loadPlugin(plugin) {", - " const existing = Plugins.find((item) => item.id === plugin.id);", - " if (!existing) {", - " plugin.initialize();", - " for (const emitterShape of plugin.emitterShapes) {", - " if (!EmitterShapes[emitterShape.type]) {", - " EmitterShapes[emitterShape.type] = emitterShape;", - " }", - " }", - " for (const behavior of plugin.behaviors) {", - " if (!BehaviorTypes[behavior.type]) {", - " BehaviorTypes[behavior.type] = behavior;", - " }", - " }", - " }", - "}", - "function unloadPlugin(pluginId) {", - " const plugin = Plugins.find((item) => item.id === pluginId);", - " if (plugin) {", - " for (const emitterShape of plugin.emitterShapes) {", - " if (EmitterShapes[emitterShape.type]) {", - " delete EmitterShapes[emitterShape.type];", - " }", - " }", - " for (const behavior of plugin.behaviors) {", - " if (BehaviorTypes[behavior.type]) {", - " delete BehaviorTypes[behavior.type];", - " }", - " }", - " }", - "}", - "", - "let NodeValueType = void 0;", - "(function (NodeValueType) {", - " NodeValueType[NodeValueType[\"Number\"] = 0] = \"Number\";", - " NodeValueType[NodeValueType[\"Vec2\"] = 1] = \"Vec2\";", - " NodeValueType[NodeValueType[\"Vec3\"] = 2] = \"Vec3\";", - " NodeValueType[NodeValueType[\"Vec4\"] = 3] = \"Vec4\";", - " NodeValueType[NodeValueType[\"Boolean\"] = 4] = \"Boolean\";", - " NodeValueType[NodeValueType[\"AnyType\"] = 5] = \"AnyType\";", - " NodeValueType[NodeValueType[\"NullableAnyType\"] = 6] = \"NullableAnyType\";", - " NodeValueType[NodeValueType[\"EventStream\"] = 7] = \"EventStream\";", - "})(NodeValueType || (NodeValueType = {}));", - "const genDefaultForNodeValueType = (type) => {", - " switch (type) {", - " case NodeValueType.Boolean:", - " return false;", - " case NodeValueType.Number:", - " return 0;", - " case NodeValueType.Vec2:", - " return new THREE.Vector2();", - " case NodeValueType.Vec3:", - " return new THREE.Vector3();", - " case NodeValueType.Vec4:", - " return new THREE.Vector4();", - " case NodeValueType.AnyType:", - " return 0;", - " case NodeValueType.NullableAnyType:", - " return undefined;", - " }", - "};", - "", - "class Node {", - " constructor(type, signatureIndex = -1, data = {}) {", - " this.inputs = [];", - " this.outputs = [];", - " this.signatureIndex = -1;", - " this.position = new THREE.Vector2();", - " this.outputValues = [];", - " this.id = '' + Math.round(Math.random() * 100000);", - " this.type = type;", - " this.signatureIndex = signatureIndex;", - " this.data = data;", - " const realIndex = signatureIndex === -1 ? 0 : signatureIndex;", - " for (let i = 0; i < type.nodeTypeSignatures[realIndex].inputTypes.length; i++) {", - " this.inputs.push(undefined);", - " }", - " for (let i = 0; i < type.nodeTypeSignatures[realIndex].outputTypes.length; i++) {", - " this.outputs.push([]);", - " this.outputValues.push(genDefaultForNodeValueType(type.nodeTypeSignatures[realIndex].outputTypes[i]));", - " }", - " }", - " get inputTypes() {", - " const signatureIndex = this.signatureIndex === -1 ? 0 : this.signatureIndex;", - " return this.type.nodeTypeSignatures[signatureIndex].inputTypes;", - " }", - " get outputTypes() {", - " const signatureIndex = this.signatureIndex === -1 ? 0 : this.signatureIndex;", - " return this.type.nodeTypeSignatures[signatureIndex].outputTypes;", - " }", - " func(context, inputs, outputs) {", - " const signatureIndex = this.signatureIndex === -1 ? 0 : this.signatureIndex;", - " this.type.nodeTypeSignatures[signatureIndex].func(context, this.data, inputs, outputs);", - " }", - "}", - "class Wire {", - " constructor(input, inputIndex, output, outputIndex) {", - " this.input = input;", - " this.inputIndex = inputIndex;", - " this.input.outputs[inputIndex].push(this);", - " this.output = output;", - " this.outputIndex = outputIndex;", - " this.output.inputs[outputIndex] = this;", - " }", - "}", - "", - "class BaseCompiler {", - " constructor() {", - " this.visited = new Set();", - " BaseCompiler.Instance = this;", - " }", - " buildExecutionOrder(graph, context) {", - " graph.nodesInOrder.length = 0;", - " this.visited.clear();", - " for (let i = 0; i < graph.outputNodes.length; i++) {", - " const node = graph.outputNodes[i];", - " if (node.inputs[0] !== undefined) {", - " this._traverse(node, graph, context);", - " }", - " }", - " graph.compiled = true;", - " }", - " _traverse(node, graph, context) {", - " this.visited.add(node.id);", - " for (let i = 0; i < node.inputs.length; i++) {", - " if (node.inputs[i] instanceof Wire) {", - " const inputNode = node.inputs[i].input;", - " if (!this.visited.has(inputNode.id)) {", - " this._traverse(inputNode, graph, context);", - " }", - " }", - " else if (node.inputs[i] !== undefined);", - " else;", - " }", - " graph.nodesInOrder.push(node);", - " }", - "}", - "", - "class Interpreter extends BaseCompiler {", - " constructor() {", - " super();", - " }", - " executeCompiledGraph(graph, context) {", - " const nodes = graph.nodesInOrder;", - " for (let i = 0; i < nodes.length; i++) {", - " const inputValues = [];", - " const node = nodes[i];", - " for (let j = 0; j < node.inputs.length; j++) {", - " if (node.inputs[j] instanceof Wire) {", - " inputValues.push(node.inputs[j].input.outputValues[node.inputs[j].inputIndex]);", - " }", - " else if (node.inputs[j] !== undefined) {", - " inputValues.push(node.inputs[j].getValue(context));", - " }", - " else {", - " inputValues.push(undefined);", - " }", - " }", - " node.func(context, inputValues, node.outputValues);", - " }", - " }", - " run(graph, context) {", - " if (!graph.compiled) {", - " this.buildExecutionOrder(graph, context);", - " }", - " this.executeCompiledGraph(graph, context);", - " }", - "}", - "", - "class NodeType {", - " constructor(name) {", - " this.nodeTypeSignatures = [];", - " this.name = name;", - " }", - " addSignature(inputTypes, outputTypes, func) {", - " this.nodeTypeSignatures.push({", - " inputTypes: inputTypes,", - " outputTypes: outputTypes,", - " func: func,", - " });", - " }", - "}", - "class GraphNodeType extends NodeType {", - " constructor(nodeGraph) {", - " const inputTypes = [];", - " for (let i = 0; i < nodeGraph.inputNodes.length; i++) {", - " if (nodeGraph.inputNodes[i].type.name === 'input') {", - " inputTypes.push(nodeGraph.inputNodes[i].data.type);", - " }", - " }", - " const outputTypes = [];", - " for (let i = 0; i < nodeGraph.outputNodes.length; i++) {", - " if (nodeGraph.outputNodes[i].type.name === 'output') {", - " outputTypes.push(nodeGraph.outputNodes[i].data.type);", - " }", - " }", - " super(nodeGraph.name);", - " this.addSignature(inputTypes, outputTypes, (context, data, inputs, outputs) => {", - " context.inputs = inputs;", - " context.outputs = outputs;", - " Interpreter.Instance.run(nodeGraph, context);", - " });", - " this.nodeGraph = nodeGraph;", - " }", - "}", - "", - "const NodeTypes = {};", - "const addNode = new NodeType('add');", - "addNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0] + inputs[1];", - "});", - "addNode.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", - " outputs[0].addVectors(inputs[0], inputs[1]);", - "});", - "addNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", - " outputs[0].addVectors(inputs[0], inputs[1]);", - "});", - "addNode.addSignature([NodeValueType.Vec4, NodeValueType.Vec4], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", - " outputs[0].addVectors(inputs[0], inputs[1]);", - "});", - "NodeTypes['add'] = addNode;", - "const subNode = new NodeType('sub');", - "subNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0] - inputs[1];", - "});", - "subNode.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", - " outputs[0].subVectors(inputs[0], inputs[1]);", - "});", - "subNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", - " outputs[0].subVectors(inputs[0], inputs[1]);", - "});", - "subNode.addSignature([NodeValueType.Vec4, NodeValueType.Vec4], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", - " outputs[0].subVectors(inputs[0], inputs[1]);", - "});", - "NodeTypes['sub'] = subNode;", - "const mulNode = new NodeType('mul');", - "mulNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0] * inputs[1];", - "});", - "mulNode.addSignature([NodeValueType.Vec2, NodeValueType.Number], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", - " outputs[0].copy(inputs[0]).multiplyScalar(inputs[1]);", - "});", - "mulNode.addSignature([NodeValueType.Vec3, NodeValueType.Number], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", - " outputs[0].copy(inputs[0]).multiplyScalar(inputs[1]);", - "});", - "mulNode.addSignature([NodeValueType.Vec4, NodeValueType.Number], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", - " outputs[0].copy(inputs[0]).multiplyScalar(inputs[1]);", - "});", - "NodeTypes['mul'] = mulNode;", - "const divNode = new NodeType('div');", - "divNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0] / inputs[1];", - "});", - "divNode.addSignature([NodeValueType.Vec2, NodeValueType.Number], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", - " outputs[0].copy(inputs[0]).divideScalar(inputs[1]);", - "});", - "divNode.addSignature([NodeValueType.Vec3, NodeValueType.Number], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", - " outputs[0].copy(inputs[0]).divideScalar(inputs[1]);", - "});", - "divNode.addSignature([NodeValueType.Vec4, NodeValueType.Number], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", - " outputs[0].copy(inputs[0]).divideScalar(inputs[1]);", - "});", - "NodeTypes['div'] = divNode;", - "const sinNode = new NodeType('sin');", - "sinNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = Math.sin(inputs[0]);", - "});", - "NodeTypes['sin'] = sinNode;", - "const cosNode = new NodeType('cos');", - "cosNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = Math.cos(inputs[0]);", - "});", - "NodeTypes['cos'] = cosNode;", - "const tanNode = new NodeType('tan');", - "tanNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = Math.tan(inputs[0]);", - "});", - "NodeTypes['tan'] = tanNode;", - "const absNode = new NodeType('abs');", - "absNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = Math.abs(inputs[0]);", - "});", - "NodeTypes['abs'] = absNode;", - "const minNode = new NodeType('min');", - "minNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = Math.min(inputs[0], inputs[1]);", - "});", - "NodeTypes['min'] = minNode;", - "const maxNode = new NodeType('max');", - "maxNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = Math.max(inputs[0], inputs[1]);", - "});", - "NodeTypes['max'] = maxNode;", - "const dot = new NodeType('dot');", - "dot.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].dot(inputs[1]);", - "});", - "dot.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].dot(inputs[1]);", - "});", - "dot.addSignature([NodeValueType.Vec4, NodeValueType.Vec4], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].dot(inputs[1]);", - "});", - "NodeTypes['dot'] = dot;", - "const cross = new NodeType('cross');", - "cross.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", - " outputs[0].crossVectors(inputs[0], inputs[1]);", - "});", - "NodeTypes['cross'] = cross;", - "const length = new NodeType('length');", - "length.addSignature([NodeValueType.Vec2], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].length();", - "});", - "length.addSignature([NodeValueType.Vec3], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].length();", - "});", - "length.addSignature([NodeValueType.Vec4], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].length();", - "});", - "NodeTypes['length'] = length;", - "const lengthSq = new NodeType('lengthSq');", - "lengthSq.addSignature([NodeValueType.Vec2], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].lengthSq();", - "});", - "lengthSq.addSignature([NodeValueType.Vec3], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].lengthSq();", - "});", - "lengthSq.addSignature([NodeValueType.Vec4], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].lengthSq();", - "});", - "NodeTypes['lengthSq'] = lengthSq;", - "const normalize = new NodeType('normalize');", - "normalize.addSignature([NodeValueType.Vec2], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", - " outputs[0].copy(inputs[0]).normalize();", - "});", - "normalize.addSignature([NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", - " outputs[0].copy(inputs[0]).normalize();", - "});", - "normalize.addSignature([NodeValueType.Vec4], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", - " outputs[0].copy(inputs[0]).normalize();", - "});", - "NodeTypes['normalize'] = normalize;", - "const distance = new NodeType('distance');", - "distance.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].distanceTo(inputs[1]);", - "});", - "distance.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].distanceTo(inputs[1]);", - "});", - "NodeTypes['distance'] = distance;", - "const andNode = new NodeType('and');", - "andNode.addSignature([NodeValueType.Boolean, NodeValueType.Boolean], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0] && inputs[1];", - "});", - "NodeTypes['and'] = andNode;", - "const orNode = new NodeType('or');", - "orNode.addSignature([NodeValueType.Boolean, NodeValueType.Boolean], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0] || inputs[1];", - "});", - "NodeTypes['or'] = orNode;", - "const notNode = new NodeType('not');", - "notNode.addSignature([NodeValueType.Boolean], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", - " outputs[0] = !inputs[0];", - "});", - "NodeTypes['not'] = notNode;", - "const equalNode = new NodeType('equal');", - "equalNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0] === inputs[1];", - "});", - "equalNode.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].equals(inputs[1]);", - "});", - "equalNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].equals(inputs[1]);", - "});", - "equalNode.addSignature([NodeValueType.Vec4, NodeValueType.Vec4], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].equals(inputs[1]);", - "});", - "NodeTypes['equal'] = equalNode;", - "const lessThanNode = new NodeType('lessThan');", - "lessThanNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0] < inputs[1];", - "});", - "NodeTypes['lessThan'] = lessThanNode;", - "const greaterThanNode = new NodeType('greaterThan');", - "greaterThanNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0] > inputs[1];", - "});", - "NodeTypes['greaterThan'] = greaterThanNode;", - "const lessThanOrEqualNode = new NodeType('lessThanOrEqual');", - "lessThanOrEqualNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0] <= inputs[1];", - "});", - "NodeTypes['lessThanOrEqual'] = lessThanOrEqualNode;", - "const greaterThanOrEqualNode = new NodeType('greaterThanOrEqual');", - "greaterThanOrEqualNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0] >= inputs[1];", - "});", - "NodeTypes['greaterThanOrEqual'] = greaterThanOrEqualNode;", - "const ifNode = new NodeType('if');", - "ifNode.addSignature([NodeValueType.Boolean, NodeValueType.AnyType, NodeValueType.AnyType], [NodeValueType.AnyType], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0] ? inputs[1] : inputs[2];", - "});", - "NodeTypes['if'] = ifNode;", - "const numberNode = new NodeType('number');", - "numberNode.addSignature([], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = data.value;", - "});", - "NodeTypes['number'] = numberNode;", - "const vec2Node = new NodeType('vec2');", - "vec2Node.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", - " outputs[0].x = inputs[0];", - " outputs[0].y = inputs[1];", - "});", - "NodeTypes['vec2'] = vec2Node;", - "const vec3Node = new NodeType('vec3');", - "vec3Node.addSignature([NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", - " outputs[0].x = inputs[0];", - " outputs[0].y = inputs[1];", - " outputs[0].z = inputs[2];", - "});", - "NodeTypes['vec3'] = vec3Node;", - "const vec4Node = new NodeType('vec4');", - "vec4Node.addSignature([NodeValueType.Number, NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", - " outputs[0].x = inputs[0];", - " outputs[0].y = inputs[1];", - " outputs[0].z = inputs[2];", - " outputs[0].w = inputs[3];", - "});", - "NodeTypes['vec4'] = vec4Node;", - "const splitVec2Node = new NodeType('splitVec2');", - "splitVec2Node.addSignature([NodeValueType.Vec2], [NodeValueType.Number, NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].x;", - " outputs[1] = inputs[0].y;", - "});", - "NodeTypes['splitVec2'] = splitVec2Node;", - "const splitVec3Node = new NodeType('splitVec3');", - "splitVec3Node.addSignature([NodeValueType.Vec3], [NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].x;", - " outputs[1] = inputs[0].y;", - " outputs[2] = inputs[0].z;", - "});", - "NodeTypes['splitVec3'] = splitVec3Node;", - "const splitVec4Node = new NodeType('splitVec4');", - "splitVec4Node.addSignature([NodeValueType.Vec4], [NodeValueType.Number, NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0].x;", - " outputs[1] = inputs[0].y;", - " outputs[2] = inputs[0].z;", - " outputs[3] = inputs[0].w;", - "});", - "NodeTypes['splitVec4'] = splitVec4Node;", - "const boolNode = new NodeType('bool');", - "boolNode.addSignature([], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", - " outputs[0] = data.value;", - "});", - "NodeTypes['bool'] = boolNode;", - "const particlePropertyNode = new NodeType('particleProperty');", - "particlePropertyNode.addSignature([NodeValueType.NullableAnyType], [NodeValueType.NullableAnyType], (context, data, inputs, outputs) => {", - " if (inputs[0] !== undefined) {", - " if (typeof inputs[0] === 'object') {", - " context.particle[data.property].copy(inputs[0]);", - " }", - " else {", - " context.particle[data.property] = inputs[0];", - " }", - " }", - " if (context.particle[data.property] !== undefined) {", - " if (typeof outputs[0] === 'object') {", - " outputs[0].copy(context.particle[data.property]);", - " }", - " else {", - " outputs[0] = context.particle[data.property];", - " }", - " }", - "});", - "NodeTypes['particleProperty'] = particlePropertyNode;", - "const emitNode = new NodeType('emit');", - "emitNode.addSignature([NodeValueType.EventStream], [], (context, data, inputs, outputs) => {", - " const arr = inputs[0];", - " for (let i = 0; i < arr.length; i++) {", - " context.signal(i, arr[i]);", - " }", - "});", - "NodeTypes['emit'] = emitNode;", - "const graphPropertyNode = new NodeType('graphProperty');", - "graphPropertyNode.addSignature([NodeValueType.NullableAnyType], [NodeValueType.NullableAnyType], (context, data, inputs, outputs) => {", - " if (inputs[0] !== undefined) {", - " if (typeof inputs[0] === 'object') {", - " context.graph[data.property].copy(inputs[0]);", - " }", - " else {", - " context.graph[data.property] = inputs[0];", - " }", - " }", - " if (context.graph[data.property] !== undefined) {", - " if (typeof outputs[0] === 'object') {", - " outputs[0].copy(context.graph[data.property]);", - " }", - " else {", - " outputs[0] = context.graph[data.property];", - " }", - " }", - "});", - "NodeTypes['graphProperty'] = graphPropertyNode;", - "const startEventNode = new NodeType('startEvent');", - "startEventNode.addSignature([], [NodeValueType.EventStream], (context, data, inputs, outputs) => {", - " outputs[0] = [{ type: 'start' }];", - "});", - "NodeTypes['startEvent'] = startEventNode;", - "const repeaterNode = new NodeType('repeater');", - "repeaterNode.addSignature([NodeValueType.EventStream, NodeValueType.Number], [NodeValueType.EventStream], (context, data, inputs, outputs) => {", - " const arr = inputs[0];", - " const count = inputs[1];", - " const result = [];", - " for (let j = 0; j < arr.length; j++) {", - " for (let i = 0; i < count; i++) {", - " result.push(arr[j]);", - " }", - " }", - " outputs[0] = result;", - "});", - "NodeTypes['repeater'] = repeaterNode;", - "const timeNode = new NodeType('time');", - "timeNode.addSignature([], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = context.emissionState.time;", - "});", - "NodeTypes['time'] = timeNode;", - "const deltaNode = new NodeType('delta');", - "deltaNode.addSignature([], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = context.delta;", - "});", - "NodeTypes['delta'] = deltaNode;", - "const outputNode = new NodeType('output');", - "outputNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0];", - "});", - "outputNode.addSignature([NodeValueType.Vec2], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0];", - "});", - "outputNode.addSignature([NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0];", - "});", - "outputNode.addSignature([NodeValueType.Vec4], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0];", - "});", - "outputNode.addSignature([NodeValueType.Boolean], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", - " outputs[0] = inputs[0];", - "});", - "NodeTypes['output'] = outputNode;", - "const lerpNode = new NodeType('lerp');", - "lerpNode.addSignature([NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] =", - " inputs[0] * (1 - inputs[2]) + inputs[1] * inputs[2];", - "});", - "lerpNode.addSignature([NodeValueType.Vec2, NodeValueType.Vec2, NodeValueType.Number], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", - " outputs[0].lerpVectors(inputs[0], inputs[1], inputs[2]);", - "});", - "lerpNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3, NodeValueType.Number], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", - " outputs[0].lerpVectors(inputs[0], inputs[1], inputs[2]);", - "});", - "lerpNode.addSignature([NodeValueType.Vec4, NodeValueType.Vec4, NodeValueType.Number], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", - " outputs[0].lerpVectors(inputs[0], inputs[1], inputs[2]);", - "});", - "NodeTypes['lerp'] = lerpNode;", - "const normalD = (x) => {", - " return (1 / Math.sqrt(2 * Math.PI)) * Math.exp(x * x * -0.5);", - "};", - "const normalDistributionNode = new NodeType('normDistrib');", - "normalDistributionNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = normalD(inputs[0]);", - "});", - "NodeTypes['normDistrib'] = normalDistributionNode;", - "const normcdfNode = new NodeType('normcdf');", - "normcdfNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " let x = inputs[0];", - " const a1 = 0.254829592;", - " const a2 = -0.284496736;", - " const a3 = 1.421413741;", - " const a4 = -1.453152027;", - " const a5 = 1.061405429;", - " const p = 0.3275911;", - " let sign = 1;", - " if (x < 0)", - " sign = -1;", - " x = Math.abs(x) / Math.sqrt(2.0);", - " const t = 1.0 / (1.0 + p * x);", - " const y = 1.0 - ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t * Math.exp(-x * x);", - " outputs[0] = 0.5 * (1.0 + sign * y);", - "});", - "NodeTypes['normcdf'] = normcdfNode;", - "const normcdfInvNode = new NodeType('normcdfInv');", - "const rationalApproximation = (t) => {", - " const c = [2.515517, 0.802853, 0.010328];", - " const d = [1.432788, 0.189269, 0.001308];", - " return t - ((c[2] * t + c[1]) * t + c[0]) / (((d[2] * t + d[1]) * t + d[0]) * t + 1.0);", - "};", - "const normcdfInv = (p) => {", - " if (p < 0.5) {", - " return -rationalApproximation(Math.sqrt(-2.0 * Math.log(p)));", - " }", - " else {", - " return rationalApproximation(Math.sqrt(-2.0 * Math.log(1 - p)));", - " }", - "};", - "normcdfInvNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = normcdfInv(inputs[0]);", - "});", - "NodeTypes['normcdfInv'] = normcdfInvNode;", - "const clampNode = new NodeType('clamp');", - "clampNode.addSignature([NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = Math.max(Math.min(inputs[0], inputs[2]), inputs[1]);", - "});", - "NodeTypes['clamp'] = clampNode;", - "const smoothstepNode = new NodeType('smoothstep');", - "smoothstepNode.addSignature([NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " const x = Math.max(Math.min(inputs[0], inputs[2]), inputs[1]);", - " outputs[0] = x * x * (3 - 2 * x);", - "});", - "NodeTypes['smoothstep'] = smoothstepNode;", - "const randomNode = new NodeType('random');", - "randomNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", - " outputs[0] = Math.random() * (inputs[1] - inputs[0]) + inputs[0];", - "});", - "randomNode.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", - " let random = Math.random();", - " outputs[0].lerpVectors(inputs[0], inputs[1], random);", - "});", - "randomNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", - " let random = Math.random();", - " outputs[0].lerpVectors(inputs[0], inputs[1], random);", - "});", - "randomNode.addSignature([NodeValueType.Vec4, NodeValueType.Vec4], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", - " let random = Math.random();", - " outputs[0].lerpVectors(inputs[0], inputs[1], random);", - "});", - "NodeTypes['random'] = randomNode;", - "const vrandNode = new NodeType('vrand');", - "vrandNode.addSignature([], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", - " let x = normcdfInv(Math.random());", - " let y = normcdfInv(Math.random());", - " const mag = Math.sqrt(x * x + y * y);", - " outputs[0].set(x / mag, y / mag);", - "});", - "vrandNode.addSignature([], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", - " let x = normcdfInv(Math.random());", - " let y = normcdfInv(Math.random());", - " let z = normcdfInv(Math.random());", - " const mag = Math.sqrt(x * x + y * y + z * z);", - " outputs[0].set(x / mag, y / mag, z / mag);", - "});", - "vrandNode.addSignature([], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", - " let x = normcdfInv(Math.random());", - " let y = normcdfInv(Math.random());", - " let z = normcdfInv(Math.random());", - " let w = normcdfInv(Math.random());", - " const mag = Math.sqrt(x * x + y * y + z * z + w * w);", - " outputs[0].set(x / mag, y / mag, z / mag, w / mag);", - "});", - "NodeTypes['vrand'] = vrandNode;", - "const bsdfNode = new NodeType('bsdf');", - "bsdfNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3, NodeValueType.Vec3, NodeValueType.Number], [], (context, data, inputs, outputs) => { });", - "NodeTypes['bsdf'] = bsdfNode;", - "const OutputNodeTypeNames = new Set(['output', 'particleProperty', 'graphProperty', 'emit']);", - "", - "class NodeGraph {", - " constructor(name) {", - " this.inputNodes = [];", - " this.outputNodes = [];", - " this.allNodes = new Map();", - " this.wires = [];", - " this.compiled = false;", - " this.nodesInOrder = [];", - " this.version = '1.0';", - " this.uuid = THREE.MathUtils.generateUUID();", - " this.name = name;", - " this.revision = 0;", - " }", - " addWire(wire) {", - " this.wires.push(wire);", - " this.revision++;", - " }", - " addNode(node) {", - " this.allNodes.set(node.id, node);", - " if (node.type === NodeTypes['input']) {", - " this.inputNodes.push(node);", - " }", - " else if (OutputNodeTypeNames.has(node.type.name)) {", - " this.outputNodes.push(node);", - " }", - " this.revision++;", - " }", - " getNode(id) {", - " return this.allNodes.get(id);", - " }", - " deleteNode(node) {", - " this.allNodes.delete(node.id);", - " this.revision++;", - " }", - " deleteWire(wire) {", - " let index = wire.input.outputs[wire.inputIndex].indexOf(wire);", - " if (index !== -1) {", - " wire.input.outputs[wire.inputIndex].splice(index, 1);", - " }", - " wire.output.inputs[wire.outputIndex] = undefined;", - " index = this.wires.indexOf(wire);", - " if (index != -1) {", - " this.wires[index] = this.wires[this.wires.length - 1];", - " this.wires.pop();", - " }", - " this.revision++;", - " }", - " toJSON() {", - " throw new Error('not implemented');", - " }", - " clone() {", - " throw new Error('not implemented');", - " }", - "}", - "", - "new THREE.Vector3(0, 0, 1);", - "const tempQ = new THREE.Quaternion();", - "const tempV = new THREE.Vector3();", - "const tempV2 = new THREE.Vector3();", - "const PREWARM_FPS = 60;", - "const DEFAULT_GEOMETRY = new THREE.PlaneGeometry(1, 1, 1, 1);", - "class NodeVFX {", - " set time(time) {", - " this.emissionState.time = time;", - " }", - " get time() {", - " return this.emissionState.time;", - " }", - " get layers() {", - " return this.rendererSettings.layers;", - " }", - " get texture() {", - " return this.rendererSettings.material.map;", - " }", - " set texture(texture) {", - " this.rendererSettings.material.map = texture;", - " this.neededToUpdateRender = true;", - " }", - " get material() {", - " return this.rendererSettings.material;", - " }", - " set material(material) {", - " this.rendererSettings.material = material;", - " this.neededToUpdateRender = true;", - " }", - " get instancingGeometry() {", - " return this.rendererSettings.instancingGeometry;", - " }", - " set instancingGeometry(geometry) {", - " this.restart();", - " this.particles.length = 0;", - " this.rendererSettings.instancingGeometry = geometry;", - " this.neededToUpdateRender = true;", - " }", - " get renderMode() {", - " return this.rendererSettings.renderMode;", - " }", - " set renderMode(renderMode) {", - " if ((this.rendererSettings.renderMode != RenderMode.Trail && renderMode === RenderMode.Trail) ||", - " (this.rendererSettings.renderMode == RenderMode.Trail && renderMode !== RenderMode.Trail)) {", - " this.restart();", - " this.particles.length = 0;", - " }", - " if (this.rendererSettings.renderMode !== renderMode) {", - " switch (renderMode) {", - " case RenderMode.Trail:", - " this.rendererEmitterSettings = {", - " startLength: 30,", - " followLocalOrigin: false,", - " };", - " break;", - " case RenderMode.Mesh:", - " this.rendererEmitterSettings = {", - " geometry: new THREE.PlaneGeometry(1, 1),", - " };", - " break;", - " case RenderMode.BillBoard:", - " case RenderMode.VerticalBillBoard:", - " case RenderMode.HorizontalBillBoard:", - " case RenderMode.StretchedBillBoard:", - " this.rendererEmitterSettings = {};", - " break;", - " }", - " }", - " this.rendererSettings.renderMode = renderMode;", - " this.neededToUpdateRender = true;", - " }", - " get renderOrder() {", - " return this.rendererSettings.renderOrder;", - " }", - " set renderOrder(renderOrder) {", - " this.rendererSettings.renderOrder = renderOrder;", - " this.neededToUpdateRender = true;", - " }", - " get blending() {", - " return this.rendererSettings.material.blending;", - " }", - " set blending(blending) {", - " this.rendererSettings.material.blending = blending;", - " this.neededToUpdateRender = true;", - " }", - " constructor(parameters) {", - " var _a, _b, _c, _d, _e, _f, _g;", - " this.temp = new THREE.Vector3();", - " this.travelDistance = 0;", - " this.normalMatrix = new THREE.Matrix3();", - " this.speedFactor = 0;", - " this.autoDestroy = parameters.autoDestroy === undefined ? false : parameters.autoDestroy;", - " this.duration = (_a = parameters.duration) !== null && _a !== void 0 ? _a : 1;", - " this.looping = parameters.looping === undefined ? true : parameters.looping;", - " this.prewarm = parameters.prewarm === undefined ? false : parameters.prewarm;", - " this.worldSpace = (_b = parameters.worldSpace) !== null && _b !== void 0 ? _b : false;", - " this.rendererEmitterSettings = (_c = parameters.rendererEmitterSettings) !== null && _c !== void 0 ? _c : {};", - " this.emissionGraph = parameters.emissionGraph;", - " this.updateGraph = parameters.updateGraph;", - " this.interpreter = new Interpreter();", - " this.rendererSettings = {", - " instancingGeometry: (_d = parameters.instancingGeometry) !== null && _d !== void 0 ? _d : DEFAULT_GEOMETRY,", - " renderMode: (_e = parameters.renderMode) !== null && _e !== void 0 ? _e : RenderMode.BillBoard,", - " renderOrder: (_f = parameters.renderOrder) !== null && _f !== void 0 ? _f : 0,", - " material: parameters.material,", - " layers: (_g = parameters.layers) !== null && _g !== void 0 ? _g : new THREE.Layers(),", - " uTileCount: 1,", - " vTileCount: 1,", - " };", - " this.neededToUpdateRender = true;", - " this.particles = new Array();", - " this.emitter = new ParticleEmitter(this);", - " this.paused = false;", - " this.particleNum = 0;", - " this.emissionState = {", - " time: 0,", - " };", - " this.emitEnded = false;", - " this.markForDestroy = false;", - " this.prewarmed = false;", - " }", - " pause() {", - " this.paused = true;", - " }", - " play() {", - " this.paused = false;", - " }", - " spawn(emissionState, matrix) {", - " tempQ.setFromRotationMatrix(matrix);", - " const translation = tempV;", - " const quaternion = tempQ;", - " const scale = tempV2;", - " matrix.decompose(translation, quaternion, scale);", - " this.particleNum++;", - " while (this.particles.length < this.particleNum) {", - " this.particles.push(new NodeParticle());", - " }", - " const particle = this.particles[this.particleNum - 1];", - " particle.reset();", - " this.interpreter.run(this.updateGraph, { particle: particle, emissionState: this.emissionState });", - " if (this.rendererSettings.renderMode === RenderMode.Trail &&", - " this.rendererEmitterSettings.followLocalOrigin) {", - " const trail = particle;", - " trail.localPosition = new THREE.Vector3().copy(trail.position);", - " }", - " if (this.worldSpace) {", - " particle.position.applyMatrix4(matrix);", - " particle.size *= (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z)) / 3;", - " particle.velocity.multiply(scale).applyMatrix3(this.normalMatrix);", - " if (particle.rotation && particle.rotation instanceof THREE.Quaternion) {", - " particle.rotation.multiplyQuaternions(tempQ, particle.rotation);", - " }", - " }", - " }", - " endEmit() {", - " this.emitEnded = true;", - " if (this.autoDestroy) {", - " this.markForDestroy = true;", - " }", - " }", - " dispose() {", - " if (this._renderer)", - " this._renderer.deleteSystem(this);", - " this.emitter.dispose();", - " if (this.emitter.parent)", - " this.emitter.parent.remove(this.emitter);", - " }", - " restart() {", - " this.paused = false;", - " this.particleNum = 0;", - " this.emissionState.time = 0;", - " this.emitEnded = false;", - " this.markForDestroy = false;", - " this.prewarmed = false;", - " }", - " update(delta) {", - " if (this.paused)", - " return;", - " let currentParent = this.emitter;", - " while (currentParent.parent) {", - " currentParent = currentParent.parent;", - " }", - " if (currentParent.type !== 'Scene') {", - " this.dispose();", - " return;", - " }", - " if (this.emitEnded && this.particleNum === 0) {", - " if (this.markForDestroy && this.emitter.parent)", - " this.dispose();", - " return;", - " }", - " if (this.looping && this.prewarm && !this.prewarmed) {", - " this.prewarmed = true;", - " for (let i = 0; i < this.duration * PREWARM_FPS; i++) {", - " this.update(1.0 / PREWARM_FPS);", - " }", - " }", - " if (delta > 0.1) {", - " delta = 0.1;", - " }", - " if (this.neededToUpdateRender) {", - " if (this._renderer)", - " this._renderer.updateSystem(this);", - " this.neededToUpdateRender = false;", - " }", - " this.emit(delta, this.emissionState, this.emitter.matrixWorld);", - " const context = { particle: undefined, emissionState: this.emissionState, delta };", - " for (let i = 0; i < this.particleNum; i++) {", - " context.particle = this.particles[i];", - " this.interpreter.run(this.updateGraph, context);", - " }", - " for (let i = 0; i < this.particleNum; i++) {", - " if (this.rendererEmitterSettings.followLocalOrigin &&", - " this.particles[i].localPosition) {", - " this.particles[i].position.copy(this.particles[i].localPosition);", - " if (this.particles[i].parentMatrix) {", - " this.particles[i].position.applyMatrix4(this.particles[i].parentMatrix);", - " }", - " else {", - " this.particles[i].position.applyMatrix4(this.emitter.matrixWorld);", - " }", - " }", - " else {", - " this.particles[i].position.addScaledVector(this.particles[i].velocity, delta);", - " }", - " this.particles[i].age += delta;", - " }", - " if (this.rendererSettings.renderMode === RenderMode.Trail) {", - " for (let i = 0; i < this.particleNum; i++) {", - " const particle = this.particles[i];", - " particle.update();", - " }", - " }", - " for (let i = 0; i < this.particleNum; i++) {", - " const particle = this.particles[i];", - " if (particle.died && (!(particle instanceof TrailParticle) || particle.previous.length === 0)) {", - " this.particles[i] = this.particles[this.particleNum - 1];", - " this.particles[this.particleNum - 1] = particle;", - " this.particleNum--;", - " i--;", - " }", - " }", - " }", - " emit(delta, emissionState, emitterMatrix) {", - " if (emissionState.time > this.duration) {", - " if (this.looping) {", - " emissionState.time -= this.duration;", - " }", - " else {", - " if (!this.emitEnded) {", - " this.endEmit();", - " }", - " }", - " }", - " this.normalMatrix.getNormalMatrix(emitterMatrix);", - " const context = {", - " signal: () => {", - " this.spawn(emissionState, emitterMatrix);", - " },", - " emissionState,", - " delta,", - " };", - " if (!this.emitEnded) {", - " this.interpreter.run(this.emissionGraph, context);", - " }", - " if (this.previousWorldPos === undefined)", - " this.previousWorldPos = new THREE.Vector3();", - " this.emitter.getWorldPosition(this.previousWorldPos);", - " emissionState.time += delta;", - " }", - " toJSON(meta, options = {}) {", - " return {};", - " }", - " getRendererSettings() {", - " return this.rendererSettings;", - " }", - " clone() {", - " return this;", - " }", - "}", - "", - "gdjs.__particleEmmiter3DExtension = {", - " ParticleEmitter3DRenderer,", - " ParticleEmitterAdapter,", - " ParticleEmitterHelper,", - "", - " ApplyCollision,", - " ApplyForce,", - " ApplySequences,", - " AxisAngleGenerator,", - " BatchedParticleRenderer,", - " BatchedRenderer,", - " BehaviorFromJSON,", - " BehaviorTypes,", - " Bezier,", - " ChangeEmitDirection,", - " ColorGeneratorFromJSON,", - " ColorOverLife,", - " ColorRange,", - " ConeEmitter,", - " ConstantColor,", - " ConstantValue,", - " DonutEmitter,", - " EmitSubParticleSystem,", - " EmitterFromJSON,", - " EmitterMode,", - " EmitterShapes,", - " EulerGenerator,", - " ForceOverLife,", - " FrameOverLife,", - " GeneratorFromJSON,", - " Gradient,", - " GraphNodeType,", - " GravityForce,", - " GridEmitter,", - " Interpreter,", - " IntervalValue,", - " MeshSurfaceEmitter,", - " Node,", - " NodeGraph,", - " NodeType,", - " NodeTypes,", - " NodeValueType,", - " Noise,", - " OrbitOverLife,", - " ParticleEmitter,", - " ParticleSystem,", - " PiecewiseBezier,", - " PiecewiseFunction,", - " Plugins,", - " PointEmitter,", - " QuarksLoader,", - " RandomColor,", - " RandomColorBetweenGradient,", - " RandomQuatGenerator,", - " RecordState,", - " RenderMode,", - " Rotation3DOverLife,", - " RotationGeneratorFromJSON,", - " RotationOverLife,", - " SequencerFromJSON,", - " SizeOverLife,", - " SpeedOverLife,", - " SphereEmitter,", - " SpriteBatch,", - " SpriteParticle,", - " SubParticleEmitMode,", - " TextureSequencer,", - " TrailBatch,", - " TrailParticle,", - " TurbulenceField,", - " VFXBatch,", - " ValueGeneratorFromJSON,", - " WidthOverLength,", - " Wire,", - " genDefaultForNodeValueType,", - " getPhysicsResolver,", - " loadPlugin,", - " setPhysicsResolver,", - " unloadPlugin,", - "}" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onScenePreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "\r", - "// See doStepPostEvents\r", - "runtimeScene.__particleEmmiter3DExtension = runtimeScene.__particleEmmiter3DExtension || {};\r", - "runtimeScene.__particleEmmiter3DExtension.emittersStepped = 0;" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [ - { - "areaMaxX": 64, - "areaMaxY": 64, - "areaMaxZ": 64, - "areaMinX": 0, - "areaMinY": 0, - "areaMinZ": 0, - "defaultName": "ParticleEmitter", - "description": "Display a large number of particles to create visual effects.", - "fullName": "3D particle emitter", - "is3D": true, - "isUsingLegacyInstancesRenderer": true, - "name": "ParticleEmitter3D", - "objects": [ - { - "adaptCollisionMaskAutomatically": true, - "assetStoreId": "", - "name": "Particle", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [], - "animations": [ - { - "name": "Image", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [] - } - ] - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Particle" - } - ] - }, - "objectsGroups": [], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [], - "editionSettings": {}, - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ParticleEmitter3D::DefineHelperClasses" - }, - "parameters": [ - "", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const {", - " ParticleEmitterAdapter,", - " ParticleEmitter3DRenderer,", - " ParticleEmitterHelper,", - "", - " ParticleSystem,", - " IntervalValue,", - " ConstantValue,", - " ConstantColor,", - " ColorOverLife,", - " SizeOverLife,", - " ApplyForce,", - " Gradient,", - " PiecewiseBezier,", - " Bezier,", - " PointEmitter,", - " ConeEmitter,", - " RenderMode", - "} = gdjs.__particleEmmiter3DExtension;", - "", - "/** @type {gdjs.CustomRuntimeObject} */", - "const object = objects[0];", - "// Force the size of the object because it doesn't contain any instance.", - "object._innerArea = {", - " min: [-16, -16, -16],", - " max: [16, 16, 16],", - " };", - "const hitbox = new gdjs.Polygon();", - "hitbox.vertices = [[-16, -16], [16, -16], [16, 16], [-16, 16]];", - "object._untransformedHitBoxes = [hitbox];", - "object._unrotatedAABB.min[0] = -16;", - "object._unrotatedAABB.min[1] = -16;", - "object._unrotatedAABB.max[0] = 16;", - "object._unrotatedAABB.max[1] = 16;", - "object._updateUntransformedHitBoxes = () => {};", - "", - "// Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.", - "const gameScene = object.getRuntimeScene();", - "const game = runtimeScene.getGame();", - "", - "const texture = game.getImageManager().getThreeTexture('');", - "", - "// Set the blending here because changes are not applied after the emitter creation.", - "const blendingString = object._getBlending();", - "const blending =", - " blendingString === \"Additive\" ? THREE.AdditiveBlending :", - " blendingString === \"Normal\" ? THREE.NormalBlending :", - " blendingString === \"Subtractive\" ? THREE.SubtractiveBlending :", - " blendingString === \"Multiply\" ? THREE.MultiplyBlending :", - " blendingString === \"None\" ? THREE.NoBlending :", - " THREE.AdditiveBlending;", - "", - "", - "// Build a configuration with the right kind of objects.", - "// These values are not important as they are overrided by the object properties values.", - "const muzzle = {", - " duration: 10,", - " looping: false,", - " startLife: new IntervalValue(1, 2),", - " startSpeed: new IntervalValue(100, 200),", - " startSize: new IntervalValue(20, 50),", - " startColor: new ConstantColor(new THREE.Vector4(1, 1, 1, 1)),", - " worldSpace: true,", - "", - " maxParticle: 5,", - " emissionOverTime: new ConstantValue(50),", - " emissionBursts: [{", - " time: 0,", - " count: new ConstantValue(1),", - " cycle: 1,", - " interval: 0.01,", - " probability: 1,", - " }],", - "", - " shape: new PointEmitter(),", - " material: new THREE.MeshBasicMaterial({", - " map: texture,", - " blending: blending,", - " transparent: true,", - " side: THREE.DoubleSide", - " }),", - " startTileIndex: 0,", - " uTileCount: 1,", - " vTileCount: 1,", - " renderOrder: 2,", - " renderMode: RenderMode.BillBoard", - "};", - "const particleSystem = new ParticleSystem(muzzle);", - "", - "const colorOverLife = new ColorOverLife(", - " new Gradient(", - " [", - " [new THREE.Vector3(1, 0, 0), 0],", - " [new THREE.Vector3(1, 0, 0), 1],", - " ],", - " [", - " [1, 0],", - " [1, 1],", - " ]", - " ));", - "particleSystem.addBehavior(colorOverLife);", - "const sizeOverLife = new SizeOverLife(new PiecewiseBezier([[new Bezier(1, 2 / 3, 1 / 3, 0), 0]]));", - "particleSystem.addBehavior(sizeOverLife);", - "const applyForce = new ApplyForce(new THREE.Vector3(0, 0, -1), new ConstantValue(0));", - "particleSystem.addBehavior(applyForce);", - "", - "particleSystem.emitter.name = object.getName() + object.getNameId();", - "", - "object.__particleEmitterAdapter = new ParticleEmitterAdapter(particleSystem, colorOverLife, sizeOverLife, applyForce);", - "object.__particleSystem = particleSystem;", - "", - "// This is a hack that may break in future releases.", - "// Replace the group that would hold children objects by the emmiter.", - "const layer = object.getInstanceContainer().getLayer(object.getLayer());", - "const group = object.getRenderer()._threeGroup;", - "layer.getRenderer().remove3DRendererObject(group);", - "particleSystem.emitter.position.copy(group.position);", - "particleSystem.emitter.rotation.order = 'ZYX';", - "particleSystem.emitter.rotation.copy(group.rotation);", - "", - "const particleEmitter3DRenderer = new ParticleEmitter3DRenderer(object, object._instanceContainer, object.getInstanceContainer());", - "object._renderer = particleEmitter3DRenderer;", - "if (game.isInGameEdition && game.isInGameEdition()) {", - " const particleEmitterHelper = new ParticleEmitterHelper(object);", - " particleEmitter3DRenderer._threeGroup = particleEmitterHelper;", - " layer.getRenderer().add3DRendererObject(particleEmitterHelper);", - "}", - "else {", - " particleEmitter3DRenderer._threeGroup = particleSystem.emitter;", - " layer.getRenderer().add3DRendererObject(particleSystem.emitter);", - "}", - "", - "particleSystem.emitter.updateMatrixWorld(true);", - "", - "", - "// See doStepPostEvents", - "gameScene.__particleEmmiter3DExtension = gameScene.__particleEmmiter3DExtension || {};", - "gameScene.__particleEmmiter3DExtension.emittersCount = gameScene.__particleEmmiter3DExtension.emittersCount || 0;", - "gameScene.__particleEmmiter3DExtension.emittersCount++;", - "", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::UpdateFromProperties" - }, - "parameters": [ - "Object", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetRotationCenter" - }, - "parameters": [ - "Object", - "0", - "0", - "0" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onDestroy", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {gdjs.CustomRuntimeObject} */", - "const object = objects[0];", - "// Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.", - "const gameScene = object.getRuntimeScene();", - "", - "object.__particleSystem.dispose();", - "", - "// See doStepPostEvents", - "gameScene.__particleEmmiter3DExtension.emittersCount--;", - "", - "if (gameScene.__particleEmmiter3DExtension.emittersCount === 0) {", - " // Update batch system now because doStepPostEvents won't be called.", - " gameScene.__particleEmmiter3DExtension.layerNames = gameScene.__particleEmmiter3DExtension.layerNames || [];", - " const layerNames = gameScene.__particleEmmiter3DExtension.layerNames;", - " gameScene.getAllLayerNames(layerNames);", - " for (const layerName of layerNames) {", - " const layer = gameScene.getLayer(layerName);", - " if (layer.__particleEmmiter3DExtension) {", - " layer.__particleEmmiter3DExtension.batchSystem.update(layer.getElapsedTime() / 1000);", - " }", - " }", - "}" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onHotReloading", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::UpdateFromProperties" - }, - "parameters": [ - "Object", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Update from properties.", - "fullName": "Update from properties", - "functionType": "Action", - "name": "UpdateFromProperties", - "private": true, - "sentence": "Update from properties of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetZ" - }, - "parameters": [ - "Object", - "=", - "Object.Z()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetRotationX" - }, - "parameters": [ - "Object", - "=", - "Object.PropertyRotationX()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetRotationY" - }, - "parameters": [ - "Object", - "=", - "Object.PropertyRotationY()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartColor" - }, - "parameters": [ - "Object", - "=", - "Object.StartColor()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetEndColor" - }, - "parameters": [ - "Object", - "=", - "Object.EndColor()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartOpacity" - }, - "parameters": [ - "Object", - "=", - "Object.StartOpacity()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetEndOpacity" - }, - "parameters": [ - "Object", - "=", - "Object.EndOpacity()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetFlow" - }, - "parameters": [ - "Object", - "=", - "Object.Flow()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSizeMin" - }, - "parameters": [ - "Object", - "=", - "Object.StartSizeMin()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSizeMax" - }, - "parameters": [ - "Object", - "=", - "Object.StartSizeMax()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetEndScale" - }, - "parameters": [ - "Object", - "=", - "Object.EndScale()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSpeedMin" - }, - "parameters": [ - "Object", - "=", - "Object.StartSpeedMin()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSpeedMax" - }, - "parameters": [ - "Object", - "=", - "Object.StartSpeedMax()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetLifespanMin" - }, - "parameters": [ - "Object", - "=", - "Object.LifespanMin()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetLifespanMax" - }, - "parameters": [ - "Object", - "=", - "Object.LifespanMax()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetDuration" - }, - "parameters": [ - "Object", - "=", - "Object.Duration()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetSpayConeAngle" - }, - "parameters": [ - "Object", - "=", - "Object.SpayConeAngle()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetGravity" - }, - "parameters": [ - "Object", - "=", - "Object.Gravity()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetGravityTop" - }, - "parameters": [ - "Object", - "=", - "Object.GravityTop()", - "" - ] - }, - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::UpdateImage" - }, - "parameters": [ - "Object", - "" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "AreParticlesRelative", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::SetAreParticlesRelative" - }, - "parameters": [ - "Object", - "no", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "AreParticlesRelative", - "True", - "" - ] - } - ], - "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()", - "" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::UpdateHelper" - }, - "parameters": [ - "Object", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "Update helper", - "functionType": "Action", - "name": "UpdateHelper", - "private": true, - "sentence": "Update graphical helper of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const game = runtimeScene.getGame();", - "if (game.isInGameEdition && game.isInGameEdition()) {", - " const particleEmitterHelper = objects[0].get3DRendererObject();", - " particleEmitterHelper.update();", - "}" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "Update particle image", - "functionType": "Action", - "name": "UpdateImage", - "private": true, - "sentence": "Update particle image of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {gdjs.CustomRuntimeObject3D} */\r", - "const object = objects[0];\r", - "/** @type {SpriteObjectDataType} */\r", - "const particleSpriteData = object._instanceContainer._objects.get(\"Particle\");\r", - "/** @type {gdjs.SpriteAnimationData} */\r", - "const animation = particleSpriteData.animations[0];\r", - "const animationFrame = animation ? animation.directions[0].sprites[0] : null;\r", - "const resourceName = animationFrame ? animationFrame.image : '';\r", - "object.__particleEmitterAdapter.setImage(resourceName);" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::HasEnded" - }, - "parameters": [ - "Object", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::Delete" - }, - "parameters": [ - "Object", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "ParticleEmitter3D::ParticleEmitter3D::HasEnded" - }, - "parameters": [ - "Object", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ParticleEmitter3D::ParticleEmitter3D::RegisterInLayer" - }, - "parameters": [ - "Object", - "" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {gdjs.CustomRuntimeObject3D} */", - "const object = objects[0];", - "// Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.", - "const gameScene = object.getRuntimeScene();", - "", - "// Update batch system after having moved every emitter.", - "// See onScenePreEvents", - "gameScene.__particleEmmiter3DExtension.emittersStepped++;", - "if (gameScene.__particleEmmiter3DExtension.emittersStepped === gameScene.__particleEmmiter3DExtension.emittersCount) {", - " gameScene.__particleEmmiter3DExtension.layerNames = gameScene.__particleEmmiter3DExtension.layerNames || [];", - " const layerNames = gameScene.__particleEmmiter3DExtension.layerNames;", - " gameScene.getAllLayerNames(layerNames);", - " for (const layerName of layerNames) {", - " const layer = gameScene.getLayer(layerName);", - " if (layer.__particleEmmiter3DExtension) {", - " layer.__particleEmmiter3DExtension.batchSystem.update(layer.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();", - "", - " let rootObject = object;", - " while (rootObject.getInstanceContainer().getOwner) {", - " rootObject = rootObject.getInstanceContainer().getOwner();", - " }", - "", - " const layer = gameScene.getLayer(rootObject.getLayer());", - " layer.__particleEmmiter3DExtension = layer.__particleEmmiter3DExtension || {};", - " if (!layer.__particleEmmiter3DExtension.batchSystem) {", - " const batchSystem = new gdjs.__particleEmmiter3DExtension.BatchedRenderer();", - " batchSystem.scale.y *= -1;", - " 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": true - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check that emission has ended and no particle is alive anymore.", - "fullName": "Emission has ended", - "functionType": "Condition", - "name": "HasEnded", - "sentence": "Emission from _PARAM0_ has ended", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];\r", - "\r", - "eventsFunctionContext.returnValue =\r", - " object._getShouldAutodestruct()\r", - " && object.__particleSystem.emitEnded\r", - " && object.__particleSystem.particleNum === 0;\r", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Restart particule emission from the beginning.", - "fullName": "Restart", - "functionType": "Action", - "name": "Restart", - "sentence": "Restart particule emission from _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {gdjs.CustomRuntimeObject} */\r", - "const object = objects[0];\r", - "\r", - "object.__particleSystem.restart();\r", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the Z position of the emitter.", - "fullName": "Z elevaltion (deprecated)", - "functionType": "ExpressionAndCondition", - "group": "Position", - "name": "Z", - "private": true, - "sentence": "the Z position", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.PropertyZ()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "Z", - "name": "SetZ", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Z", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the rotation on X axis of the emitter.", - "fullName": "Rotation on X axis (deprecated)", - "functionType": "ExpressionAndCondition", - "group": "Angle", - "name": "RotationX", - "private": true, - "sentence": "the rotation on X axis", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.PropertyRotationX()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "RotationX", - "name": "SetRotationX", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "RotationX", - "=", - "Value" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];\r", - "\r", - "object.__particleSystem.emitter.rotation.x = eventsFunctionContext.getArgument(\"Value\") * Math.PI / 180;" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the rotation on Y axis of the emitter.", - "fullName": "Rotation on Y axis (deprecated)", - "functionType": "ExpressionAndCondition", - "group": "Angle", - "name": "RotationY", - "private": true, - "sentence": "the rotation on Y axis", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.PropertyRotationY()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "RotationY", - "name": "SetRotationY", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "RotationY", - "=", - "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": "SetStringVariable" - }, - "parameters": [ - "StartColor", - "=", - "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": "SetStringVariable" - }, - "parameters": [ - "EndColor", - "=", - "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": "SetNumberVariable" - }, - "parameters": [ - "StartOpacity", - "=", - "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": "SetNumberVariable" - }, - "parameters": [ - "EndOpacity", - "=", - "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": "SetNumberVariable" - }, - "parameters": [ - "Flow", - "=", - "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": "SetNumberVariable" - }, - "parameters": [ - "StartSizeMin", - "=", - "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": "SetNumberVariable" - }, - "parameters": [ - "StartSizeMax", - "=", - "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": "SetNumberVariable" - }, - "parameters": [ - "EndScale", - "=", - "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": "SetNumberVariable" - }, - "parameters": [ - "StartSpeedMin", - "=", - "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": "SetNumberVariable" - }, - "parameters": [ - "StartSpeedMax", - "=", - "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": "SetNumberVariable" - }, - "parameters": [ - "LifespanMin", - "=", - "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": "SetNumberVariable" - }, - "parameters": [ - "LifespanMax", - "=", - "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": "SetNumberVariable" - }, - "parameters": [ - "Duration", - "=", - "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": "BooleanVariable" - }, - "parameters": [ - "AreParticlesRelative", - "True", - "" - ] - } - ], - "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": "BooleanVariable" - }, - "parameters": [ - "Value", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "AreParticlesRelative", - "False", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "Value", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "AreParticlesRelative", - "True", - "" - ] - } - ] - }, - { - "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": "SetNumberVariable" - }, - "parameters": [ - "SpayConeAngle", - "=", - "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": "SetStringVariable" - }, - "parameters": [ - "Blending", - "=", - "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": "SetStringVariable" - }, - "parameters": [ - "GravityTop", - "=", - "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": "SetNumberVariable" - }, - "parameters": [ - "Gravity", - "=", - "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": "BooleanVariable" - }, - "parameters": [ - "ShouldAutodestruct", - "True", - "" - ] - } - ], - "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": "BooleanVariable" - }, - "parameters": [ - "Value", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "ShouldAutodestruct", - "False", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "Value", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "ShouldAutodestruct", - "True", - "" - ] - } - ] - } - ], - "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", - "group": "Color", - "name": "StartColor" - }, - { - "value": "255;255;0", - "type": "Color", - "label": "End color", - "group": "Color", - "name": "EndColor" - }, - { - "value": "255", - "type": "Number", - "unit": "Dimensionless", - "label": "Start opacity", - "group": "Color", - "name": "StartOpacity" - }, - { - "value": "0", - "type": "Number", - "unit": "Dimensionless", - "label": "End opacity", - "group": "Color", - "name": "EndOpacity" - }, - { - "value": "50", - "type": "Number", - "label": "Flow of particles (particles per second)", - "name": "Flow" - }, - { - "value": "10", - "type": "Number", - "unit": "Pixel", - "label": "Start min size", - "group": "Size", - "name": "StartSizeMin" - }, - { - "value": "20", - "type": "Number", - "unit": "Pixel", - "label": "Start max size", - "group": "Size", - "name": "StartSizeMax" - }, - { - "value": "0", - "type": "Number", - "unit": "Dimensionless", - "label": "End scale", - "group": "Size", - "name": "EndScale" - }, - { - "value": "100", - "type": "Number", - "unit": "PixelSpeed", - "label": "Start min speed", - "group": "Speed", - "name": "StartSpeedMin" - }, - { - "value": "100", - "type": "Number", - "unit": "PixelSpeed", - "label": "Start max speed", - "group": "Speed", - "name": "StartSpeedMax" - }, - { - "value": "1", - "type": "Number", - "unit": "Second", - "label": "Min lifespan", - "name": "LifespanMin" - }, - { - "value": "2", - "type": "Number", - "unit": "Second", - "label": "Max lifespan", - "name": "LifespanMax" - }, - { - "value": "5", - "type": "Number", - "unit": "Second", - "label": "Emission duration", - "name": "Duration" - }, - { - "value": "", - "type": "Boolean", - "label": "Particles move with the emitter", - "group": "Speed", - "name": "AreParticlesRelative" - }, - { - "value": "30", - "type": "Number", - "unit": "DegreeAngle", - "label": "Spay cone angle", - "group": "Position", - "name": "SpayConeAngle" - }, - { - "value": "Additive", - "type": "Choice", - "label": "Blending", - "group": "Color", - "choices": [ - { - "label": "Normal", - "value": "Normal" - }, - { - "label": "Additive", - "value": "Additive" - }, - { - "label": "Subtractive", - "value": "Subtractive" - }, - { - "label": "Multiply", - "value": "Multiply" - }, - { - "label": "None", - "value": "None" - } - ], - "name": "Blending" - }, - { - "value": "Y-", - "type": "Choice", - "label": "Gravity top", - "group": "Speed", - "choices": [ - { - "label": "Y-", - "value": "Y-" - }, - { - "label": "Z+", - "value": "Z+" - } - ], - "name": "GravityTop" - }, - { - "value": "0", - "type": "Number", - "unit": "PixelAcceleration", - "label": "Gravity", - "group": "Speed", - "name": "Gravity" - }, - { - "value": "true", - "type": "Boolean", - "label": "Delete when emission ends", - "name": "ShouldAutodestruct" - }, - { - "value": "Center-center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "hidden": true, - "name": "ParentOrigin" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Z (elevation)", - "description": "Deprecated", - "group": "Position", - "hidden": true, - "name": "Z" - }, - { - "value": "0", - "type": "Number", - "unit": "DegreeAngle", - "label": "Rotation on X axis", - "group": "Position", - "hidden": true, - "name": "RotationX" - }, - { - "value": "0", - "type": "Number", - "unit": "DegreeAngle", - "label": "Rotation on Y axis", - "group": "Position", - "hidden": true, - "name": "RotationY" - } - ], - "variants": [] - } - ] - }, - { - "author": "@Bouh", - "category": "User interface", - "extensionNamespace": "", - "fullName": "Time formatting", - "gdevelopVersion": "", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWNsb2NrLWRpZ2l0YWwiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMiw2QTIsMiAwIDAsMCAwLDhWMTZBMiwyIDAgMCwwIDIsMThIMjJBMiwyIDAgMCwwIDI0LDE2VjhBMiwyIDAgMCwwIDIyLDZNMiw4SDIyVjE2SDJNMyw5VjEwLjVINi4yNUwzLDE1SDQuNzVMOCwxMC41VjlNOS4yNSw5VjEwLjVIMTAuNzVWOU0xMiw5VjEwLjVIMTMuNVYxNUgxNVY5TTE3LDlBMSwxIDAgMCwwIDE2LDEwVjE0QTEsMSAwIDAsMCAxNywxNUgyMEExLDEgMCAwLDAgMjEsMTRWMTBBMSwxIDAgMCwwIDIwLDlNMTcuNSwxMC41SDE5LjVWMTMuNUgxNy41TTkuMjUsMTMuNVYxNUgxMC43NVYxMy41IiAvPjwvc3ZnPg==", - "name": "TimeFormatter", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/clock-digital.svg", - "shortDescription": "Converts seconds into standard time formats, such as HH:MM:SS. ", - "version": "0.0.2", - "description": [ - "Ideal for displaying timers on screen.", - "", - "Formats included:", - "* HH:MM:SS", - "* HH:MM:SS.000 (displays milliseconds)" - ], - "origin": { - "identifier": "TimeFormatter", - "name": "gdevelop-extension-store" - }, - "tags": [ - "time", - "timer", - "format", - "hours", - "minutes", - "seconds", - "milliseconds" - ], - "authorIds": [ - "2OwwM8ToR9dx9RJ2sAKTcrLmCB92" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Format time in seconds to HH:MM:SS.", - "fullName": "Format time in seconds to HH:MM:SS", - "functionType": "StringExpression", - "name": "SecondsToHHMMSS", - "sentence": "Format time _PARAM1_ to HH:MM:SS in _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "var format_time = function (time_second) {\r", - " date = new Date(null);\r", - " date.setSeconds(time_second);\r", - " if (time_second >= 3600) {\r", - " return date.toISOString().substr(11, 8); // MM:SS\r", - " } else {\r", - " return date.toISOString().substr(14, 5); // HH:MM:SS\r", - " }\r", - "}\r", - "\r", - "eventsFunctionContext.returnValue = format_time(eventsFunctionContext.getArgument(\"TimeInSeconds\"));" - ], - "parameterObjects": "", - "useStrict": false, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "Time, in seconds", - "name": "TimeInSeconds", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Format time in seconds to HH:MM:SS.000, including milliseconds.", - "fullName": "Format time in seconds to HH:MM:SS.000", - "functionType": "StringExpression", - "name": "SecondsToHHMMSS000", - "sentence": "Format time _PARAM1_ to HH:MM:SS in _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "var format_time = function (time_second) {\r", - " date = new Date(null);\r", - " date.setMilliseconds(1000*time_second);\r", - " if (time_second >= 3600) {\r", - " return date.toISOString().substr(11, 12); // MM:SS.000\r", - " } else {\r", - " return date.toISOString().substr(14, 9); // HH:MM:SS.000\r", - " }\r", - "}\r", - "\r", - "eventsFunctionContext.returnValue = format_time(eventsFunctionContext.getArgument(\"TimeInSeconds\"));" - ], - "parameterObjects": "", - "useStrict": false, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "Time, in seconds", - "name": "TimeInSeconds", - "type": "expression" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "User interface", - "extensionNamespace": "", - "fullName": "Panel sprite button", - "gdevelopVersion": ">=5.5.230", - "helpPath": "/objects/button", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI5LDIzSDNjLTEuMSwwLTItMC45LTItMlYxMWMwLTEuMSwwLjktMiwyLTJoMjZjMS4xLDAsMiwwLjksMiwydjEwQzMxLDIyLjEsMzAuMSwyMywyOSwyM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMywxOUwxMywxOWMtMS4xLDAtMi0wLjktMi0ydi0yYzAtMS4xLDAuOS0yLDItMmgwYzEuMSwwLDIsMC45LDIsMnYyQzE1LDE4LjEsMTQuMSwxOSwxMywxOXoiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIxOCIgeTE9IjEzIiB4Mj0iMTgiIHkyPSIxOSIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIxIiB5MT0iMTMiIHgyPSIxOCIgeTI9IjE3Ii8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMjEiIHkxPSIxOSIgeDI9IjE5IiB5Mj0iMTYiLz4NCjwvc3ZnPg0K", - "name": "PanelSpriteButton", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg", - "shortDescription": "A button that can be customized.", - "version": "2.1.1", - "description": [ - "A button that can be used for menus and most labelled buttons of a game. The button can be customized with a background for each state and a label. It handles user interactions and a simple condition can be used to check if it is clicked.", - "", - "There are ready-to-use buttons in the asset-store [menu buttons pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=menu-buttons-menu-buttons)." - ], - "origin": { - "identifier": "PanelSpriteButton", - "name": "gdevelop-extension-store" - }, - "tags": [ - "button", - "ui" - ], - "authorIds": [ - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" - ], - "changelog": [ - { - "version": "2.0.0", - "breaking": "- Buttons now use \"variants\", allowing easy swapping of their visual aspect. You will have to make some adjustments to existing buttons in your project. Follow this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/) to do these changes." - } - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Check if the events are running for the editor.", - "fullName": "Editor is running", - "functionType": "Condition", - "name": "IsInGameEdition", - "private": true, - "sentence": "Events are running for the editor", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const game = runtimeScene.getGame();\r", - "eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ - { - "description": "The finite state machine used internally by the button object.", - "fullName": "Button finite state machine", - "name": "ButtonFSM", - "objectType": "", - "private": true, - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "PanelSpriteButton::IsInGameEdition" - }, - "parameters": [ - "", - "" - ] - } - ], - "actions": [], - "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": "StringVariable" - }, - "parameters": [ - "State", - "=", - "\"Validated\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "State", - "=", - "\"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": "SetBooleanVariable" - }, - "parameters": [ - "MouseIsInside", - "False", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "ShouldCheckHovering", - "True", - "" - ] - }, - { - "type": { - "value": "CollisionPoint" - }, - "parameters": [ - "Object", - "MouseOnlyCursorX(Object.Layer(), 0)", - "MouseOnlyCursorY(Object.Layer(), 0)" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "MouseIsInside", - "True", - "" - ] - } - ] - }, - { - "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": "SetBooleanVariable" - }, - "parameters": [ - "TouchIsInside", - "False", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "TouchId", - "!=", - "0" - ] - }, - { - "type": { - "value": "CollisionPoint" - }, - "parameters": [ - "Object", - "TouchX(TouchId, Object.Layer(), 0)", - "TouchY(TouchId, Object.Layer(), 0)" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "TouchIsInside", - "True", - "" - ] - } - ] - } - ], - "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": "SetNumberVariable" - }, - "parameters": [ - "Index", - "=", - "0" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "StartedTouchOrMouseCount()", - "conditions": [], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "CollisionPoint" - }, - "parameters": [ - "Object", - "TouchX(StartedTouchOrMouseId(Index), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Index), Object.Layer(), 0)" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TouchId", - "=", - "StartedTouchOrMouseId(Index)" - ] - }, - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "TouchIsInside", - "True", - "" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"Hovered\"" - ] - }, - { - "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"Idle\"" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "State", - "=", - "\"PressedInside\"" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Index", - "+", - "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": "BooleanVariable" - }, - "parameters": [ - "MouseIsInside", - "True", - "" - ] - }, - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "State", - "=", - "\"Hovered\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "State", - "=", - "\"Idle\"" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MouseIsInside", - "True", - "" - ] - }, - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "State", - "=", - "\"Idle\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "State", - "=", - "\"Hovered\"" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "TouchIsInside", - "True", - "" - ] - }, - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "State", - "=", - "\"PressedInside\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "State", - "=", - "\"PressedOutside\"" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "TouchIsInside", - "True", - "" - ] - }, - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "State", - "=", - "\"PressedOutside\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "State", - "=", - "\"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": [ - "", - "TouchId" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TouchId", - "=", - "0" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "State", - "=", - "\"PressedInside\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "State", - "=", - "\"Validated\"" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "StringVariable" - }, - "parameters": [ - "State", - "=", - "\"PressedInside\"" - ] - }, - { - "type": { - "inverted": true, - "value": "StringVariable" - }, - "parameters": [ - "State", - "=", - "\"Validated\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "State", - "=", - "\"Idle\"" - ] - } - ] - } - ] - } - ], - "parameters": [] - } - ], - "parameters": [] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteButton::ButtonFSM", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onDeActivate", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "PanelSpriteButton::ButtonFSM::ResetState" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteButton::ButtonFSM", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Reset the state of the button.", - "fullName": "Reset state", - "functionType": "Action", - "name": "ResetState", - "private": true, - "sentence": "Reset the button state of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "State", - "=", - "\"Idle\"" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TouchId", - "=", - "0" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteButton::ButtonFSM", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the button is not used.", - "fullName": "Is idle", - "functionType": "Condition", - "name": "IsIdle", - "sentence": "_PARAM0_ is idle", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "State", - "=", - "\"Idle\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteButton::ButtonFSM", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the button was just clicked.", - "fullName": "Is clicked", - "functionType": "Condition", - "name": "IsClicked", - "sentence": "_PARAM0_ is clicked", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "State", - "=", - "\"Validated\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteButton::ButtonFSM", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the cursor is hovered over the button.", - "fullName": "Is hovered", - "functionType": "Condition", - "name": "IsHovered", - "sentence": "_PARAM0_ is hovered", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "State", - "=", - "\"Hovered\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteButton::ButtonFSM", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the button is either hovered or pressed but not hovered.", - "fullName": "Is focused", - "functionType": "Condition", - "name": "IsFocused", - "sentence": "_PARAM0_ is focused", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "State", - "=", - "\"Hovered\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "State", - "=", - "\"PressedOutside\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteButton::ButtonFSM", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the button is currently being pressed with mouse or touch.", - "fullName": "Is pressed", - "functionType": "Condition", - "name": "IsPressed", - "sentence": "_PARAM0_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "State", - "=", - "\"PressedInside\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteButton::ButtonFSM", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the button is currently being pressed outside with mouse or touch.", - "fullName": "Is held outside", - "functionType": "Condition", - "name": "IsPressedOutside", - "sentence": "_PARAM0_ is held outside", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "State", - "=", - "\"PressedOutside\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteButton::ButtonFSM", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the touch id that is using the button or 0 if none.", - "fullName": "Touch id", - "functionType": "ExpressionAndCondition", - "name": "TouchId", - "sentence": "the touch id", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "TouchId" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteButton::ButtonFSM", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "true", - "type": "Boolean", - "label": "", - "description": "Should check hovering", - "hidden": true, - "name": "ShouldCheckHovering" - }, - { - "value": "Idle", - "type": "Choice", - "label": "State", - "choices": [ - { - "label": "Idle", - "value": "Idle" - }, - { - "label": "Hovered", - "value": "Hovered" - }, - { - "label": "PressedInside", - "value": "PressedInside" - }, - { - "label": "PressedOutside", - "value": "PressedOutside" - }, - { - "label": "Validated", - "value": "Validated" - } - ], - "hidden": true, - "name": "State" - }, - { - "value": "0", - "type": "Number", - "label": "Touch id", - "hidden": true, - "name": "TouchId" - }, - { - "value": "", - "type": "Boolean", - "label": "Touch is inside", - "hidden": true, - "name": "TouchIsInside" - }, - { - "value": "", - "type": "Boolean", - "label": "Mouse is inside", - "hidden": true, - "name": "MouseIsInside" - }, - { - "value": "", - "type": "Number", - "label": "", - "hidden": true, - "name": "Index" - } - ], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [ - { - "areaMaxX": 256, - "areaMaxY": 64, - "areaMaxZ": 64, - "areaMinX": 0, - "areaMinY": 0, - "areaMinZ": 0, - "defaultName": "Button", - "description": "A button that can be customized.", - "fullName": "Button (panel sprite)", - "isInnerAreaFollowingParentSize": true, - "isUsingLegacyInstancesRenderer": false, - "name": "PanelSpriteButton", - "objects": [ - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "Label", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 4, - "topEdgeAnchor": 4, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "useLegacyBottomAndRightAnchors": false - } - ], - "string": "Text", - "font": "", - "textAlignment": "center", - "characterSize": 20, - "color": { - "b": 0, - "g": 0, - "r": 0 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Text", - "font": "", - "textAlignment": "center", - "verticalTextAlignment": "center", - "characterSize": 20, - "lineHeight": 0, - "color": "0;0;0" - } - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Idle", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [ - { - "folded": true, - "name": "State", - "type": "string", - "value": "Idle" - } - ], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "ButtonFSM", - "type": "PanelSpriteButton::ButtonFSM", - "ShouldCheckHovering": true - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Hovered", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Pressed", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - } - ] - }, - { - "assetStoreId": "", - "name": "BitmapLabel", - "type": "BitmapText::BitmapTextObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 4, - "topEdgeAnchor": 4, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "text": "Text", - "opacity": 255, - "scale": 1, - "fontSize": 20, - "tint": "255;255;255", - "bitmapFontResourceName": "", - "textureAtlasResourceName": "", - "align": "center", - "verticalTextAlignment": "center" - } - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Label" - }, - { - "objectName": "BitmapLabel" - }, - { - "objectName": "Idle" - }, - { - "objectName": "Hovered" - }, - { - "objectName": "Pressed" - } - ] - }, - "objectsGroups": [ - { - "name": "Background", - "objects": [ - { - "name": "Idle" - }, - { - "name": "Hovered" - }, - { - "name": "Pressed" - } - ] - }, - { - "name": "Labels", - "objects": [ - { - "name": "Label" - }, - { - "name": "BitmapLabel" - } - ] - } - ], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [ - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 64, - "layer": "", - "name": "Idle", - "persistentUuid": "24882334-eec8-403e-8bf1-70fc928a46e6", - "width": 256, - "x": 0, - "y": 0, - "zOrder": 1, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 64, - "layer": "", - "name": "Label", - "persistentUuid": "3b29c95c-5363-4e25-bf47-eecf13e8a226", - "width": 256, - "x": 0, - "y": 32, - "zOrder": 2, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "editionSettings": {}, - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Create one background instance for of each state.\nOnly the instance for the current state is shown." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "Hovered", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "Pressed", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "ResizableCapability::ResizableBehavior::SetSize" - }, - "parameters": [ - "Hovered", - "Resizable", - "Idle.Width()", - "Idle.Height()" - ] - }, - { - "type": { - "value": "ResizableCapability::ResizableBehavior::SetSize" - }, - "parameters": [ - "Pressed", - "Resizable", - "Idle.Width()", - "Idle.Height()" - ] - }, - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Hovered" - ] - }, - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Pressed" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Hovered", - "=", - "1" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Pressed", - "=", - "1" - ] - }, - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "Labels", - "Text", - "=", - "LabelText" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [ - { - "name": "Background", - "objects": [ - { - "name": "Idle" - }, - { - "name": "Hovered" - }, - { - "name": "Pressed" - } - ] - } - ] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onHotReloading", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::IsPressed" - }, - "parameters": [ - "Object", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" - }, - "parameters": [ - "Object", - "=", - "PressedLabelOffsetY", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "Labels", - "Text", - "=", - "LabelText" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Apply states", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Show the right background accordingly to the new state." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::IsIdle" - }, - "parameters": [ - "Object", - "ButtonFSM" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" - }, - "parameters": [ - "Object", - "=", - "0", - "" - ] - }, - { - "type": { - "value": "Montre" - }, - "parameters": [ - "Idle", - "" - ] - }, - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Pressed" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Visible" - }, - "parameters": [ - "Hovered" - ] - }, - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "HoveredFadeOutDuration", - ">", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "Tween::TweenBehavior::AddObjectOpacityTween2" - }, - "parameters": [ - "Hovered", - "Tween", - "\"Fadeout\"", - "0", - "\"linear\"", - "HoveredFadeOutDuration", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "HoveredFadeOutDuration", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Hovered" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "OpacityCapability::OpacityBehavior::Value" - }, - "parameters": [ - "Hovered", - "Opacity", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Hovered" - ] - }, - { - "type": { - "value": "OpacityCapability::OpacityBehavior::SetValue" - }, - "parameters": [ - "Hovered", - "Opacity", - "=", - "255" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::IsHovered" - }, - "parameters": [ - "Object", - "ButtonFSM" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" - }, - "parameters": [ - "Object", - "=", - "0", - "" - ] - }, - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Idle" - ] - }, - { - "type": { - "value": "Montre" - }, - "parameters": [ - "Hovered", - "" - ] - }, - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Pressed" - ] - }, - { - "type": { - "value": "Tween::RemoveTween" - }, - "parameters": [ - "Hovered", - "Tween", - "\"Fadeout\"" - ] - }, - { - "type": { - "value": "OpacityCapability::OpacityBehavior::SetValue" - }, - "parameters": [ - "Hovered", - "Opacity", - "=", - "255" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::IsPressed" - }, - "parameters": [ - "Object", - "ButtonFSM" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" - }, - "parameters": [ - "Object", - "=", - "PressedLabelOffsetY", - "" - ] - }, - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Idle" - ] - }, - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Hovered" - ] - }, - { - "type": { - "value": "Montre" - }, - "parameters": [ - "Pressed", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::IsFocused" - }, - "parameters": [ - "Object", - "ButtonFSM" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" - }, - "parameters": [ - "Object", - "=", - "0", - "" - ] - }, - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Idle" - ] - }, - { - "type": { - "value": "Montre" - }, - "parameters": [ - "Hovered", - "" - ] - }, - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Pressed" - ] - } - ] - } - ], - "parameters": [] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the button is not used.", - "fullName": "Is idle", - "functionType": "Condition", - "name": "IsIdle", - "sentence": "_PARAM0_ is idle", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteButton::ButtonFSM::IsIdle" - }, - "parameters": [ - "Idle", - "ButtonFSM", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the button was just clicked.", - "fullName": "Is clicked", - "functionType": "Condition", - "name": "IsClicked", - "sentence": "_PARAM0_ is clicked", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteButton::ButtonFSM::IsClicked" - }, - "parameters": [ - "Idle", - "ButtonFSM", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the cursor is hovered over the button.", - "fullName": "Is hovered", - "functionType": "Condition", - "name": "IsHovered", - "sentence": "_PARAM0_ is hovered", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteButton::ButtonFSM::IsHovered" - }, - "parameters": [ - "Idle", - "ButtonFSM", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the button is either hovered or pressed but not hovered.", - "fullName": "Is focused", - "functionType": "Condition", - "name": "IsFocused", - "sentence": "_PARAM0_ is focused", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteButton::ButtonFSM::IsFocused" - }, - "parameters": [ - "Idle", - "ButtonFSM", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the button is currently being pressed with mouse or touch.", - "fullName": "Is pressed", - "functionType": "Condition", - "name": "IsPressed", - "sentence": "_PARAM0_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteButton::ButtonFSM::IsPressed" - }, - "parameters": [ - "Idle", - "ButtonFSM", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Change the text of the button label.", - "fullName": "Label text", - "functionType": "Action", - "name": "SetLabelText", - "private": true, - "sentence": "Change the text of _PARAM0_ to _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "Labels", - "Text", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - }, - { - "description": "Text", - "name": "Value", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "LabelText", - "name": "SetLabelTextOp", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "Labels", - "Text", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the label text.", - "fullName": "Label text", - "functionType": "ExpressionAndCondition", - "name": "LabelText", - "sentence": "the label text", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "Labels.Text::Value()" - ] - } - ] - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "De/activate interactions with the button.", - "fullName": "De/activate interactions", - "functionType": "Action", - "name": "Activate", - "sentence": "Activate interactions with _PARAM0_: _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "ShouldActivate", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Idle", - "ButtonFSM", - "yes" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "ShouldActivate", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Idle", - "ButtonFSM", - "no" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - }, - { - "description": "Activate", - "name": "ShouldActivate", - "type": "yesorno" - } - ], - "objectGroups": [] - }, - { - "description": "Check if interactions are activated on the button.", - "fullName": "Interactions activated", - "functionType": "Condition", - "name": "IsActivated", - "sentence": "Interactions on _PARAM0_ are activated", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BehaviorActivated" - }, - "parameters": [ - "Idle", - "ButtonFSM" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the labelOffset of the object.", - "fullName": "LabelOffset", - "functionType": "ExpressionAndCondition", - "name": "LabelOffset", - "private": true, - "sentence": "the labelOffset", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "LabelOffset" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "LabelOffset", - "name": "SetLabelOffset", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetCenterY" - }, - "parameters": [ - "Labels", - "+", - "Value - LabelOffset" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "LabelOffset", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "MultilineString", - "label": "Label", - "name": "LabelText" - }, - { - "value": "0.25", - "type": "Number", - "unit": "Second", - "label": "Hovered fade out duration", - "group": "States", - "name": "HoveredFadeOutDuration" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Label offset on Y axis when pressed", - "group": "States", - "name": "PressedLabelOffsetY" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "", - "hidden": true, - "name": "LabelOffset" - }, - { - "value": "", - "type": "Choice", - "label": "", - "choices": [ - { - "label": "Label.Text=LabelText", - "value": "Label.Text=LabelText" - }, - { - "label": "BitmapLabel.Text=LabelText", - "value": "BitmapLabel.Text=LabelText" - } - ], - "hidden": true, - "name": "_PropertyMapping" - } - ], - "variants": [ - { - "areaMaxX": 256, - "areaMaxY": 106, - "areaMaxZ": 64, - "areaMinX": 0, - "areaMinY": 0, - "areaMinZ": 0, - "name": "Yellow button 2", - "objects": [ - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "Label", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 4, - "topEdgeAnchor": 4, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "useLegacyBottomAndRightAnchors": false - } - ], - "string": "Button", - "font": "Chango-Regular.ttf", - "textAlignment": "center", - "characterSize": 40, - "color": { - "b": 42, - "g": 87, - "r": 139 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Button", - "font": "Chango-Regular.ttf", - "textAlignment": "center", - "verticalTextAlignment": "center", - "characterSize": 40, - "lineHeight": 0, - "color": "139;87;42" - } - }, - { - "assetStoreId": "", - "bottomMargin": 32, - "height": 106, - "leftMargin": 16, - "name": "Idle", - "rightMargin": 16, - "texture": "Yellow Button_Idle.png", - "tiled": false, - "topMargin": 16, - "type": "PanelSpriteObject::PanelSprite", - "width": 256, - "variables": [ - { - "folded": true, - "name": "State", - "type": "string", - "value": "Idle" - } - ], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "ButtonFSM", - "type": "PanelSpriteButton::ButtonFSM", - "ShouldCheckHovering": true - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 32, - "height": 106, - "leftMargin": 16, - "name": "Hovered", - "rightMargin": 16, - "texture": "Yellow Button_Hovered.png", - "tiled": false, - "topMargin": 16, - "type": "PanelSpriteObject::PanelSprite", - "width": 256, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 16, - "height": 106, - "leftMargin": 16, - "name": "Pressed", - "rightMargin": 16, - "texture": "Yellow Button_Pressed.png", - "tiled": false, - "topMargin": 32, - "type": "PanelSpriteObject::PanelSprite", - "width": 256, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Label" - }, - { - "objectName": "Idle" - }, - { - "objectName": "Hovered" - }, - { - "objectName": "Pressed" - } - ] - }, - "objectsGroups": [ - { - "name": "Background", - "objects": [ - { - "name": "Idle" - }, - { - "name": "Hovered" - }, - { - "name": "Pressed" - } - ] - } - ], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [ - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 106, - "layer": "", - "name": "Idle", - "persistentUuid": "24882334-eec8-403e-8bf1-70fc928a46e6", - "width": 256, - "x": 0, - "y": 0, - "zOrder": 1, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 81, - "layer": "", - "name": "Label", - "persistentUuid": "3b29c95c-5363-4e25-bf47-eecf13e8a226", - "width": 240, - "x": 8, - "y": 48, - "zOrder": 2, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "editionSettings": {} - }, - { - "areaMaxX": 256, - "areaMaxY": 128, - "areaMaxZ": 64, - "areaMinX": 0, - "areaMinY": 0, - "areaMinZ": 0, - "assetStoreAssetId": "72c8adcfb9187ebb5fcfbcd75bc18c74d6af5507e7c482cadcfad28f8011b387", - "assetStoreOriginalName": "Orange Bubble Button", - "name": "Orange Bubble Button", - "objects": [ - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "Label", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - } - ], - "string": "Button", - "font": "Poppins-Medium.ttf", - "textAlignment": "center", - "characterSize": 60, - "color": { - "b": 0, - "g": 42, - "r": 117 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Button", - "font": "Poppins-Medium.ttf", - "textAlignment": "center", - "verticalTextAlignment": "center", - "characterSize": 60, - "lineHeight": 0, - "color": "117;42;0" - } - }, - { - "assetStoreId": "", - "bottomMargin": 35, - "height": 128, - "leftMargin": 56, - "name": "Idle", - "rightMargin": 35, - "texture": "Orange Bubble Button_Idle.png", - "tiled": false, - "topMargin": 35, - "type": "PanelSpriteObject::PanelSprite", - "width": 256, - "variables": [ - { - "folded": true, - "name": "State", - "type": "string", - "value": "Idle" - } - ], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "ButtonFSM", - "type": "PanelSpriteButton::ButtonFSM", - "serializedBehavior": { - "name": "ButtonFSM", - "type": "PanelSpriteButton::ButtonFSM", - "ShouldCheckHovering": true - } - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 35, - "height": 128, - "leftMargin": 56, - "name": "Hovered", - "rightMargin": 35, - "texture": "Orange Bubble Button_Hovered.png", - "tiled": false, - "topMargin": 35, - "type": "PanelSpriteObject::PanelSprite", - "width": 256, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "Tween", - "type": "Tween::TweenBehavior", - "serializedBehavior": { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 35, - "height": 128, - "leftMargin": 35, - "name": "Pressed", - "rightMargin": 35, - "texture": "Orange Bubble Button_Pressed.png", - "tiled": false, - "topMargin": 35, - "type": "PanelSpriteObject::PanelSprite", - "width": 256, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Label" - }, - { - "objectName": "Idle" - }, - { - "objectName": "Hovered" - }, - { - "objectName": "Pressed" - } - ] - }, - "objectsGroups": [ - { - "name": "Background", - "objects": [ - { - "name": "Idle" - }, - { - "name": "Hovered" - }, - { - "name": "Pressed" - } - ] - } - ], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [ - { - "angle": 0, - "customSize": false, - "depth": 1, - "height": 64, - "layer": "", - "name": "Idle", - "persistentUuid": "24882334-eec8-403e-8bf1-70fc928a46e6", - "width": 64, - "x": 0, - "y": 0, - "zOrder": 1, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 110, - "keepRatio": true, - "layer": "", - "name": "Label", - "persistentUuid": "8aabdbe2-ad4d-4746-839b-9f769bc07c5e", - "width": 238, - "x": 9, - "y": 64, - "zOrder": 2, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "editionSettings": {} - }, - { - "areaMaxX": 256, - "areaMaxY": 106, - "areaMaxZ": 64, - "areaMinX": 0, - "areaMinY": 0, - "areaMinZ": 0, - "assetStoreAssetId": "615de0316452630b9f4f6a39decc82e2449b82c1afd1ff24d6470dad2922177b", - "assetStoreOriginalName": "Yellow button", - "name": "Yellow button", - "objects": [ - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "Label", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 4, - "topEdgeAnchor": 4, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "useLegacyBottomAndRightAnchors": false - } - ], - "string": "Button", - "font": "", - "textAlignment": "center", - "characterSize": 60, - "color": { - "b": 42, - "g": 87, - "r": 139 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Button", - "font": "", - "textAlignment": "center", - "verticalTextAlignment": "center", - "characterSize": 60, - "lineHeight": 0, - "color": "139;87;42" - } - }, - { - "assetStoreId": "", - "bottomMargin": 32, - "height": 106, - "leftMargin": 16, - "name": "Idle", - "rightMargin": 16, - "texture": "Yellow Button_Idle.png", - "tiled": false, - "topMargin": 16, - "type": "PanelSpriteObject::PanelSprite", - "width": 256, - "variables": [ - { - "folded": true, - "name": "State", - "type": "string", - "value": "Idle" - } - ], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "ButtonFSM", - "type": "PanelSpriteButton::ButtonFSM", - "ShouldCheckHovering": true - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 32, - "height": 106, - "leftMargin": 16, - "name": "Hovered", - "rightMargin": 16, - "texture": "Yellow Button_Hovered.png", - "tiled": false, - "topMargin": 16, - "type": "PanelSpriteObject::PanelSprite", - "width": 256, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 16, - "height": 106, - "leftMargin": 16, - "name": "Pressed", - "rightMargin": 16, - "texture": "Yellow Button_Pressed.png", - "tiled": false, - "topMargin": 32, - "type": "PanelSpriteObject::PanelSprite", - "width": 256, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Label" - }, - { - "objectName": "Idle" - }, - { - "objectName": "Hovered" - }, - { - "objectName": "Pressed" - } - ] - }, - "objectsGroups": [ - { - "name": "Background", - "objects": [ - { - "name": "Idle" - }, - { - "name": "Hovered" - }, - { - "name": "Pressed" - } - ] - } - ], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [ - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 106, - "layer": "", - "name": "Idle", - "persistentUuid": "24882334-eec8-403e-8bf1-70fc928a46e6", - "width": 256, - "x": 0, - "y": 0, - "zOrder": 1, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 81, - "layer": "", - "name": "Label", - "persistentUuid": "3b29c95c-5363-4e25-bf47-eecf13e8a226", - "width": 240, - "x": 8, - "y": 48, - "zOrder": 2, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "editionSettings": {} - } - ] - } - ] - }, - { - "author": "D8H", - "category": "Movement", - "extensionNamespace": "", - "fullName": "Stick objects to others", - "gdevelopVersion": ">=5.5.222", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXN0aWNrZXItb3V0bGluZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik01LjUgMkMzLjYgMiAyIDMuNiAyIDUuNVYxOC41QzIgMjAuNCAzLjYgMjIgNS41IDIySDE2TDIyIDE2VjUuNUMyMiAzLjYgMjAuNCAyIDE4LjUgMkg1LjVNNS44IDRIMTguM0MxOS4zIDQgMjAuMSA0LjggMjAuMSA1LjhWMTVIMTguNkMxNi43IDE1IDE1LjEgMTYuNiAxNS4xIDE4LjVWMjBINS44QzQuOCAyMCA0IDE5LjIgNCAxOC4yVjUuOEM0IDQuOCA0LjggNCA1LjggNCIgLz48L3N2Zz4=", - "name": "Sticker", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/sticker-outline.svg", - "shortDescription": "Make objects follow the position and rotation of the object they are stuck to.", - "version": "0.5.4", - "description": [ - "This extension can be useful to:", - "- Stick accessories to moving objects", - "- Animate a skeleton", - "- Delete an object with another one", - "", - "An example allows to check it out ([open the project online](https://editor.gdevelop.io/?project=example://stick-objects))." - ], - "origin": { - "identifier": "Sticker", - "name": "gdevelop-extension-store" - }, - "tags": [ - "sticker", - "stick", - "follow", - "skeleton", - "joint", - "pin", - "bind", - "glue", - "tie", - "attach", - "hold", - "paste", - "wear" - ], - "authorIds": [ - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Define helper classes JavaScript code.", - "fullName": "Define helper classes", - "functionType": "Action", - "name": "DefineHelperClasses", - "private": true, - "sentence": "Define helper classes JavaScript code", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "if (gdjs._stickerExtension) {", - " return;", - "}", - "", - "// Unstick from deleted objects.", - "gdjs.registerObjectDeletedFromSceneCallback(function (runtimeScene, deletedObject) {", - " const extension = runtimeScene._stickerExtension;", - " if (!extension) {", - " return;", - " }", - " /** @type {Set} */", - " const allStickers = runtimeScene._stickerExtension.allStickers;", - " for (const behavior of allStickers) {", - " /** @type {Sticker} */", - " const sticker = behavior._sticker;", - " if (sticker.isStuckTo(deletedObject)) {", - " if (behavior._getIsDestroyedWithParent()) {", - " behavior.owner.deleteFromScene(runtimeScene);", - " }", - " sticker.unstick();", - " }", - " }", - "});", - "", - "class Sticker {", - " /** @type {gdjs.RuntimeBehavior} */", - " behavior;", - " /** @type {gdjs.RuntimeObject | null} */", - " basisObject;", - " followingDoneThisFrame = false;", - " relativeX = 0;", - " relativeY = 0;", - " relativeAngle = 0;", - " relativeRotatedX = 0;", - " relativeRotatedY = 0;", - " basisOldX = 0;", - " basisOldY = 0;", - " basisOldAngle = 0;", - " basisOldWidth = 0;", - " basisOldHeight = 0;", - " basisOldCenterXInScene = 0;", - " basisOldCenterYInScene = 0;", - "", - " /**", - " * @param {gdjs.RuntimeBehavior} behavior", - " */", - " constructor(behavior) {", - " this.behavior = behavior;", - " }", - "", - " /**", - " * @param {gdjs.RuntimeObject} basisObject", - " */", - " isStuckTo(basisObject) {", - " return this.basisObject === basisObject;", - " }", - "", - " /**", - " * @param {gdjs.RuntimeObject} basisObject", - " */", - " stickTo(basisObject) {", - " this.basisObject = basisObject;", - " this.updateOldCoordinates();", - " this.updateRelativeCoordinates();", - " }", - "", - " unstick() {", - " this.basisObject = null;", - " }", - "", - " onStepPreEvents() {", - " this.followingDoneThisFrame = false;", - " }", - "", - " /**", - " * Update the coordinates in the basisObject basis.", - " * ", - " * It uses the basisObject coordinates from the previous frame.", - " * This way, the sticker can move relatively to it and still", - " * follow basisObject.", - " * ", - " * @param {gdjs.RuntimeObject} basisObject", - " */", - " updateRelativeCoordinates() {", - " const object = this.behavior.owner;", - "", - " // Update relative coordinates", - " this.relativeX = object.getX() - this.basisOldX;", - " this.relativeY = object.getY() - this.basisOldY;", - " if (!this.behavior._getOnlyFollowPosition()) {", - " this.relativeAngle = object.getAngle() - this.basisOldAngle;", - " this.relativeWidth = object.getWidth() / this.basisOldWidth;", - " this.relativeHeight = object.getHeight() / this.basisOldHeight;", - " const deltaX = object.getCenterXInScene() - this.basisOldCenterXInScene;", - " const deltaY = object.getCenterYInScene() - this.basisOldCenterYInScene;", - " const angle = this.basisOldAngle * Math.PI / 180;", - " const cosA = Math.cos(angle);", - " const sinA = Math.sin(angle);", - " this.relativeRotatedX = (deltaX * cosA + deltaY * sinA) / this.basisOldWidth;", - " this.relativeRotatedY = (-deltaX * sinA + deltaY * cosA) / this.basisOldHeight;", - "", - " // Save initial values to avoid calculus and rounding errors", - " this.basisOriginalWidth = this.basisObject.getWidth();", - " this.basisOriginalHeight = this.basisObject.getHeight();", - " this.basisOriginalAngle = this.basisObject.getAngle();", - " }", - " }", - "", - " /**", - " * Copy the coordinates to use it the next frame.", - " */", - " updateOldCoordinates() {", - " const object = this.behavior.owner;", - "", - " this.ownerOldX = object.getX();", - " this.ownerOldY = object.getY();", - "", - " this.basisOldX = this.basisObject.getX();", - " this.basisOldY = this.basisObject.getY();", - "", - " if (!this.behavior._getOnlyFollowPosition()) {", - " this.ownerOldAngle = object.getAngle();", - " this.ownerOldWidth = object.getWidth();", - " this.ownerOldHeight = object.getHeight();", - "", - " this.basisOldAngle = this.basisObject.getAngle();", - " this.basisOldWidth = this.basisObject.getWidth();", - " this.basisOldHeight = this.basisObject.getHeight();", - " this.basisOldCenterXInScene = this.basisObject.getCenterXInScene();", - " this.basisOldCenterYInScene = this.basisObject.getCenterYInScene();", - " }", - " }", - "", - " /**", - " * Follow the basisObject (called in doStepPostEvents).", - " * ", - " * This method is also called by children to ensure", - " * parents are updated first.", - " */", - " followBasisObject() {", - " if (this.followingDoneThisFrame) {", - " return;", - " }", - " this.followingDoneThisFrame = true;", - " const basisObject = this.basisObject;", - " if (!basisObject) {", - " return;", - " }", - " // If the behavior on the basis object has a different name,", - " // the objects will still follow their basis objects", - " // but frame delays could happen.", - " const behaviorName = this.behavior.getName();", - " if (basisObject.hasBehavior(behaviorName)) {", - " const basisBehavior = basisObject.getBehavior(behaviorName);", - " if (basisBehavior.type === this.behavior.type) {", - " // Follow parents 1st to avoid frame delays", - " basisBehavior._sticker.followBasisObject();", - " }", - " }", - " if (this.behavior._getOnlyFollowPosition()) {", - " this.followPosition();", - " } else {", - " this.followTransformation();", - " }", - " this.updateOldCoordinates();", - " }", - "", - " followPosition() {", - " const object = this.behavior.owner;", - " const basisObject = this.basisObject;", - " if (!basisObject) {", - " return;", - " }", - " if (object.getX() !== this.ownerOldX", - " || object.getY() !== this.ownerOldY) {", - " this.updateRelativeCoordinates();", - " }", - " if (this.basisOldX !== basisObject.getX()", - " || this.basisOldY !== basisObject.getY()) {", - " object.setPosition(", - " basisObject.getX() + this.relativeX,", - " basisObject.getY() + this.relativeY);", - " }", - " }", - "", - " followTransformation() {", - " const object = this.behavior.owner;", - " const basisObject = this.basisObject;", - " if (!basisObject) {", - " return;", - " }", - " if (object.getX() !== this.ownerOldX", - " || object.getY() !== this.ownerOldY", - " || object.getAngle() !== this.ownerOldAngle", - " || object.getWidth() !== this.ownerOldWidth", - " || object.getHeight() !== this.ownerOldHeight) {", - " this.updateRelativeCoordinates();", - " }", - " if (this.basisOldAngle !== this.basisObject.getAngle()", - " || this.basisOldWidth !== this.basisObject.getWidth()", - " || this.basisOldHeight !== this.basisObject.getHeight()", - " || this.basisOldCenterXInScene !== this.basisObject.getCenterXInScene()", - " || this.basisOldCenterYInScene !== this.basisObject.getCenterYInScene()) {", - " // 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());", - " }", - " // Follow basisObject", - " if (basisObject.getAngle() === this.basisOriginalAngle", - " && this.basisOriginalAngle === 0) {", - " if (basisObject.getWidth() === this.basisOriginalWidth", - " || basisObject.getHeight() === this.basisOriginalHeight) {", - " if (this.basisOldX !== basisObject.getX() ||", - " this.basisOldY !== basisObject.getY()) {", - " object.setPosition(", - " basisObject.getX() + this.relativeX,", - " basisObject.getY() + this.relativeY);", - " }", - " } else {", - " object.setCenterPositionInScene(", - " basisObject.getCenterXInScene() + this.relativeRotatedX * basisObject.getWidth(),", - " basisObject.getCenterYInScene() + this.relativeRotatedY * basisObject.getHeight());", - " }", - " } else {", - " object.setAngle(basisObject.getAngle() + this.relativeAngle);", - "", - " const deltaX = this.relativeRotatedX * basisObject.getWidth();", - " const deltaY = this.relativeRotatedY * basisObject.getHeight();", - " const angle = -basisObject.getAngle() * Math.PI / 180;", - " const cosA = Math.cos(angle);", - " const sinA = Math.sin(angle);", - " object.setX(", - " basisObject.getCenterXInScene() + object.getX() - object.getCenterXInScene()", - " + deltaX * cosA + deltaY * sinA);", - " object.setY(", - " basisObject.getCenterYInScene() + object.getY() - object.getCenterYInScene()", - " - deltaX * sinA + deltaY * cosA);", - " }", - " }", - " }", - "}", - "", - "gdjs._stickerExtension = {", - " Sticker", - "}" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Check if the object is stuck to another object.", - "fullName": "Is stuck to another object", - "functionType": "Condition", - "name": "IsStuck", - "sentence": "_PARAM1_ is stuck to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const stickerBehaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "/** @type {Hashtable} */", - "const stickerObjectsLists = eventsFunctionContext.getObjectsLists(\"Object\");", - "/** @type {Hashtable} */", - "const basisObjectsLists = eventsFunctionContext.getObjectsLists(\"BasisObject\");", - "", - "eventsFunctionContext.returnValue = gdjs.evtTools.object.twoListsTest(", - " (stickerObject, basisObject) => {", - " const sticker = stickerObject.getBehavior(stickerBehaviorName)._sticker;", - " return sticker.isStuckTo(basisObject);", - " },", - " stickerObjectsLists,", - " basisObjectsLists,", - " false", - ");" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "Sticker", - "name": "Object", - "type": "objectList" - }, - { - "description": "Sticker behavior", - "name": "Behavior", - "supplementaryInformation": "Sticker::Sticker", - "type": "behavior" - }, - { - "description": "Basis", - "name": "BasisObject", - "type": "objectList" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ - { - "description": "Stick the object to another. Use the action to stick the object, or unstick it later.", - "fullName": "Sticker", - "name": "Sticker", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Sticker::DefineHelperClasses" - }, - "parameters": [ - "", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const Sticker = gdjs._stickerExtension.Sticker;", - "", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const object = objects[0];", - "const behavior = object.getBehavior(behaviorName);", - "", - "behavior._sticker = new Sticker(behavior);", - "", - "// Set up the scene sticker objects list - if not done already.", - "runtimeScene._stickerExtension = runtimeScene._stickerExtension || {", - " allStickers: new Set(),", - "};", - "// Register this object as a sticker.", - "/** @type {Set} */", - "const allStickers = runtimeScene._stickerExtension.allStickers;", - "allStickers.add(behavior);", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Sticker::Sticker", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const object = objects[0];", - "const behavior = object.getBehavior(behaviorName);", - "", - "behavior._sticker.onStepPreEvents();" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Sticker::Sticker", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const object = objects[0];", - "const behavior = object.getBehavior(behaviorName);", - "", - "behavior._sticker.followBasisObject();" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Sticker::Sticker", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Stick on another object.", - "fullName": "Stick", - "functionType": "Action", - "name": "Stick", - "sentence": "Stick _PARAM0_ to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const basisObjects = eventsFunctionContext.getObjects(\"BasisObject\");", - "", - "if (basisObjects.length === 0) return;", - "// An object can stick to only one object.", - "const basisObject = basisObjects[0];", - "object.getBehavior(behaviorName)._sticker.stickTo(basisObject);", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Sticker::Sticker", - "type": "behavior" - }, - { - "description": "Object to stick to", - "name": "BasisObject", - "type": "objectList" - } - ], - "objectGroups": [] - }, - { - "description": "Unstick from the object it was stuck to.", - "fullName": "Unstick", - "functionType": "Action", - "name": "Unstick", - "sentence": "Unstick _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const behavior = object.getBehavior(behaviorName);", - "", - "object.getBehavior(behaviorName)._sticker.unstick();", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Sticker::Sticker", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onDestroy", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const object = objects[0];", - "const behavior = object.getBehavior(behaviorName);", - "", - "/** @type {Set} */", - "const allStickers = runtimeScene._stickerExtension.allStickers;", - "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", - "name": "OnlyFollowPosition" - }, - { - "value": "", - "type": "Boolean", - "label": "Destroy when the object it's stuck on is destroyed", - "name": "IsDestroyedWithParent" - } - ], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "Tristan Rhodes (tristan@victrisgames.com), Entropy", - "category": "Movement", - "extensionNamespace": "", - "fullName": "Screen wrap", - "gdevelopVersion": ">=5.5.222", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLW1vbml0b3Itc2NyZWVuc2hvdCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik05LDZINVYxMEg3VjhIOU0xOSwxMEgxN1YxMkgxNVYxNEgxOU0yMSwxNkgzVjRIMjFNMjEsMkgzQzEuODksMiAxLDIuODkgMSw0VjE2QTIsMiAwIDAsMCAzLDE4SDEwVjIwSDhWMjJIMTZWMjBIMTRWMThIMjFBMiwyIDAgMCwwIDIzLDE2VjRDMjMsMi44OSAyMi4xLDIgMjEsMiIgLz48L3N2Zz4=", - "name": "ScreenWrap", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/monitor-screenshot.svg", - "shortDescription": "Teleport object when it moves off the screen and immediately appear on the opposite side while maintaining speed and trajectory.", - "version": "0.3.2", - "description": [ - "The teleport happens when the center point of the object crosses a border (this can be adjusted with an offset).", - "By default, the borders of the wrapping area match the screen size, but they can also be changed.", - "", - "The Asteroid-like example uses this extension ([open the project online](https://editor.gdevelop.io/?project=example://space-asteroids))." - ], - "origin": { - "identifier": "ScreenWrap", - "name": "gdevelop-extension-store" - }, - "tags": [ - "screen", - "wrap", - "teleport", - "asteroids" - ], - "authorIds": [ - "q8ubdigLvIRXLxsJDDTaokO41mc2", - "gqDaZjCfevOOxBYkK6zlhtZnXCg1", - "1OgYzWp5UeVPbiWGJwI6vqfgZLC3" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [], - "eventsBasedBehaviors": [ - { - "description": "Teleport the object when leaving one side of the screen so that it immediately reappears on the opposite side, maintaining speed and trajectory.", - "fullName": "Screen Wrap", - "name": "ScreenWrap", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Initialize variables (if needed)", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "BorderBottom", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrap::SetBottomBorder" - }, - "parameters": [ - "Object", - "Behavior", - "SceneWindowHeight()", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "BorderRight", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrap::SetRightBorder" - }, - "parameters": [ - "Object", - "Behavior", - "SceneWindowWidth()", - "" - ] - } - ] - } - ], - "parameters": [] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "colorB": 5, - "colorG": 117, - "colorR": 65, - "creationTime": 0, - "name": "ScreenWrap", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Move object to opposite side (if needed)", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [], - "parameters": [] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "HorizontalWrapping", - "True", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PosX" - }, - "parameters": [ - "Object", - "<", - "BorderLeft - (Object.Width()/2) - TriggerOffset" - ] - } - ], - "actions": [ - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Object", - "=", - "BorderRight - (Object.Width()/2) + TriggerOffset" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PosX" - }, - "parameters": [ - "Object", - ">", - "BorderRight - (Object.Width()/2) + TriggerOffset" - ] - } - ], - "actions": [ - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Object", - "=", - "BorderLeft - (Object.Width()/2) - TriggerOffset" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "VerticalWrapping", - "True", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PosY" - }, - "parameters": [ - "Object", - "<", - "BorderTop - (Object.Height()/2) - TriggerOffset" - ] - } - ], - "actions": [ - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Object", - "=", - "BorderBottom - (Object.Height()/2) + TriggerOffset" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PosY" - }, - "parameters": [ - "Object", - ">", - "BorderBottom - (Object.Height()/2) + TriggerOffset" - ] - } - ], - "actions": [ - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Object", - "=", - "BorderTop - (Object.Height()/2) - TriggerOffset" - ] - } - ] - } - ] - } - ], - "parameters": [] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the object is wrapping on the left and right borders.", - "fullName": "Is horizontal wrapping", - "functionType": "Condition", - "name": "IsHorizontalWrapping", - "sentence": "_PARAM0_ is horizontal wrapping", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "HorizontalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "HorizontalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the object is wrapping on the top and bottom borders.", - "fullName": "Is vertical wrapping", - "functionType": "Condition", - "name": "IsVerticalWrapping", - "sentence": "_PARAM0_ is vertical wrapping", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "VerticalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "VerticalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Enable wrapping on the left and right borders.", - "fullName": "Enable horizontal wrapping", - "functionType": "Action", - "name": "EnableHorizontalWrapping", - "sentence": "Enable _PARAM0_ horizontal wrapping: _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "EnableHorizontalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "HorizontalWrapping", - "False", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "EnableHorizontalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "HorizontalWrapping", - "True", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - }, - { - "description": "Value", - "name": "EnableHorizontalWrapping", - "type": "yesorno" - } - ], - "objectGroups": [] - }, - { - "description": "Enable wrapping on the top and bottom borders.", - "fullName": "Enable vertical wrapping", - "functionType": "Action", - "name": "EnableVerticalWrapping", - "sentence": "Enable _PARAM0_ vertical wrapping: _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "EnableVerticalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "VerticalWrapping", - "False", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "EnableVerticalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "VerticalWrapping", - "True", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - }, - { - "description": "Value", - "name": "EnableVerticalWrapping", - "type": "yesorno" - } - ], - "objectGroups": [] - }, - { - "description": "Top border (Y position).", - "fullName": "Top border", - "functionType": "Expression", - "name": "BorderTop", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "BorderTop" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Left border (X position).", - "fullName": "Left border", - "functionType": "Expression", - "name": "BorderLeft", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "BorderLeft" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Right border (X position).", - "fullName": "Right border", - "functionType": "Expression", - "name": "BorderRight", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "BorderRight" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Bottom border (Y position).", - "fullName": "Bottom border", - "functionType": "Expression", - "name": "BorderBottom", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "BorderBottom" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Number of pixels past the center where the object teleports and appears.", - "fullName": "Trigger offset", - "functionType": "Expression", - "name": "TriggerOffset", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "TriggerOffset" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Set top border (Y position).", - "fullName": "Set top border", - "functionType": "Action", - "name": "SetTopBorder", - "sentence": "Set _PARAM0_ top border to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "BorderTop", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - }, - { - "description": "Top border value", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Set left border (X position).", - "fullName": "Set left border", - "functionType": "Action", - "name": "SetLeftBorder", - "sentence": "Set _PARAM0_ left border to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "BorderLeft", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - }, - { - "description": "Left border value", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Set bottom border (Y position).", - "fullName": "Set bottom border", - "functionType": "Action", - "name": "SetBottomBorder", - "sentence": "Set _PARAM0_ bottom border to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "BorderBottom", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - }, - { - "description": "Bottom border value", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Set right border (X position).", - "fullName": "Set right border", - "functionType": "Action", - "name": "SetRightBorder", - "sentence": "Set _PARAM0_ right border to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "BorderRight", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - }, - { - "description": "Right border value", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Set trigger offset (pixels).", - "fullName": "Set trigger offset", - "functionType": "Action", - "name": "SetTriggerOffset", - "sentence": "Set _PARAM0_ trigger offset to _PARAM2_ pixels", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TriggerOffset", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - }, - { - "description": "SetScreen Offset Leaving Value", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "true", - "type": "Boolean", - "label": "Horizontal wrapping", - "name": "HorizontalWrapping" - }, - { - "value": "true", - "type": "Boolean", - "label": "Vertical wrapping", - "name": "VerticalWrapping" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Top border of wrapped area (Y)", - "name": "BorderTop" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Left border of wrapped area (X)", - "name": "BorderLeft" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Right border of wrapped area (X)", - "description": "If blank, the value will be the scene width.", - "name": "BorderRight" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Bottom border of wrapped area (Y)", - "description": "If blank, the value will be scene height.", - "name": "BorderBottom" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Number of pixels past the center where the object teleports and appears", - "name": "TriggerOffset" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Teleport the object when leaving one side of the screen so that it immediately reappears on the opposite side, maintaining speed and trajectory.", - "fullName": "Screen Wrap (physics objects)", - "name": "ScreenWrapPhysics", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Initialize variables (if needed)", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "BorderBottom", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetBottomBorder" - }, - "parameters": [ - "Object", - "Behavior", - "SceneWindowHeight()", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, - "parameters": [ - "BorderRight", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetRightBorder" - }, - "parameters": [ - "Object", - "Behavior", - "SceneWindowWidth()", - "" - ] - } - ] - } - ], - "parameters": [] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "colorB": 5, - "colorG": 117, - "colorR": 65, - "creationTime": 0, - "name": "ScreenWrap", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Move object to opposite side (if needed)", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [], - "parameters": [] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::IsHorizontalWrapping" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Velocity is saved because Physics2 resets objects velocities when they are moved from the outside of the extension." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PosX" - }, - "parameters": [ - "Object", - "<", - "BorderLeft - (Object.Width()/2) - TriggerOffset" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Object", - "=", - "BorderRight - (Object.Width()/2) + TriggerOffset" - ] - }, - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PosX" - }, - "parameters": [ - "Object", - ">", - "BorderRight - (Object.Width()/2) + TriggerOffset" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Object", - "=", - "BorderLeft - (Object.Width()/2) - TriggerOffset" - ] - }, - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::IsVerticalWrapping" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PosY" - }, - "parameters": [ - "Object", - "<", - "BorderTop - (Object.Height()/2) - TriggerOffset" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Object", - "=", - "BorderBottom - (Object.Height()/2) + TriggerOffset" - ] - }, - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PosY" - }, - "parameters": [ - "Object", - ">", - "BorderBottom - (Object.Height()/2) + TriggerOffset" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Object", - "=", - "BorderTop - (Object.Height()/2) - TriggerOffset" - ] - }, - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } - ] - } - ], - "parameters": [] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the object is wrapping on the left and right borders.", - "fullName": "Is horizontal wrapping", - "functionType": "Condition", - "name": "IsHorizontalWrapping", - "sentence": "_PARAM0_ is horizontal wrapping", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "HorizontalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "HorizontalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the object is wrapping on the top and bottom borders.", - "fullName": "Is vertical wrapping", - "functionType": "Condition", - "name": "IsVerticalWrapping", - "sentence": "_PARAM0_ is vertical wrapping", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "VerticalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "VerticalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Enable wrapping on the left and right borders.", - "fullName": "Enable horizontal wrapping", - "functionType": "Action", - "name": "EnableHorizontalWrapping", - "sentence": "Enable _PARAM0_ horizontal wrapping: _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "EnableHorizontalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "HorizontalWrapping", - "False", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "EnableHorizontalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "HorizontalWrapping", - "True", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - }, - { - "description": "Value", - "name": "EnableHorizontalWrapping", - "type": "yesorno" - } - ], - "objectGroups": [] - }, - { - "description": "Enable wrapping on the top and bottom borders.", - "fullName": "Enable vertical wrapping", - "functionType": "Action", - "name": "EnableVerticalWrapping", - "sentence": "Enable _PARAM0_ vertical wrapping: _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "EnableVerticalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "VerticalWrapping", - "False", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "EnableVerticalWrapping", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "VerticalWrapping", - "True", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - }, - { - "description": "Value", - "name": "EnableVerticalWrapping", - "type": "yesorno" - } - ], - "objectGroups": [] - }, - { - "description": "Top border (Y position).", - "fullName": "Top border", - "functionType": "Expression", - "name": "BorderTop", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "BorderTop" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Left border (X position).", - "fullName": "Left border", - "functionType": "Expression", - "name": "BorderLeft", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "BorderLeft" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Right border (X position).", - "fullName": "Right border", - "functionType": "Expression", - "name": "BorderRight", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "BorderRight" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Bottom border (Y position).", - "fullName": "Bottom border", - "functionType": "Expression", - "name": "BorderBottom", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "BorderBottom" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Number of pixels past the center where the object teleports and appears.", - "fullName": "Trigger offset", - "functionType": "Expression", - "name": "TriggerOffset", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "TriggerOffset" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Set top border (Y position).", - "fullName": "Set top border", - "functionType": "Action", - "name": "SetTopBorder", - "sentence": "Set _PARAM0_ top border to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "BorderTop", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - }, - { - "description": "Top border value", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Set left border (X position).", - "fullName": "Set left border", - "functionType": "Action", - "name": "SetLeftBorder", - "sentence": "Set _PARAM0_ left border to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "BorderLeft", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - }, - { - "description": "Left border value", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Set bottom border (Y position).", - "fullName": "Set bottom border", - "functionType": "Action", - "name": "SetBottomBorder", - "sentence": "Set _PARAM0_ bottom border to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "BorderBottom", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - }, - { - "description": "Bottom border value", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Set right border (X position).", - "fullName": "Set right border", - "functionType": "Action", - "name": "SetRightBorder", - "sentence": "Set _PARAM0_ right border to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "BorderRight", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - }, - { - "description": "Right border value", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Set trigger offset (pixels).", - "fullName": "Set trigger offset", - "functionType": "Action", - "name": "SetTriggerOffset", - "sentence": "Set _PARAM0_ trigger offset to _PARAM2_ pixels", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TriggerOffset", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - }, - { - "description": "SetScreen Offset Leaving Value", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Save current velocity values.", - "fullName": "Save current velocity values", - "functionType": "Action", - "name": "SaveCurrentVelocities", - "sentence": "Save current velocity values of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "AngularVelocity", - "=", - "Object.RequiredPhysicsBehavior::AngularVelocity()" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "LinearVelocityX", - "=", - "Object.RequiredPhysicsBehavior::LinearVelocityX()" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "LinearVelocityY", - "=", - "Object.RequiredPhysicsBehavior::LinearVelocityY()" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Apply saved velocity values.", - "fullName": "Apply saved velocity values", - "functionType": "Action", - "name": "ApplySavedVelocities", - "sentence": "Apply saved velocity values of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Physics2::AngularVelocity" - }, - "parameters": [ - "Object", - "RequiredPhysicsBehavior", - "=", - "AngularVelocity" - ] - }, - { - "type": { - "value": "Physics2::LinearVelocityX" - }, - "parameters": [ - "Object", - "RequiredPhysicsBehavior", - "=", - "LinearVelocityX" - ] - }, - { - "type": { - "value": "Physics2::LinearVelocityY" - }, - "parameters": [ - "Object", - "RequiredPhysicsBehavior", - "=", - "LinearVelocityY" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "Physics Behavior", - "extraInformation": [ - "Physics2::Physics2Behavior" - ], - "choices": [], - "name": "RequiredPhysicsBehavior" - }, - { - "value": "true", - "type": "Boolean", - "label": "Horizontal wrapping", - "name": "HorizontalWrapping" - }, - { - "value": "true", - "type": "Boolean", - "label": "Vertical wrapping", - "name": "VerticalWrapping" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Top border of wrapped area (Y)", - "name": "BorderTop" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Left border of wrapped area (X)", - "name": "BorderLeft" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Right border of wrapped area (X)", - "description": "If blank, the value will be the scene width.", - "name": "BorderRight" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Bottom border of wrapped area (Y)", - "description": "If blank, the value will be scene height.", - "name": "BorderBottom" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Number of pixels past the center where the object teleports and appears", - "name": "TriggerOffset" - }, - { - "value": "0", - "type": "Number", - "label": "Angular Velocity", - "hidden": true, - "name": "AngularVelocity" - }, - { - "value": "0", - "type": "Number", - "label": "Linear Velocity X", - "hidden": true, - "name": "LinearVelocityX" - }, - { - "value": "0", - "type": "Number", - "label": "Linear Velocity Y", - "hidden": true, - "name": "LinearVelocityY" - } - ], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "Silver-Streak, @Bouh, Tristan Rhodes", - "category": "Game mechanic", - "extensionNamespace": "", - "fullName": "Object \"Is On Screen\" Detection", - "gdevelopVersion": "", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLW1vbml0b3Itc2NyZWVuc2hvdCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik05LDZINVYxMEg3VjhIOU0xOSwxMEgxN1YxMkgxNVYxNEgxOU0yMSwxNkgzVjRIMjFNMjEsMkgzQzEuODksMiAxLDIuODkgMSw0VjE2QTIsMiAwIDAsMCAzLDE4SDEwVjIwSDhWMjJIMTZWMjBIMTRWMThIMjFBMiwyIDAgMCwwIDIzLDE2VjRDMjMsMi44OSAyMi4xLDIgMjEsMiIgLz48L3N2Zz4=", - "name": "IsOnScreen", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/monitor-screenshot.svg", - "shortDescription": "This adds a condition to detect if an object is on screen based off its current layer.", - "version": "1.2.2", - "description": [ - "This extension adds conditions to check if an object is located within the visible portion of its layer's camera. The condition also allows for specifying padding to the virtual screen border.", - "", - "Note that this does not take into account any object visibility, such as being hidden or 0 opacity, but can be combined with those existing conditions." - ], - "origin": { - "identifier": "IsOnScreen", - "name": "gdevelop-extension-store" - }, - "tags": [ - "is on screen", - "condition", - "visible", - "hide", - "screen" - ], - "authorIds": [ - "2OwwM8ToR9dx9RJ2sAKTcrLmCB92", - "8Ih1aa8f5gWUp4UB2BdhQ2iXWxJ3", - "gqDaZjCfevOOxBYkK6zlhtZnXCg1" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [], - "eventsBasedBehaviors": [ - { - "description": "This behavior provides a condition to check if the object is located within the visible portion of its layer's camera. The condition also allows for specifying padding to the virtual screen border.\nNote that object visibility, such as being hidden or 0 opacity, is not considered (but you can use those existing conditions in addition to this behavior).", - "fullName": "Is on screen", - "name": "InOnScreen", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "description": "Checks if an object position is within the viewport of its layer.", - "fullName": "Is on screen", - "functionType": "Condition", - "name": "IsOnScreen", - "sentence": "_PARAM0_ is on screen (padded by _PARAM2_ pixels)", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/*", - "Get the object layer, convert the position from this layer to the screen coordinates.", - "Get the point on each side on the object on screen, and compare with the screen area.", - "", - "This way even if the camera has a rotation or custom scale the object is always compared to the screen area.", - "*/", - "", - "", - "// Get the layer of the object.", - "const object = objects[0];", - "const layer = runtimeScene.getLayer(object.getLayer());", - "", - "// Get the aabb of the object on his layer.", - "const aabb = object.getVisibilityAABB();", - "", - "// Get the layer to convert the coordinates of the AABB to the screen coordinates", - "const topLeft = layer.convertInverseCoords(aabb.min[0], aabb.min[1]);", - "const topRight = layer.convertInverseCoords(aabb.max[0], aabb.min[1]);", - "const bottomRight = layer.convertInverseCoords(aabb.max[0], aabb.max[1]);", - "const bottomLeft = layer.convertInverseCoords(aabb.min[0], aabb.max[1]);", - "", - "// Get the points on each side of the object on screen.", - "const posLeftObjectOnScreen = Math.min(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]);", - "const posRightObjectOnScreen = Math.max(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]);", - "const posUpObjectOnScreen = Math.min(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]);", - "const posDownObjectOnScreen = Math.max(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]);", - "", - "const padding = eventsFunctionContext.getArgument(\"Padding\");", - "", - "if (", - " !(posLeftObjectOnScreen - padding > runtimeScene.getGame().getGameResolutionWidth() ||", - " posUpObjectOnScreen - padding > runtimeScene.getGame().getGameResolutionHeight() ||", - " posRightObjectOnScreen + padding < 0 ||", - " posDownObjectOnScreen + padding < 0", - " )", - ") {", - " eventsFunctionContext.returnValue = true;", - "}", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "IsOnScreen::InOnScreen", - "type": "behavior" - }, - { - "description": "Padding (in pixels)", - "longDescription": "Number of pixels to pad the screen border. Zero by default. A negative value goes inside the screen, a positive value go outside.", - "name": "Padding", - "type": "expression" - } - ], - "objectGroups": [ - { - "name": "Group", - "objects": [] - } - ] - } - ], - "propertyDescriptors": [], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "General", - "extensionNamespace": "", - "fullName": "3D collision", - "gdevelopVersion": ">=5.5.222", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZlY3Rvci1pbnRlcnNlY3Rpb24iIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMy4xNCwxQTIuMTQsMi4xNCAwIDAsMCAxLDMuMTRWNUgzVjNINVYxSDMuMTRNNywxVjNIMTBWMUg3TTEyLDFWM0gxNFY1SDE2VjMuMTRDMTYsMS45NiAxNS4wNCwxIDEzLjg2LDFIMTJNMSw3VjEwSDNWN0gxTTksN0M3Ljg5LDcgNyw3Ljg5IDcsOUM3LDExLjMzIDcsMTYgNywxNkM3LDE2IDExLjU3LDE2IDEzLjg2LDE2QTIuMTQsMi4xNCAwIDAsMCAxNiwxMy44NkMxNiwxMS41NyAxNiw3IDE2LDdDMTYsNyAxMS4zMyw3IDksN00xOCw3VjlIMjBWMTFIMjJWOUMyMiw3Ljg5IDIxLjExLDcgMjAsN0gxOE05LDlIMTRWMTRIOVY5TTEsMTJWMTMuODZDMSwxNS4wNCAxLjk2LDE2IDMuMTQsMTZINVYxNEgzVjEySDFNMjAsMTNWMTZIMjJWMTNIMjBNNywxOFYyMEM3LDIxLjExIDcuODksMjIgOSwyMkgxMVYyMEg5VjE4SDdNMjAsMThWMjBIMThWMjJIMjBDMjEuMTEsMjIgMjIsMjEuMTEgMjIsMjBWMThIMjBNMTMsMjBWMjJIMTZWMjBIMTNaIiAvPjwvc3ZnPg==", - "name": "Collision3D", - "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/7a5696a515bf40813692e118147568392a854f65f5b50750c9b9aaa967aba7df_vector-intersection.svg", - "shortDescription": "Check collision and distance between 3D objects.", - "version": "0.2.0", - "description": "Check collision and distance between 3D objects and separate them from each other.", - "origin": { - "identifier": "Collision3D", - "name": "gdevelop-extension-store" - }, - "tags": [ - "3d", - "collision" - ], - "authorIds": [ - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", - "PEzPAaWHgYgk5UwIPppsL6f2ugp2" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Define helper classes JavaScript code.", - "fullName": "Define helper classes", - "functionType": "Action", - "name": "DefineHelperClasses", - "private": true, - "sentence": "Define helper classes JavaScript code", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "if (gdjs._collision3DExtension) {", - " return;", - "}", - "", - "/**", - " * @param {gdjs.RuntimeObject} object", - " * @param {boolean} shouldUseCustomCenter", - " * @return {number}", - " */", - "const getCenterX = (object, shouldUseCustomCenter) =>", - " shouldUseCustomCenter ?", - " object.getCenterXInScene() :", - " object.getDrawableX() + object.getWidth() / 2", - "", - "/**", - " * @param {gdjs.RuntimeObject} object", - " * @param {boolean} shouldUseCustomCenter", - " * @return {number}", - " */", - "const getCenterY = (object, shouldUseCustomCenter) =>", - " shouldUseCustomCenter ?", - " object.getCenterYInScene() :", - " object.getDrawableY() + object.getHeight() / 2", - "", - "/**", - " * @param {gdjs.RuntimeObject3D} object", - " * @param {boolean} shouldUseCustomCenter", - " * @return {number}", - " */", - "const getCenterZ = (object, shouldUseCustomCenter) =>", - " !object.getCenterZInScene ? 0 :", - " shouldUseCustomCenter ?", - " object.getCenterZInScene() :", - " object.getDrawableZ() + object.getDepth() / 2", - "", - "/**", - " * @param {gdjs.RuntimeObject} object", - " * @param {float} x", - " * @param {float} y", - " * @param {float} z", - " * @param {boolean} shouldUseCustomCenter", - " * @return {number}", - " */", - "const getSqDistanceToPosition = (object, x, y, z, shouldUseCustomCenter = true) => {", - " const deltaX = getCenterX(object, shouldUseCustomCenter) - x;", - " const deltaY = getCenterY(object, shouldUseCustomCenter) - y;", - " const deltaZ = getCenterZ(object, shouldUseCustomCenter) - z;", - " return deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ;", - "};", - "", - "/**", - " * @param {gdjs.RuntimeObject} object", - " * @param {float} x", - " * @param {float} y", - " * @param {float} z", - " * @return {number}", - " */", - "const getDistanceToPosition = (object, x, y, z) => Math.sqrt(getSqDistanceToPosition(object, x, y, z));", - "", - "/**", - " * @param {gdjs.RuntimeObject} object", - " * @param {gdjs.RuntimeObject} otherObject", - " * @param {boolean} shouldUseCustomCenter", - " * @return {number}", - " */", - "const getSqDistanceToObject = (object, otherObject, shouldUseCustomCenter = true) => {", - " return getSqDistanceToPosition(", - " object,", - " getCenterX(otherObject, shouldUseCustomCenter),", - " getCenterY(otherObject, shouldUseCustomCenter),", - " getCenterZ(otherObject, shouldUseCustomCenter)", - " );", - "};", - "", - "/**", - " * @param {gdjs.RuntimeObject} object", - " * @param {gdjs.RuntimeObject} otherObject", - " * @return {number}", - " */", - "const getDistanceToObject = (object, otherObject) => Math.sqrt(getSqDistanceToObject(object, otherObject));", - "", - "/**", - " * @param {gdjs.RuntimeObject} object", - " * @param {gdjs.RuntimeObject} otherObject", - " * @param {{distanceSq: number, shouldUseCustomCenter: boolean}} distanceSettings", - " * @return {boolean}", - " */", - "const areObjectsWithinDistance = (object, otherObject, distanceSettings) => {", - " return getSqDistanceToObject(", - " object, otherObject, distanceSettings.shouldUseCustomCenter) <= distanceSettings.distanceSq;", - "};", - "", - "const distanceSettings = {distanceSq: 0, shouldUseCustomCenter: true};", - "", - "/**", - " * @param {Hashtable} objectsLists1", - " * @param {Hashtable} objectsLists2", - " * @param {number} distance", - " * @param {boolean} shouldUseCustomCenter", - " * @param {boolean} inverted", - " * @return {boolean}", - " */", - "const pickObjectsWithinDistance = (objectsLists1, objectsLists2, distance, shouldUseCustomCenter, inverted) => {", - " distanceSettings.distanceSq = distance * distance;", - " distanceSettings.shouldUseCustomCenter = shouldUseCustomCenter;", - " return gdjs.evtTools.object.twoListsTest(", - " areObjectsWithinDistance,", - " objectsLists1,", - " objectsLists2,", - " inverted,", - " distanceSettings", - " );", - "}", - "", - "/**", - " * @param {Hashtable} objectsLists", - " * @param {number} x", - " * @param {number} y", - " * @param {number} z", - " * @param {boolean} inverted", - " * @return {boolean}", - " */", - "const pickNearestObject = function (objectsLists, x, y, z, inverted) {", - " let bestObject = null;", - " let best = 0;", - " let first = true;", - " const lists = gdjs.staticArray(gdjs._collision3DExtension.pickNearestObject);", - " objectsLists.values(lists);", - " for (let i = 0, len = lists.length; i < len; ++i) {", - " const list = lists[i];", - " for (let j = 0; j < list.length; ++j) {", - " const object = list[j];", - " const distance = getSqDistanceToPosition(object, x, y, z);", - " // @ts-ignore", - " if (first || (distance < best) ^ inverted) {", - " best = distance;", - " bestObject = object;", - " }", - " first = false;", - " }", - " }", - " if (bestObject) {", - " gdjs.evtTools.object.pickOnly(objectsLists, bestObject);", - " }", - " return !!bestObject;", - "}", - "", - "/**", - " * @param {gdjs.RuntimeObject} object", - " * @return {float}", - " */", - "const getObjectMinZ = (object) =>", - " object.getDrawableZ ? object.getDrawableZ() : 0", - "", - "/**", - " * @param {gdjs.RuntimeObject} object", - " * @return {float}", - " */", - "const getObjectMaxZ = (object) =>", - " object.getDrawableZ ? object.getDrawableZ() + object.getDepth() : 0;", - "", - "/**", - " * @param {gdjs.RuntimeObject} object1", - " * @param {gdjs.RuntimeObject} object2", - " * @param {boolean} ignoreTouchingEdges If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.", - " * @return {boolean}", - " */", - "const areObjectsInCollision = (", - " object1,", - " object2,", - " ignoreTouchingEdges,", - ") => {", - " const object1MinZ = getObjectMinZ(object1);", - " const object1MaxZ = getObjectMaxZ(object1);", - " const object2MinZ = getObjectMinZ(object2);", - " const object2MaxZ = getObjectMaxZ(object2);", - "", - " const canObjectsOverlapOnZ = ignoreTouchingEdges ?", - " (object1MinZ < object2MaxZ && object1MaxZ > object2MinZ) :", - " (object1MinZ <= object2MaxZ && object1MaxZ >= object2MinZ);", - "", - " return canObjectsOverlapOnZ &&", - " gdjs.RuntimeObject.collisionTest(", - " object1,", - " object2,", - " ignoreTouchingEdges", - " );", - "}", - "", - "/**", - " * @param {Hashtable} objectsLists1", - " * @param {Hashtable} objectsLists2", - " * @param {boolean} inverted", - " * @return {boolean}", - " */", - "const pickObjectsInCollision = (", - " objectsLists1,", - " objectsLists2,", - " inverted,", - ") => {", - " return gdjs.evtTools.object.twoListsTest(", - " areObjectsInCollision,", - " objectsLists1,", - " objectsLists2,", - " inverted,", - " false", - " );", - "}", - "", - "/**", - " * @param {gdjs.RuntimeObject} movingObject", - " * @param {gdjs.RuntimeObject} object", - " * @return {float}", - " */", - "const getSeparationDeltaZ = (", - " movingObject,", - " object,", - ") => {", - " const movingObjectMinZ = getObjectMinZ(movingObject);", - " const movingObjectMaxZ = getObjectMaxZ(movingObject);", - " const objectMinZ = getObjectMinZ(object);", - " const objectMaxZ = getObjectMaxZ(object);", - "", - " const downwardDeltaZ = Math.min(0, objectMinZ - movingObjectMaxZ);", - " const upwardDeltaZ = Math.max(0, objectMaxZ - movingObjectMinZ);", - "", - " return -downwardDeltaZ < upwardDeltaZ ? downwardDeltaZ : upwardDeltaZ", - "}", - "", - "// This function is an exact copy from GDJS/Runtime/runtimeobject.ts", - "/**", - " * Move the object using the results from collisionTest call.", - " * This moves the object according to the direction of the longest vector,", - " * and projects the others on the orthogonal vector.", - " *", - " * See {@link RuntimeObject.separateFromObjects}", - " *", - " * @param {gdjs.RuntimeObject} object The object to move.", - " * @param {float[]} moveXArray The X coordinates of the vectors to move the object.", - " * @param {float[]} moveYArray The Y coordinates of the vectors to move the object.", - " * @return {boolean} true if the object was moved.", - " */", - "const moveFollowingSeparatingVectors = (", - " object,", - " moveXArray,", - " moveYArray", - ") => {", - " if (moveXArray.length === 0) {", - " moveXArray.length = 0;", - " moveYArray.length = 0;", - " return false;", - " }", - " if (moveXArray.length === 1) {", - " // Move according to the results returned by the collision algorithm.", - " object.setPosition(", - " object.getX() + moveXArray[0],", - " object.getY() + moveYArray[0]", - " );", - " moveXArray.length = 0;", - " moveYArray.length = 0;", - " return true;", - " }", - "", - " // Find the longest vector", - " let squaredDistanceMax = 0;", - " let distanceMaxIndex = 0;", - " for (let index = 0; index < moveXArray.length; index++) {", - " const moveX = moveXArray[index];", - " const moveY = moveYArray[index];", - "", - " const squaredDistance = moveX * moveX + moveY * moveY;", - " if (squaredDistance > squaredDistanceMax) {", - " squaredDistanceMax = squaredDistance;", - " distanceMaxIndex = index;", - " }", - " }", - "", - " const distanceMax = Math.sqrt(squaredDistanceMax);", - " // unit vector of the longest vector", - " const uX = moveXArray[distanceMaxIndex] / distanceMax;", - " const uY = moveYArray[distanceMaxIndex] / distanceMax;", - "", - " // normal vector of the longest vector", - " const vX = -uY;", - " const vY = uX;", - "", - " // Project other vectors on the normal", - " let scalarProductMin = 0;", - " let scalarProductMax = 0;", - " for (let index = 0; index < moveXArray.length; index++) {", - " const moveX = moveXArray[index];", - " const moveY = moveYArray[index];", - "", - " const scalarProduct = moveX * vX + moveY * vY;", - " scalarProductMin = Math.min(scalarProductMin, scalarProduct);", - " scalarProductMax = Math.max(scalarProductMax, scalarProduct);", - " }", - "", - " // Apply the longest vector", - " let deltaX = moveXArray[distanceMaxIndex];", - " let deltaY = moveYArray[distanceMaxIndex];", - "", - " // Apply the longest projected vector if they all are in the same direction", - " // Some projections could have rounding errors,", - " // they are considered negligible under a 1 for 1,000,000 ratio.", - " const scalarProductMinIsNegligible =", - " -scalarProductMin < scalarProductMax / 1048576;", - " const scalarProductMaxIsNegligible =", - " scalarProductMax < -scalarProductMin / 1048576;", - " if (scalarProductMinIsNegligible !== scalarProductMaxIsNegligible) {", - " if (scalarProductMaxIsNegligible) {", - " deltaX += scalarProductMin * vX;", - " deltaY += scalarProductMin * vY;", - " } else {", - " deltaX += scalarProductMax * vX;", - " deltaY += scalarProductMax * vY;", - " }", - " }", - " object.setPosition(object.getX() + deltaX, object.getY() + deltaY);", - " moveXArray.length = 0;", - " moveYArray.length = 0;", - " return true;", - "};", - "", - "/**", - " * Arrays and data structure that are (re)used by", - " * {@link separateFromObjects} to avoid any allocation.", - " * @type {{moveXArray: float[], moveYArray: float[], moveZArray: float[]}}", - " */", - "const separateFromObjectsStatics = {", - " moveXArray: [],", - " moveYArray: [],", - " moveZArray: [],", - "};", - "", - "/**", - " * Separate the object from others objects, using their hitboxes.", - " * @param {gdjs.RuntimeObject} object The object that moves.", - " * @param {gdjs.RuntimeObject[]} objects The objects that stay still.", - " * @return {boolean} true if the object was moved", - " */", - "const separateFromObjects = (", - " object,", - " objects", - ") => {", - " const moveXArray = separateFromObjectsStatics.moveXArray;", - " const moveYArray = separateFromObjectsStatics.moveYArray;", - " moveXArray.length = 0;", - " moveYArray.length = 0;", - " let moveZMax = 0;", - "", - " // We can assume that the moving object is not grid based,", - " // so there is no need for optimization:", - " // getHitBoxes can be called directly.", - " const hitBoxes = object.getHitBoxes();", - " /** @type {gdjs.AABB | null} */", - " let aabb = null;", - "", - " // Check if there is a collision with each object", - " for (const otherObject of objects) {", - " if (otherObject.id === object.id) {", - " continue;", - " }", - " const moveZ = getSeparationDeltaZ(object, otherObject);", - " if (moveZ === 0) {", - " continue;", - " }", - " const moveZSq = moveZ * moveZ;", - "", - " let otherHitBoxesArray = otherObject.getHitBoxes();", - " /** @type {Iterable} */", - " let otherHitBoxes = otherHitBoxesArray;", - " if (otherHitBoxesArray.length > 4) {", - " // The other object has a lot of hit boxes.", - " // Try to reduce the amount of hitboxes to check.", - " if (!aabb) {", - " aabb = object.getAABB();", - " }", - " otherHitBoxes = otherObject.getHitBoxesAround(", - " aabb.min[0],", - " aabb.min[1],", - " aabb.max[0],", - " aabb.max[1]", - " );", - " }", - " for (const hitBox of hitBoxes) {", - " for (const otherHitBox of otherHitBoxes) {", - " const result = gdjs.Polygon.collisionTest(", - " hitBox,", - " otherHitBox,", - " true", - " );", - " if (result.collision) {", - " const moveX = result.move_axis[0];", - " const moveY = result.move_axis[1];", - " if (moveZSq < moveX * moveX + moveY * moveY) {", - " if (Math.abs(moveZ) > Math.abs(moveZMax)) {", - " moveZMax = moveZ;", - " }", - " }", - " else {", - " moveXArray.push(moveX);", - " moveYArray.push(moveY);", - " }", - " }", - " }", - " }", - " }", - " const hasObjectMovedOnZ = moveZMax !== 0;", - " if (hasObjectMovedOnZ) {", - " object.setZ(object.getZ() + moveZMax);", - " }", - " const hasObjectMovedOnXY = moveFollowingSeparatingVectors(object, moveXArray, moveYArray);", - " return hasObjectMovedOnXY || hasObjectMovedOnZ;", - "}", - "", - "gdjs._collision3DExtension = {", - " getSqDistanceToPosition,", - " getDistanceToPosition,", - " getSqDistanceToObject,", - " getDistanceToObject,", - " pickObjectsWithinDistance,", - " pickNearestObject,", - " pickObjectsInCollision,", - " separateFromObjects", - "}" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onFirstSceneLoaded", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Collision3D::DefineHelperClasses" - }, - "parameters": [ - "", - "" - ] - } - ] - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Compare the distance between two objects in 3D.", - "fullName": "Distance between two objects in 3D", - "functionType": "Condition", - "group": "Position", - "name": "AreWithinDistance", - "sentence": "_PARAM1_ distance to _PARAM2_ is below _PARAM3_ pixels", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "// TODO If condition is inverted, only objects that have a distance greater than specified to any other object will be picked.\r", - "const inverted = false;\r", - "\r", - "eventsFunctionContext.returnValue = gdjs._collision3DExtension.pickObjectsWithinDistance(\r", - " eventsFunctionContext.getObjectsLists(\"Object\"),\r", - " eventsFunctionContext.getObjectsLists(\"OtherObject\"),\r", - " eventsFunctionContext.getArgument(\"Distance\"),\r", - " eventsFunctionContext.getArgument(\"ShouldUseCustomCenter\"),\r", - " inverted\r", - ");\r", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "objectList" - }, - { - "description": "Other object", - "name": "OtherObject", - "type": "objectList" - }, - { - "description": "Distance", - "name": "Distance", - "type": "expression" - }, - { - "defaultValue": "yes", - "description": "Use custom center", - "name": "ShouldUseCustomCenter", - "optional": true, - "type": "yesorno" - } - ], - "objectGroups": [] - }, - { - "description": "Distance between two objects in 3D.", - "fullName": "Distance between two objects in 3D", - "functionType": "Expression", - "group": "Position", - "name": "Distance", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "\r", - "const otherObjects = eventsFunctionContext.getObjectsLists(\"OtherObject\");\r", - "\r", - "if (objects.length > 0 && otherObjects.length > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._collision3DExtension.getDistanceToObject(\r", - " objects[0],\r", - " otherObjects[0]\r", - " );\r", - "}\r", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "objectList" - }, - { - "description": "Other object", - "name": "OtherObject", - "type": "objectList" - } - ], - "objectGroups": [] - }, - { - "description": "Square distance between two objects in 3D.", - "fullName": "Square distance between two objects", - "functionType": "Expression", - "group": "Position", - "name": "SqDistance", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "\r", - "const otherObjects = eventsFunctionContext.getObjectsLists(\"OtherObject\");\r", - "\r", - "if (objects.length > 0 && otherObjects.length > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._collision3DExtension.getSqDistanceToObject(\r", - " objects[0],\r", - " otherObjects[0]\r", - " );\r", - "}\r", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "objectList" - }, - { - "description": "Other object", - "name": "OtherObject", - "type": "objectList" - } - ], - "objectGroups": [] - }, - { - "description": "Distance between an object and a position in 3D.", - "fullName": "Distance between an object and a position", - "functionType": "Expression", - "group": "Position", - "name": "DistanceToPosition", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "\r", - "if (objects.length > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._collision3DExtension.getDistanceToPosition(\r", - " objects[0],\r", - " eventsFunctionContext.getArgument(\"PositionX\"),\r", - " eventsFunctionContext.getArgument(\"PositionY\"),\r", - " eventsFunctionContext.getArgument(\"PositionZ\"),\r", - " );\r", - "}\r", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "objectList" - }, - { - "description": "X position", - "name": "PositionX", - "type": "expression" - }, - { - "description": "Y position", - "name": "PositionY", - "type": "expression" - }, - { - "description": "Z position", - "name": "PositionZ", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Square distance between an object and a position in 3D.", - "fullName": "Square distance between an object and a position", - "functionType": "Expression", - "group": "Position", - "name": "SqDistanceToPosition", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "\r", - "if (objects.length > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._collision3DExtension.getSqDistanceToPosition(\r", - " objects[0],\r", - " eventsFunctionContext.getArgument(\"PositionX\"),\r", - " eventsFunctionContext.getArgument(\"PositionY\"),\r", - " eventsFunctionContext.getArgument(\"PositionZ\"),\r", - " );\r", - "}\r", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "objectList" - }, - { - "description": "X position", - "name": "PositionX", - "type": "expression" - }, - { - "description": "Y position", - "name": "PositionY", - "type": "expression" - }, - { - "description": "Z position", - "name": "PositionZ", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Pick the object of this type that is nearest to the specified position in 3D.", - "fullName": "Pick nearest object in 3D", - "functionType": "Condition", - "group": "Objects", - "name": "PickNearest", - "sentence": "Pick the _PARAM1_ that is nearest to _PARAM2_ ; _PARAM3_ ; _PARAM4_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "// TODO If the condition is inverted, the object farthest from the specified position is picked instead.\r", - "const inverted = false;\r", - "\r", - "eventsFunctionContext.returnValue = gdjs._collision3DExtension.pickNearestObject(\r", - " eventsFunctionContext.getObjectsLists(\"Object\"),\r", - " eventsFunctionContext.getArgument(\"PositionX\"),\r", - " eventsFunctionContext.getArgument(\"PositionY\"),\r", - " eventsFunctionContext.getArgument(\"PositionZ\"),\r", - " inverted\r", - ");" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "objectList" - }, - { - "description": "X position", - "name": "PositionX", - "type": "expression" - }, - { - "description": "Y position", - "name": "PositionY", - "type": "expression" - }, - { - "description": "Z position", - "name": "PositionZ", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Check the collision between two objects using their collision masks. Object rotation around X and Y axes are ignored.", - "fullName": "Collision in 3D", - "functionType": "Condition", - "group": "Collision", - "name": "AreInCollision", - "sentence": "_PARAM1_ is in collision with _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "// TODO If the condition is inverted, the object farthest from the specified position is picked instead.\r", - "const inverted = false;\r", - "\r", - "eventsFunctionContext.returnValue = gdjs._collision3DExtension.pickObjectsInCollision(\r", - " eventsFunctionContext.getObjectsLists(\"Object\"),\r", - " eventsFunctionContext.getObjectsLists(\"OtherObject\"),\r", - " eventsFunctionContext.getArgument(\"IgnoreEdges\"),\r", - " inverted\r", - ");" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "objectList" - }, - { - "description": "3D capability", - "name": "Object3D", - "supplementaryInformation": "Scene3D::Base3DBehavior", - "type": "behavior" - }, - { - "description": "Other object", - "name": "OtherObject", - "type": "objectList" - }, - { - "description": "3D capability", - "name": "OtherObjectCapability", - "supplementaryInformation": "Scene3D::Base3DBehavior", - "type": "behavior" - }, - { - "description": "Ignore objects that are touching each other on their edges, but are not overlapping (default: no)", - "name": "IgnoreEdges", - "type": "yesorno" - } - ], - "objectGroups": [] - }, - { - "description": "Move an object away from another using their collision masks. Object rotation around X and Y axes are ignored.\nBe sure to call this action on a reasonable number of objects to avoid slowing down the game.", - "fullName": "Separate objects in 3D", - "functionType": "Action", - "group": "Position", - "name": "SeparateFromObjects", - "sentence": "Move _PARAM1_ away from _PARAM3_ (only _PARAM1_ will move)", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "\r", - "const otherObjects = eventsFunctionContext.getObjects(\"OtherObject\");\r", - "\r", - "for (const object of objects) {\r", - " gdjs._collision3DExtension.separateFromObjects(\r", - " object,\r", - " otherObjects,\r", - " );\r", - "}" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "objectList" - }, - { - "description": "3D capability", - "name": "Object3D", - "supplementaryInformation": "Scene3D::Base3DBehavior", - "type": "behavior" - }, - { - "description": "Objects (won't move)", - "name": "OtherObject", - "type": "objectList" - }, - { - "description": "3D capability", - "name": "OtherObject3D", - "supplementaryInformation": "Scene3D::Base3DBehavior", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "", - "extensionNamespace": "", - "fullName": "", - "gdevelopVersion": "", - "helpPath": "", - "iconUrl": "", - "name": "Collectible", - "previewIconUrl": "", - "shortDescription": "", - "version": "", - "description": "", - "tags": [], - "authorIds": [], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [ - { - "folded": true, - "name": "RisingPitch", - "type": "number", - "value": 0.8 - } - ], - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onScenePreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Reset rising pitch" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "CompareTimer" - }, - "parameters": [ - "", - "\"RisingPitch\"", - ">", - "1" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "RisingPitch", - "=", - "RandomFloatInRange(0.9,1.1)" - ] - }, - { - "type": { - "value": "RemoveTimer" - }, - "parameters": [ - "", - "\"RisingPitch\"" - ] - } - ] - } - ], - "parameters": [], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ - { - "description": "Rotate continuously and make a sound when deleted.", - "fullName": "Collectible", - "name": "Collectible", - "objectType": "Scene3D::Model3DObject", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onDestroy", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Reseting the rising pitch variable after being adjusted in the coin collision event." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "PlaySound" - }, - "parameters": [ - "", - "CoinPickUp", - "", - "25", - "RisingPitch" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "RisingPitch", - "*", - "1.05" - ] - }, - { - "type": { - "value": "ResetTimer" - }, - "parameters": [ - "", - "\"RisingPitch\"" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "Scene3D::Model3DObject", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Collectible::Collectible", - "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": "Rotating the coins in game." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Rotate" - }, - "parameters": [ - "Object", - "RotationSpeed", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "Scene3D::Model3DObject", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Collectible::Collectible", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "50", - "type": "Number", - "unit": "AngularSpeed", - "label": "Rotation speed", - "name": "RotationSpeed" - } - ], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "User interface", - "extensionNamespace": "", - "fullName": "Leaderboard dialog", - "gdevelopVersion": "", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXRyb3BoeSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xOCAyQzE3LjEgMiAxNiAzIDE2IDRIOEM4IDMgNi45IDIgNiAySDJWMTFDMiAxMiAzIDEzIDQgMTNINi4yQzYuNiAxNSA3LjkgMTYuNyAxMSAxN1YxOS4wOEM4IDE5LjU0IDggMjIgOCAyMkgxNkMxNiAyMiAxNiAxOS41NCAxMyAxOS4wOFYxN0MxNi4xIDE2LjcgMTcuNCAxNSAxNy44IDEzSDIwQzIxIDEzIDIyIDEyIDIyIDExVjJIMThNNiAxMUg0VjRINlYxMU0yMCAxMUgxOFY0SDIwVjExWiIgLz48L3N2Zz4=", - "name": "LeaderboardDialog", - "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/4b89b420c0ed9c540a7f00c5735a31af0db2160679d3fab2170df3681c3ac38c_trophy.svg", - "shortDescription": "Display the player score and allow to submit it to a leaderboard.", - "version": "1.0.1", - "description": "Display the player score and allow to submit it to a leaderboard.", - "origin": { - "identifier": "LeaderboardDialog", - "name": "gdevelop-extension-store" - }, - "tags": [ - "" - ], - "authorIds": [ - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Check if the events are running for the editor.", - "fullName": "Editor is running", - "functionType": "Condition", - "name": "IsInGameEdition", - "private": true, - "sentence": "Events are running for the editor", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const game = runtimeScene.getGame();\r", - "eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Return a formated time for a given timestamp", - "fullName": "Format time", - "functionType": "StringExpression", - "name": "FormatTime", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "ToString(Time)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Format", - "=", - "\"MM:SS.ms\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "LeaderboardDialog::PadStart(ToString(floor(Time / 60)), 2, \"0\") + \":\" + LeaderboardDialog::PadStart(LeaderboardDialog::ToFixed(mod(Time, 60), 3), 6, \"0\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Format", - "=", - "\"MM:SS\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "LeaderboardDialog::PadStart(ToString(floor(Time / 60)), 2, \"0\") + \":\" + LeaderboardDialog::PadStart(ToString(mod(floor(Time), 60)), 2, \"0\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Format", - "=", - "\"SS\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "LeaderboardDialog::ToFixed(Time, 3)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Format", - "=", - "\"SS.ms\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "LeaderboardDialog::ToFixed(Time, 3)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Format", - "=", - "\"ms\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "ToString(floor(Time * 1000))" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Format", - "=", - "\"HH:MM:SS.ms\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "LeaderboardDialog::PadStart(ToString(floor(Time / 3600)), 2, \"0\") + \":\" + LeaderboardDialog::PadStart(ToString(mod(floor(Time / 60), 60)), 2, \"0\") + \":\" + LeaderboardDialog::PadStart(LeaderboardDialog::ToFixed(mod(Time, 60), 3), 6, \"0\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Format", - "=", - "\"HH:MM:SS\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "LeaderboardDialog::PadStart(ToString(floor(Time / 3600)), 2, \"0\") + \":\" + LeaderboardDialog::PadStart(ToString(mod(floor(Time / 60), 60)), 2, \"0\") + \":\" + LeaderboardDialog::PadStart(ToString(mod(floor(Time), 60)), 2, \"0\")" - ] - } - ] - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "Time", - "name": "Time", - "type": "expression" - }, - { - "description": "Format", - "name": "Format", - "supplementaryInformation": "[\"MM:SS.ms\",\"MM:SS\",\"SS\",\"SS.ms\",\"ms\",\"HH:MM:SS.ms\",\"HH:MM:SS\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Formats a number to a string with the specified number of decimal places.", - "fullName": "To fixed", - "functionType": "StringExpression", - "name": "ToFixed", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] - }, - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const valueToBeRounded = eventsFunctionContext.getArgument(\"ValueToBeRounded\");", - "const numberOfDecimalPlaces = eventsFunctionContext.getArgument(\"NumberOfDecimalPlaces\");", - "eventsFunctionContext.returnValue = valueToBeRounded.toFixed(numberOfDecimalPlaces);" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "The value to be rounded", - "name": "ValueToBeRounded", - "type": "expression" - }, - { - "description": "Number of decimal places", - "name": "NumberOfDecimalPlaces", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "fullName": "Pad start", - "functionType": "StringExpression", - "name": "PadStart", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] - }, - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const value = eventsFunctionContext.getArgument(\"Value\");", - "const targetLength = eventsFunctionContext.getArgument(\"TargetLength\");", - "const padString = eventsFunctionContext.getArgument(\"PadString\");", - "eventsFunctionContext.returnValue = value.padStart(targetLength, padString);" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "Text", - "name": "Value", - "type": "string" - }, - { - "description": "Target length", - "name": "TargetLength", - "type": "expression" - }, - { - "description": "Pad string", - "name": "PadString", - "type": "string" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [ - { - "areaMaxX": 688, - "areaMaxY": 480, - "areaMaxZ": 48, - "areaMinX": 0, - "areaMinY": 0, - "areaMinZ": 0, - "defaultName": "LeaderboardDialog", - "description": "Displays the player score and allows to submit it to a leaderboard.", - "fullName": "Leaderboard dialog", - "isInnerAreaFollowingParentSize": true, - "isUsingLegacyInstancesRenderer": false, - "name": "LeaderboardDialog", - "objects": [ - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "ScoreLabel", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [], - "string": "Score:", - "font": "", - "textAlignment": "", - "characterSize": 40, - "color": { - "b": 79, - "g": 72, - "r": 72 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Score:", - "font": "", - "textAlignment": "", - "verticalTextAlignment": "top", - "characterSize": 40, - "lineHeight": 0, - "color": "72;72;79" - } - }, - { - "assetStoreId": "", - "name": "PlayerNameInput", - "type": "TextInput::TextInputObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "initialValue": "", - "placeholder": "PlayerName", - "fontResourceName": "", - "fontSize": 40, - "inputType": "text", - "textColor": "72;72;79", - "fillColor": "231;232;243", - "fillOpacity": 255, - "borderColor": "255;255;255", - "borderOpacity": 255, - "borderWidth": 6, - "readOnly": false, - "disabled": false - } - }, - { - "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", - "name": "SubmitTextButton", - "type": "PanelSpriteButton::PanelSpriteButton", - "variant": "Yellow button 2", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 0, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "LeftPadding": 16, - "RightPadding": 16, - "PressedLabelOffsetY": 10, - "BottomPadding": 32, - "TopPadding": 16, - "HoveredFadeOutDuration": 0.25, - "LabelText": "Send" - } - }, - { - "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", - "name": "RetryTextButton", - "type": "PanelSpriteButton::PanelSpriteButton", - "variant": "Yellow button 2", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 4, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 4, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "LeftPadding": 16, - "RightPadding": 16, - "PressedLabelOffsetY": 10, - "BottomPadding": 32, - "TopPadding": 16, - "HoveredFadeOutDuration": 0.25, - "LabelText": "Restart" - } - }, - { - "assetStoreId": "", - "bottomMargin": 32, - "height": 128, - "leftMargin": 16, - "name": "Panel", - "rightMargin": 16, - "texture": "", - "tiled": false, - "topMargin": 16, - "type": "PanelSpriteObject::PanelSprite", - "width": 128, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - } - ] - }, - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "Title", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "string": "Game over", - "font": "", - "textAlignment": "center", - "characterSize": 60, - "color": { - "b": 79, - "g": 72, - "r": 72 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Game over", - "font": "", - "textAlignment": "center", - "verticalTextAlignment": "top", - "characterSize": 60, - "lineHeight": 0, - "color": "72;72;79" - } - }, - { - "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", - "name": "BackTextButton", - "type": "PanelSpriteButton::PanelSpriteButton", - "variant": "Yellow button 2", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 4, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 4, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "LeftPadding": 16, - "RightPadding": 16, - "PressedLabelOffsetY": 10, - "BottomPadding": 32, - "TopPadding": 16, - "HoveredFadeOutDuration": 0.25, - "LabelText": "Back" - } - }, - { - "adaptCollisionMaskAutomatically": true, - "assetStoreId": "", - "name": "Medal", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [], - "animations": [] - }, - { - "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", - "name": "NextTextButton", - "type": "PanelSpriteButton::PanelSpriteButton", - "variant": "Yellow button 2", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 4, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 4, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "LeftPadding": 16, - "RightPadding": 16, - "PressedLabelOffsetY": 10, - "BottomPadding": 32, - "TopPadding": 16, - "HoveredFadeOutDuration": 0.25, - "LabelText": "Next" - } - }, - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "BestScoreLabel", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [], - "string": "Best:", - "font": "", - "textAlignment": "", - "characterSize": 40, - "color": { - "b": 79, - "g": 72, - "r": 72 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Best:", - "font": "", - "textAlignment": "", - "verticalTextAlignment": "top", - "characterSize": 40, - "lineHeight": 0, - "color": "72;72;79" - } - }, - { - "assetStoreId": "", - "name": "BitmapTitle", - "type": "BitmapText::BitmapTextObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "text": "Game over", - "opacity": 255, - "scale": 1, - "fontSize": 20, - "tint": "255;255;255", - "bitmapFontResourceName": "", - "textureAtlasResourceName": "", - "align": "center", - "verticalTextAlignment": "top" - } - }, - { - "assetStoreId": "", - "name": "BitmapScoreLabel", - "type": "BitmapText::BitmapTextObject", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "text": "Score:", - "opacity": 255, - "scale": 1, - "fontSize": 20, - "tint": "255;255;255", - "bitmapFontResourceName": "", - "textureAtlasResourceName": "", - "align": "left", - "verticalTextAlignment": "top" - } - }, - { - "assetStoreId": "", - "name": "BitmapBestScoreLabel", - "type": "BitmapText::BitmapTextObject", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "text": "Best:", - "opacity": 255, - "scale": 1, - "fontSize": 20, - "tint": "255;255;255", - "bitmapFontResourceName": "", - "textureAtlasResourceName": "", - "align": "left", - "verticalTextAlignment": "top" - } - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "folderName": "Bitmap labels", - "children": [ - { - "objectName": "BitmapTitle" - }, - { - "objectName": "BitmapScoreLabel" - }, - { - "objectName": "BitmapBestScoreLabel" - } - ] - }, - { - "objectName": "Title" - }, - { - "objectName": "ScoreLabel" - }, - { - "objectName": "BestScoreLabel" - }, - { - "objectName": "Medal" - }, - { - "objectName": "PlayerNameInput" - }, - { - "objectName": "SubmitTextButton" - }, - { - "objectName": "RetryTextButton" - }, - { - "objectName": "BackTextButton" - }, - { - "objectName": "NextTextButton" - }, - { - "objectName": "Panel" - } - ] - }, - "objectsGroups": [ - { - "name": "ActionTextButton", - "objects": [ - { - "name": "RetryTextButton" - }, - { - "name": "BackTextButton" - }, - { - "name": "NextTextButton" - } - ] - }, - { - "name": "Titles", - "objects": [ - { - "name": "Title" - }, - { - "name": "BitmapTitle" - } - ] - }, - { - "name": "ScoreLabels", - "objects": [ - { - "name": "ScoreLabel" - }, - { - "name": "BitmapScoreLabel" - } - ] - }, - { - "name": "BestScoreLabels", - "objects": [ - { - "name": "BestScoreLabel" - }, - { - "name": "BitmapBestScoreLabel" - } - ] - } - ], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [ - { - "angle": 0, - "customSize": false, - "height": 71, - "layer": "", - "name": "ScoreLabel", - "persistentUuid": "e0571581-5b6f-4e0b-928a-92dd21b3851d", - "width": 606, - "x": 36, - "y": 41, - "zOrder": 18, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 96, - "layer": "", - "name": "PlayerNameInput", - "persistentUuid": "1b66c419-4bc7-406f-91e7-7deeb515ff67", - "width": 360, - "x": 40, - "y": 160, - "zOrder": 19, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "RetryTextButton", - "persistentUuid": "d9bfca46-e22c-42c9-a581-b88dbe1f5967", - "width": 0, - "x": 224, - "y": 320, - "zOrder": 35, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 48, - "height": 106, - "layer": "", - "name": "SubmitTextButton", - "persistentUuid": "3ad1036e-666f-4a8c-9b85-6d882e192ee8", - "width": 216, - "x": 432, - "y": 150, - "zOrder": 37, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 0, - "height": 480, - "layer": "", - "name": "Panel", - "persistentUuid": "273f403b-d896-4fa8-81bd-ef1d5d6bd006", - "width": 688, - "x": 0, - "y": 0, - "zOrder": 1, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "editionSettings": { - "grid": false, - "gridType": "rectangular", - "gridWidth": 32, - "gridHeight": 32, - "gridOffsetX": 0, - "gridOffsetY": 0, - "gridColor": 10401023, - "gridAlpha": 0.8, - "snap": false, - "zoomFactor": 1.0174418604651163, - "windowMask": false, - "selectedLayer": "" - }, - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "LeaderboardDialog::LeaderboardDialog::SetScore" - }, - "parameters": [ - "Object", - "=", - "0", - "" - ] - }, - { - "type": { - "value": "LeaderboardDialog::LeaderboardDialog::SetDefaultPlayerName" - }, - "parameters": [ - "Object", - "=", - "DefaultPlayerName", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "LeaderboardDialog::IsInGameEdition" - }, - "parameters": [ - "", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlayerAuthentication::DisplayAuthenticationBanner" - }, - "parameters": [ - "" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PlayerAuthentication::IsPlayerAuthenticated" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "PlayerNameInput", - "Text", - "=", - "PlayerAuthentication::Username()" - ] - }, - { - "type": { - "value": "TextInput::TextInputObject::SetDisabled" - }, - "parameters": [ - "PlayerNameInput", - "yes" - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "LeaderboardDialog::IsInGameEdition" - }, - "parameters": [ - "", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PlayerAuthentication::HasPlayerLoggedIn" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "PlayerNameInput", - "Text", - "=", - "PlayerAuthentication::Username()" - ] - }, - { - "type": { - "value": "TextInput::TextInputObject::SetDisabled" - }, - "parameters": [ - "PlayerNameInput", - "yes" - ] - }, - { - "type": { - "value": "PlayerAuthentication::DisplayAuthenticationBanner" - }, - "parameters": [ - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Leaderboards::IsLeaderboardViewErrored" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "PlayerAuthentication::DisplayAuthenticationBanner" - }, - "parameters": [ - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Handle leaderboards.\nTo create a leaderboard, make sure your game is registered in Home > Profile > Games Dashboard and then, click on \"Manage game\" > Leaderboards. When a leaderboard is created, it should be available in the actions." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" - }, - "parameters": [ - "SubmitTextButton", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PlayerAuthentication::IsPlayerAuthenticated" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "Leaderboards::SaveConnectedPlayerScore" - }, - "parameters": [ - "", - "LeaderboardId", - "Score" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "PlayerAuthentication::IsPlayerAuthenticated" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "Leaderboards::SavePlayerScore" - }, - "parameters": [ - "", - "LeaderboardId", - "Score", - "PlayerNameInput.Text()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "PlayerAuthentication::HideAuthenticationBanner" - }, - "parameters": [ - "" - ] - }, - { - "type": { - "value": "Leaderboards::DisplayLeaderboard" - }, - "parameters": [ - "", - "LeaderboardId", - "yes" - ] - } - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the score.", - "fullName": "Score", - "functionType": "ExpressionAndCondition", - "name": "Score", - "sentence": "the score", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Score" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "Score", - "name": "SetScore", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Score", - "=", - "Value" - ] - }, - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "ScoreLabels", - "Text", - "=", - "ScoreLabelText + Object.FormatScore(Value)" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the best score of the object.", - "fullName": "Best score", - "functionType": "ExpressionAndCondition", - "name": "BestScore", - "sentence": "the best score", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "BestScore" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "BestScore", - "name": "SetBestScore", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "BestScore", - "=", - "Value" - ] - }, - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "BestScoreLabels", - "Text", - "=", - "BestScoreLabelText + Object.FormatScore(Value)" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Return the formated score.", - "fullName": "Format score", - "functionType": "StringExpression", - "name": "FormatScore", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Format", - "=", - "\"Number\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "Prefix + ToString(roundTo(Value, NumberDecimalPoint)) + Suffix" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Format", - "!=", - "\"Number\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "Prefix + LeaderboardDialog::FormatTime(Value, Format) + Suffix" - ] - } - ] - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - }, - { - "description": "Score", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "the default player name.", - "fullName": "Default player name", - "functionType": "ExpressionAndCondition", - "name": "DefaultPlayerName", - "sentence": "the default player name", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "DefaultPlayerName" - ] - } - ] - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "DefaultPlayerName", - "name": "SetDefaultPlayerName", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "DefaultPlayerName", - "=", - "Value" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "PlayerAuthentication::IsPlayerAuthenticated" - }, - "parameters": [] - }, - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "DefaultPlayerName", - "!=", - "\"0\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "PlayerNameInput", - "Text", - "=", - "DefaultPlayerName" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the player name.", - "fullName": "Player name", - "functionType": "ExpressionAndCondition", - "name": "PlayerName", - "sentence": "the player name", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "PlayerNameInput.Text::Value()" - ] - } - ] - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the restart button of the dialog is clicked.", - "fullName": "Restart button clicked", - "functionType": "Condition", - "name": "IsRestartClicked", - "sentence": "Restart button of _PARAM0_ is clicked", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" - }, - "parameters": [ - "RetryTextButton", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlayerAuthentication::HideAuthenticationBanner" - }, - "parameters": [ - "" - ] - }, - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the next button of the dialog is clicked.", - "fullName": "Next button clicked", - "functionType": "Condition", - "name": "IsNextClicked", - "sentence": "Next button of _PARAM0_ is clicked", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" - }, - "parameters": [ - "NextTextButton", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlayerAuthentication::HideAuthenticationBanner" - }, - "parameters": [ - "" - ] - }, - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the back button of the dialog is clicked.", - "fullName": "Back button clicked", - "functionType": "Condition", - "name": "IsBackClicked", - "sentence": "Back button of _PARAM0_ is clicked", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" - }, - "parameters": [ - "BackTextButton", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlayerAuthentication::HideAuthenticationBanner" - }, - "parameters": [ - "" - ] - }, - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the score has been sucessfully submitted by the dialog.", - "fullName": "Score is submitted", - "functionType": "Condition", - "name": "IsScoreSubmitted", - "sentence": "_PARAM0_ submitted a score", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Allow to try and submit again in case of error." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Leaderboards::HasPlayerJustClosedLeaderboardView" - }, - "parameters": [] - }, - { - "type": { - "value": "Leaderboards::HasLastSaveSucceeded" - }, - "parameters": [ - "LeaderboardId" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the leaderboard of the object.", - "fullName": "Leaderboard", - "functionType": "ExpressionAndCondition", - "name": "LeaderboardId", - "sentence": "the leaderboard", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "LeaderboardId" - ] - } - ] - } - ], - "expressionType": { - "type": "leaderboardId" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "LeaderboardId", - "name": "SetLeaderboardId", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "LeaderboardId", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the title of the object.", - "fullName": "Title", - "functionType": "ExpressionAndCondition", - "name": "Title", - "private": true, - "sentence": "the title", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "Title.Text::Value()" - ] - } - ] - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "Title", - "name": "SetTitle", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "Title", - "Text", - "=", - "Value" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", - "type": "object" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "String", - "label": "Default player name", - "name": "DefaultPlayerName" - }, - { - "value": "", - "type": "LeaderboardId", - "label": "Leaderboard", - "name": "LeaderboardId" - }, - { - "value": "0", - "type": "Number", - "unit": "Dimensionless", - "label": "", - "hidden": true, - "name": "Score" - }, - { - "value": "0", - "type": "Number", - "unit": "Dimensionless", - "label": "Best score", - "hidden": true, - "name": "BestScore" - }, - { - "value": "Number", - "type": "Choice", - "label": "Format", - "group": "Score format", - "choices": [ - { - "label": "Number", - "value": "Number" - }, - { - "label": "MM:SS.ms", - "value": "MM:SS.ms" - }, - { - "label": "MM:SS", - "value": "MM:SS" - }, - { - "label": "SS.ms", - "value": "SS.ms" - }, - { - "label": "SS", - "value": "SS" - }, - { - "label": "ms", - "value": "ms" - }, - { - "label": "HH:MM:SS.ms", - "value": "HH:MM:SS.ms" - }, - { - "label": "HH:MM:SS", - "value": "HH:MM:SS" - } - ], - "name": "Format" - }, - { - "value": "", - "type": "String", - "label": "Prefix", - "group": "Score format", - "name": "Prefix" - }, - { - "value": "", - "type": "String", - "label": "Suffix", - "group": "Score format", - "name": "Suffix" - }, - { - "value": "3", - "type": "Number", - "label": "Round to decimal point", - "group": "Score format", - "name": "NumberDecimalPoint" - }, - { - "value": "Score: ", - "type": "String", - "label": "Score label", - "name": "ScoreLabelText" - }, - { - "value": "Best: ", - "type": "String", - "label": "Best score label", - "name": "BestScoreLabelText" - } - ], - "variants": [ - { - "areaMaxX": 688, - "areaMaxY": 480, - "areaMaxZ": 48, - "areaMinX": 0, - "areaMinY": 0, - "areaMinZ": 0, - "name": "Grey and yellow", - "objects": [ - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "ScoreLabel", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [], - "string": "Time:", - "font": "Chango-Regular.ttf", - "textAlignment": "", - "characterSize": 40, - "color": { - "b": 79, - "g": 72, - "r": 72 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Time:", - "font": "Chango-Regular.ttf", - "textAlignment": "", - "verticalTextAlignment": "top", - "characterSize": 40, - "lineHeight": 0, - "color": "72;72;79" - } - }, - { - "assetStoreId": "", - "name": "PlayerNameInput", - "type": "TextInput::TextInputObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "initialValue": "", - "placeholder": "PlayerName", - "fontResourceName": "Chango-Regular.ttf", - "fontSize": 40, - "inputType": "text", - "textColor": "72;72;79", - "fillColor": "231;232;243", - "fillOpacity": 255, - "borderColor": "255;255;255", - "borderOpacity": 255, - "borderWidth": 6, - "readOnly": false, - "disabled": false - } - }, - { - "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", - "name": "SubmitTextButton", - "type": "PanelSpriteButton::PanelSpriteButton", - "variant": "Yellow button 2", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 0, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "LeftPadding": 16, - "RightPadding": 16, - "PressedLabelOffsetY": 10, - "BottomPadding": 32, - "TopPadding": 16, - "HoveredFadeOutDuration": 0.25, - "LabelText": "Send" - } - }, - { - "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", - "name": "RetryTextButton", - "type": "PanelSpriteButton::PanelSpriteButton", - "variant": "Yellow button 2", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 4, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 4, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "LeftPadding": 16, - "RightPadding": 16, - "PressedLabelOffsetY": 10, - "BottomPadding": 32, - "TopPadding": 16, - "HoveredFadeOutDuration": 0.25, - "LabelText": "Restart" - } - }, - { - "assetStoreId": "", - "bottomMargin": 32, - "height": 128, - "leftMargin": 16, - "name": "Panel", - "rightMargin": 16, - "texture": "assets\\Grey Button_Idle.png", - "tiled": false, - "topMargin": 16, - "type": "PanelSpriteObject::PanelSprite", - "width": 128, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - } - ] - }, - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "Title", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "string": "Game over", - "font": "", - "textAlignment": "center", - "characterSize": 60, - "color": { - "b": 79, - "g": 72, - "r": 72 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Game over", - "font": "", - "textAlignment": "center", - "verticalTextAlignment": "top", - "characterSize": 60, - "lineHeight": 0, - "color": "72;72;79" - } - }, - { - "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", - "name": "BackTextButton", - "type": "PanelSpriteButton::PanelSpriteButton", - "variant": "Yellow button 2", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 4, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 4, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "LeftPadding": 16, - "RightPadding": 16, - "PressedLabelOffsetY": 10, - "BottomPadding": 32, - "TopPadding": 16, - "HoveredFadeOutDuration": 0.25, - "LabelText": "Back" - } - }, - { - "adaptCollisionMaskAutomatically": true, - "assetStoreId": "", - "name": "Medal", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [], - "animations": [] - }, - { - "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", - "name": "NextTextButton", - "type": "PanelSpriteButton::PanelSpriteButton", - "variant": "Yellow button 2", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 4, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 4, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "LeftPadding": 16, - "RightPadding": 16, - "PressedLabelOffsetY": 10, - "BottomPadding": 32, - "TopPadding": 16, - "HoveredFadeOutDuration": 0.25, - "LabelText": "Next" - } - }, - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "BestScoreLabel", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [], - "string": "Best:", - "font": "", - "textAlignment": "", - "characterSize": 40, - "color": { - "b": 79, - "g": 72, - "r": 72 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Best:", - "font": "", - "textAlignment": "", - "verticalTextAlignment": "top", - "characterSize": 40, - "lineHeight": 0, - "color": "72;72;79" - } - }, - { - "assetStoreId": "", - "name": "BitmapTitle", - "type": "BitmapText::BitmapTextObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "text": "Game over", - "opacity": 255, - "scale": 1, - "fontSize": 20, - "tint": "255;255;255", - "bitmapFontResourceName": "", - "textureAtlasResourceName": "", - "align": "center", - "verticalTextAlignment": "top" - } - }, - { - "assetStoreId": "", - "name": "BitmapScoreLabel", - "type": "BitmapText::BitmapTextObject", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "text": "Score:", - "opacity": 255, - "scale": 1, - "fontSize": 20, - "tint": "255;255;255", - "bitmapFontResourceName": "", - "textureAtlasResourceName": "", - "align": "left", - "verticalTextAlignment": "top" - } - }, - { - "assetStoreId": "", - "name": "BitmapBestScoreLabel", - "type": "BitmapText::BitmapTextObject", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "text": "Best:", - "opacity": 255, - "scale": 1, - "fontSize": 20, - "tint": "255;255;255", - "bitmapFontResourceName": "", - "textureAtlasResourceName": "", - "align": "left", - "verticalTextAlignment": "top" - } - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "folderName": "Bitmap labels", - "children": [ - { - "objectName": "BitmapTitle" - }, - { - "objectName": "BitmapScoreLabel" - }, - { - "objectName": "BitmapBestScoreLabel" - } - ] - }, - { - "objectName": "Title" - }, - { - "objectName": "ScoreLabel" - }, - { - "objectName": "BestScoreLabel" - }, - { - "objectName": "Medal" - }, - { - "objectName": "PlayerNameInput" - }, - { - "objectName": "SubmitTextButton" - }, - { - "objectName": "RetryTextButton" - }, - { - "objectName": "BackTextButton" - }, - { - "objectName": "NextTextButton" - }, - { - "objectName": "Panel" - } - ] - }, - "objectsGroups": [ - { - "name": "ActionTextButton", - "objects": [ - { - "name": "RetryTextButton" - }, - { - "name": "BackTextButton" - }, - { - "name": "NextTextButton" - } - ] - }, - { - "name": "Titles", - "objects": [ - { - "name": "Title" - }, - { - "name": "BitmapTitle" - } - ] - }, - { - "name": "ScoreLabels", - "objects": [ - { - "name": "ScoreLabel" - }, - { - "name": "BitmapScoreLabel" - } - ] - }, - { - "name": "BestScoreLabels", - "objects": [ - { - "name": "BestScoreLabel" - }, - { - "name": "BitmapBestScoreLabel" - } - ] - } - ], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [ - { - "angle": 0, - "customSize": false, - "height": 71, - "layer": "", - "name": "ScoreLabel", - "persistentUuid": "e0571581-5b6f-4e0b-928a-92dd21b3851d", - "width": 606, - "x": 36, - "y": 41, - "zOrder": 18, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 96, - "layer": "", - "name": "PlayerNameInput", - "persistentUuid": "1b66c419-4bc7-406f-91e7-7deeb515ff67", - "width": 360, - "x": 40, - "y": 160, - "zOrder": 19, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "RetryTextButton", - "persistentUuid": "d9bfca46-e22c-42c9-a581-b88dbe1f5967", - "width": 0, - "x": 224, - "y": 320, - "zOrder": 35, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 48, - "height": 106, - "layer": "", - "name": "SubmitTextButton", - "persistentUuid": "3ad1036e-666f-4a8c-9b85-6d882e192ee8", - "width": 216, - "x": 432, - "y": 150, - "zOrder": 37, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 0, - "height": 480, - "layer": "", - "name": "Panel", - "persistentUuid": "273f403b-d896-4fa8-81bd-ef1d5d6bd006", - "width": 688, - "x": 0, - "y": 0, - "zOrder": 1, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "editionSettings": { - "grid": false, - "gridType": "rectangular", - "gridWidth": 32, - "gridHeight": 32, - "gridOffsetX": 0, - "gridOffsetY": 0, - "gridColor": 10401023, - "gridAlpha": 0.8, - "snap": false, - "zoomFactor": 1.0174418604651163, - "windowMask": false, - "selectedLayer": "" - } - } - ] - } - ] - }, - { - "author": "", - "category": "", - "extensionNamespace": "", - "fullName": "", - "gdevelopVersion": "", - "helpPath": "", - "iconUrl": "", - "name": "AirControl3D", - "previewIconUrl": "", - "shortDescription": "", - "version": "", - "description": "", - "tags": [], - "authorIds": [], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [], - "eventsBasedBehaviors": [ + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "d50d718d-7834-44dd-9d09-a68d411882f3", + "rotationY": 90, + "width": 0, + "x": 736, + "y": 2048, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "b954ca9b-4c6e-4478-9606-4e6bbad0aa1e", + "rotationY": 90, + "width": 0, + "x": 640, + "y": 2048, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "0a095649-4dbc-4c54-a193-66cae16a1879", + "rotationY": 90, + "width": 0, + "x": 544, + "y": 2048, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "2e4839e5-ef94-40e6-b2a6-3671ed98ac00", + "rotationY": 90, + "width": 0, + "x": 448, + "y": 2048, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "3c41c0ed-3526-4fe0-adea-135b38a8555f", + "rotationY": 90, + "width": 0, + "x": 2240, + "y": -928, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "7a5ff952-5e59-45d4-b1be-45e53fcdf281", + "rotationY": 90, + "width": 0, + "x": 2048, + "y": -928, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "502f8c2f-079b-4ee3-8fc2-69e112c4ee13", + "rotationY": 90, + "width": 0, + "x": 2144, + "y": -928, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "SuvLuxury", + "persistentUuid": "9589bc77-0357-4388-b5ec-e1092d0557fe", + "width": 0, + "x": 426, + "y": 449, + "z": 4, + "zOrder": 28, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "fa97679d-81b5-4edf-91ce-a00d4bc798c2", + "width": 0, + "x": 472, + "y": 192, + "z": 4, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "SuvLuxury", + "persistentUuid": "2dd3cdfa-a9aa-4fca-969d-a9b53a744eb2", + "width": 0, + "x": -391, + "y": -835, + "z": 4, + "zOrder": 28, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "c1c8cd46-9a2b-4927-858b-76316c5a95b6", + "width": 0, + "x": -216, + "y": -1087, + "z": 4, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "SuvLuxury", + "persistentUuid": "32547478-ebd7-4242-8afc-5c8f969bd186", + "width": 0, + "x": 1770, + "y": 442, + "z": 4, + "zOrder": 28, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "SuvLuxury", + "persistentUuid": "5f2e97f0-7bb3-457f-925e-d2d38ba0e7ab", + "width": 0, + "x": 1930, + "y": 442, + "z": 4, + "zOrder": 28, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "384c861f-fddd-4481-b559-448e68de9746", + "width": 0, + "x": 2184, + "y": 442, + "z": 4, + "zOrder": 38, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "SuvLuxury", + "persistentUuid": "478f6d08-f51b-46ce-b5ae-a9ad98378e33", + "width": 0, + "x": -1078, + "y": 450, + "z": 4, + "zOrder": 28, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "SuvLuxury", + "persistentUuid": "3fce5402-89bd-4976-a7b4-b4238e485fb3", + "width": 0, + "x": -918, + "y": 450, + "z": 4, + "zOrder": 28, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "acb3437b-84fc-4e7f-8260-5e39448bef0f", + "width": 0, + "x": -662, + "y": 450, + "z": 4, + "zOrder": 38, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "SuvLuxury", + "persistentUuid": "9d4b0ad2-7092-4d04-83ee-25f42217d50b", + "width": 0, + "x": -1014, + "y": -834, + "z": 4, + "zOrder": 28, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "SuvLuxury", + "persistentUuid": "778bca32-1711-492f-a3b0-a7818a0be53a", + "width": 0, + "x": -854, + "y": -834, + "z": 4, + "zOrder": 28, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "50e40d07-e62f-4bbc-95f4-31e3a00b13a7", + "width": 0, + "x": -598, + "y": -834, + "z": 4, + "zOrder": 38, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "db6379dd-828b-4b97-8c34-1e3aefd16053", + "width": 0, + "x": 616, + "y": 192, + "z": 4, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "24c0eb97-df17-4ec3-b525-6775f3e4b171", + "width": 0, + "x": -168, + "y": 3522, + "z": 4, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "3867bff0-bc6b-4cde-bd55-aa0e1acb951f", + "width": 0, + "x": -392, + "y": 3522, + "z": 4, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "573153a2-d34f-4f7d-a078-d591f21417dd", + "width": 0, + "x": 1267, + "y": -1099, + "z": 4, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "6c3d140a-a1d9-4713-be38-d77dadcc147a", + "width": 0, + "x": 1427, + "y": -1099, + "z": 4, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "2cc2aad3-8095-45bf-b31c-3ea4c53a54fe", + "width": 0, + "x": 2247, + "y": -1086, + "z": 4, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "SuvLuxury", + "persistentUuid": "e5a60d8e-77ff-4627-af10-ad2af0055da7", + "width": 0, + "x": 2102, + "y": -1085, + "z": 4, + "zOrder": 39, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "bc21ef32-eb2c-4588-8535-9bbaf10b0fe8", + "width": 0, + "x": 1642, + "y": 195, + "z": 4, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "SuvLuxury", + "persistentUuid": "634c6020-2d28-47be-b2e4-2f0acdff4326", + "width": 0, + "x": 1514, + "y": 195, + "z": 4, + "zOrder": 39, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "c2d673cd-0b27-4ab6-b26b-641469b9514b", + "width": 0, + "x": 1962, + "y": 1858, + "z": 4, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "SuvLuxury", + "persistentUuid": "f1ea9686-2334-44fb-8dc3-981db82aea0d", + "width": 0, + "x": 1834, + "y": 1858, + "z": 4, + "zOrder": 39, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "8f939289-ce00-49c8-8646-515c85580db9", + "width": 1536, + "x": -1536, + "y": 3456, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "cb18e3ac-db07-44c5-8746-0baeeadebe74", + "width": 0, + "x": 384, + "y": 1792, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "dff9b457-42ce-4d46-a93e-a8bd0f44030f", + "width": 1152, + "x": 1152, + "y": 1792, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "27286779-2ffd-4ad3-affe-39dbdbc8ef75", + "width": 1152, + "x": 1152, + "y": 128, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "9ed137cb-69e5-4d3c-8acd-f81b10baedc1", + "width": 1536, + "x": -1536, + "y": -1152, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "75d41047-aac4-492d-a434-7c292fdc5932", + "width": 0, + "x": 384, + "y": -1152, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "6bb6f7ac-9bdb-400d-bf70-164a7fe5bfec", + "width": 0, + "x": 384, + "y": 128, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "3fcc1379-d254-481e-bad2-bc5d4c12de0d", + "width": 896, + "x": -256, + "y": -512, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "b3fcfd40-daf0-4ac0-8ff4-c1ddcf9dcb2f", + "width": 896, + "x": 512, + "y": -512, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "e9045c79-8c9f-433c-87f1-489cd7c5d8b5", + "width": 1280, + "x": 1856, + "y": 960, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "f7b9a20a-970f-46a1-a0a9-2345c3082812", + "width": 1280, + "x": 320, + "y": 960, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "c382140e-8041-4b53-b182-4d3afef43ceb", + "width": 1280, + "x": -448, + "y": 960, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "f97d31b2-91e4-4d98-8ec8-894830e52c4f", + "width": 896, + "x": -2176, + "y": 1152, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "92323d5f-fd91-4f0c-b2ba-7bed3b8a28a9", + "width": 896, + "x": -2176, + "y": -512, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "9ce5b297-a47a-4ca1-978f-48440f38ed59", + "width": 1536, + "x": -1536, + "y": 128, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadCrossroadPath", + "persistentUuid": "a65bdf09-c0a8-40f2-bef2-dcde130625b7", + "width": 0, + "x": 768, + "y": 128, + "zOrder": 43, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadCrossroadPath", + "persistentUuid": "efa57fb9-dd0b-431b-ba97-e56bd554f4cb", + "width": 0, + "x": 0, + "y": 128, + "zOrder": 43, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadIntersectionPath", + "persistentUuid": "eb323bf0-2c9f-470d-8f30-7b79ca5b1c15", + "width": 0, + "x": 768, + "y": 1792, + "zOrder": 44, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadIntersectionPath", + "persistentUuid": "92e15216-85fa-4eeb-bb9a-04d8f369f724", + "width": 0, + "x": 0, + "y": -1152, + "zOrder": 44, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadIntersectionPath", + "persistentUuid": "a5d5abcc-c6db-41b5-9eed-36f231b1422f", + "width": 0, + "x": -1920, + "y": 128, + "zOrder": 44, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": -90, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadIntersectionPath", + "persistentUuid": "e8b0b84a-62f4-453c-beca-103132724997", + "width": 0, + "x": 2304, + "y": 128, + "zOrder": 44, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadBend", + "persistentUuid": "e22cf8f0-a157-4ec5-9e42-663c7f0af27b", + "width": 0, + "x": -1920, + "y": 3456, + "zOrder": 45, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 315, + "customSize": false, + "height": 0, + "layer": "", + "name": "CommonTree", + "persistentUuid": "52d896d4-1113-4367-94bf-9398965ca670", + "width": 0, + "x": -989, + "y": 765, + "zOrder": 46, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 61, + "customSize": false, + "height": 0, + "layer": "", + "name": "CommonTree", + "persistentUuid": "10990ae3-86ae-4dc3-af87-9f72cfbed80e", + "width": 0, + "x": -230, + "y": 958, + "zOrder": 46, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 274, + "customSize": false, + "height": 0, + "layer": "", + "name": "CommonTree", + "persistentUuid": "79f0c61e-6546-421b-bdb9-fef257734726", + "width": 0, + "x": -1057, + "y": 1403, + "zOrder": 46, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 57, + "customSize": false, + "height": 0, + "layer": "", + "name": "CommonTree", + "persistentUuid": "85b17f12-f2b5-45c8-b365-ddfbbef7f2a0", + "width": 0, + "x": 2086, + "y": -274, + "zOrder": 46, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 299, + "customSize": false, + "height": 0, + "layer": "", + "name": "CommonTree", + "persistentUuid": "e45f54e4-ed85-40d5-98eb-a3d7c77285d3", + "width": 0, + "x": 1495, + "y": -270, + "zOrder": 46, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 348, + "customSize": false, + "height": 0, + "layer": "", + "name": "CommonTree", + "persistentUuid": "da1362be-1156-4cd4-af4b-891bb73a43fa", + "width": 0, + "x": 1660, + "y": -579, + "zOrder": 46, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 100, + "height": 12160, + "layer": "", + "locked": true, + "name": "Grass", + "persistentUuid": "05276cd6-3502-4c9d-a19e-58308fbbb417", + "sealed": true, + "width": 14080, + "x": -6784, + "y": -5376, + "z": -100, + "zOrder": 47, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "0866ad67-4291-45e1-bd2e-acb5d17c92fc", + "width": 665, + "x": 2163, + "y": -1152, + "z": 134, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "baab3977-f3bb-4c36-a33e-6d2972b42526", + "rotationY": -10, + "width": 768, + "x": 2112, + "y": -1862, + "z": 67, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadCrossroadPath", + "persistentUuid": "5961bfb2-8241-47f6-a034-a6e49fcdc2fb", + "width": 0, + "x": 768, + "y": -1152, + "zOrder": 43, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadBend", + "persistentUuid": "d263b9dc-1a77-4310-9793-2f190eba291b", + "width": 0, + "x": 768, + "y": -2432, + "zOrder": 45, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "a6b06625-0a37-4a1d-9bab-1a76ab861f03", + "width": 1152, + "x": 1152, + "y": -2432, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "c3bad554-72dc-45f0-8a9b-2c66cc1f0aaa", + "width": 896, + "x": 512, + "y": -1792, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "da682bb0-4557-458e-b5ea-b32e8262032c", + "width": 2688, + "x": 1152, + "y": -1152, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadIntersectionPath", + "persistentUuid": "20ad94a9-ce9e-43fc-a13e-f0016396863f", + "width": 0, + "x": 2304, + "y": -2432, + "zOrder": 44, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "057fa597-6ecc-4bff-806a-e19758e1663c", + "width": 1152, + "x": 2688, + "y": -2432, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": -90, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadBend", + "persistentUuid": "354d04e4-df29-449f-91b1-aac59a19afa0", + "width": 0, + "x": 3840, + "y": -1152, + "zOrder": 45, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadBend", + "persistentUuid": "a007e09f-46d4-456a-b9b2-ded15847a436", + "width": 0, + "x": 3840, + "y": -2432, + "zOrder": 45, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "e7d0d051-a9cb-4789-9a0b-ca84f0c2d2e4", + "width": 896, + "x": 3584, + "y": -1792, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": -90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "a836ecad-7cb3-4928-b975-bc2e24743699", + "rotationY": -10, + "width": 768, + "x": 2112, + "y": -442, + "z": 67, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "95ef1e5a-74b1-4e83-83b9-b2efbf806d58", + "width": 0, + "x": -960, + "y": -128, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "febbfff0-96f7-4aa7-8824-e2c255f59eb0", + "width": 0, + "x": -576, + "y": 64, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "e6c94a26-8c81-4c05-8e45-151e85f1b377", + "width": 0, + "x": -128, + "y": -320, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "7fbca3aa-2a94-4cb9-b9e1-60168fcdd3a6", + "width": 0, + "x": -192, + "y": 0, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "4f4d0089-55cf-4503-801d-40c9028a06b4", + "width": 0, + "x": -1472, + "y": -320, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "42935809-851d-4def-8303-3db218ba2166", + "width": 0, + "x": -960, + "y": -640, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "86397906-b3ad-405f-813d-586b8a72fbed", + "width": 0, + "x": -192, + "y": -640, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "8c3e300a-b991-44e1-8d2f-c12129ca95d4", + "width": 0, + "x": -576, + "y": -704, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "6c1f5561-24c8-4305-a22c-8604162282fa", + "width": 0, + "x": 576, + "y": 64, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "7bcc160b-2587-452e-b7e4-68b584cbc754", + "width": 0, + "x": 576, + "y": -704, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "5d87155a-1c5d-41b6-bc1f-e102fef4e92f", + "width": 0, + "x": 512, + "y": -448, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "d7b328c3-82a1-4035-b6bc-80091cb3ccb1", + "width": 0, + "x": 704, + "y": -448, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "fd10ab85-50ef-448a-8074-4464bb4cda43", + "width": 0, + "x": 576, + "y": -128, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "f38817e1-18ec-4228-8963-c7695c2af241", + "width": 0, + "x": 576, + "y": 1728, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "649c4082-ff47-44cd-b0f2-0bd27024ac52", + "width": 0, + "x": 576, + "y": 576, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "a048fa2c-7f7e-490e-86f3-2e75bc2f8a5c", + "width": 0, + "x": 512, + "y": 832, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "f98ac4e1-de20-46bf-886b-52017a7ae87a", + "width": 0, + "x": 704, + "y": 832, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "2353214c-8af5-4b43-8ab8-b2cec80398da", + "width": 0, + "x": 576, + "y": 1152, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "5509575e-7090-4fe2-a614-e02f10db8663", + "width": 0, + "x": 1728, + "y": 1728, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "6d1b66fc-01e6-46ae-8c77-09900f3d6e33", + "width": 0, + "x": 2048, + "y": 960, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "4766be12-e1f3-44ec-89a9-6fc331da38d5", + "width": 0, + "x": 2112, + "y": 1664, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "3940ad48-378a-48e3-9d92-cedcb10308d2", + "width": 0, + "x": 1216, + "y": 960, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "3e4187c0-4978-4d33-a7f7-64ea7ff9548d", + "width": 0, + "x": 1344, + "y": 640, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "1406f52f-153c-4b10-baa4-6b5fdda54048", + "width": 0, + "x": 2112, + "y": 640, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "ccd4a0fa-581c-4933-a10b-f2c1ef120793", + "width": 0, + "x": 1728, + "y": 576, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "3554af30-b961-4eaf-9cf5-0ad3540bff95", + "width": 0, + "x": -1344, + "y": 0, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "e7a083e6-6a13-49ad-a89d-a308b067bc39", + "width": 0, + "x": -1344, + "y": -640, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "4a6b79d5-04d7-41dc-b298-f1c4b4489cff", + "width": 0, + "x": -576, + "y": -128, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "a8218166-4a3c-472b-a07d-204129798258", + "width": 0, + "x": -576, + "y": -512, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "e908618e-e7cc-4045-8b46-94621aaddd5f", + "width": 0, + "x": -1280, + "y": -320, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "8b08aee5-40d7-4e88-baaa-724339da2676", + "width": 0, + "x": 1408, + "y": 960, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "9e417898-319c-4686-821f-0d3aae0cf39c", + "width": 0, + "x": 1728, + "y": 768, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "129fd98d-d1a0-437e-a303-34c6704dca48", + "width": 0, + "x": 1600, + "y": 1536, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadCrossroadPath", + "persistentUuid": "db65c2fe-8864-4796-9737-ebcb9e7ef71b", + "width": 0, + "x": 0, + "y": 1792, + "zOrder": 43, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "bc0f10ae-6f79-40a2-bcd9-454922ec5aa7", + "width": 0, + "x": 640, + "y": 1472, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "f4fe86be-f476-419f-a8c2-cdb7290fb99a", + "width": 0, + "x": 448, + "y": 1472, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "b8cbd6c9-29ac-404f-a499-8849d840e357", + "width": 0, + "x": 1280, + "y": 1344, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "f8d1e4c8-24fd-4314-a8ad-c36720f56fcd", + "width": 0, + "x": 2240, + "y": 1344, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "8a03770e-07a6-419b-95dd-6295893ecfa7", + "width": 0, + "x": 2048, + "y": 1344, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadIntersectionPath", + "persistentUuid": "a397dd3b-81d1-4a3f-922d-dcd5defd35e0", + "width": 0, + "x": -1920, + "y": 1792, + "zOrder": 44, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "85f422a3-4acc-410b-846f-8a18820411c9", + "width": 1536, + "x": -1536, + "y": 1792, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "30e259c2-b893-48d6-b07b-c3b0de682167", + "width": 0, + "x": -960, + "y": 3200, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "9818f0b2-49d6-4351-8d89-27dd81b1e6f8", + "width": 0, + "x": -576, + "y": 3392, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "0e519ba6-bc33-45f5-878b-06e37ec35d59", + "width": 0, + "x": -256, + "y": 2624, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "79060b35-70d2-4426-946f-02b7d702354b", + "width": 0, + "x": -192, + "y": 3328, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "3dafd08a-bc5a-4d6d-af3e-e57eb432a56d", + "width": 0, + "x": -1472, + "y": 2624, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "f7963d9e-d1c6-4505-8e74-c0a17c473b7e", + "width": 0, + "x": -960, + "y": 2304, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "0ee005d2-a09c-4d0c-a33b-27364608dd73", + "width": 0, + "x": -192, + "y": 2304, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "16c1e9a8-7cc9-4fee-8d01-d3372e4d5e81", + "width": 0, + "x": -576, + "y": 2240, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "51eab286-233a-4cd3-bd7f-2bad20a6a2de", + "width": 0, + "x": -1344, + "y": 3328, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "69a45893-74cb-4f02-b3dd-4d3ec60cfc75", + "width": 0, + "x": -1344, + "y": 2304, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "52324b1a-e783-4ce6-8e63-0cedbcb8ce20", + "width": 0, + "x": -576, + "y": 3200, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "b5ceb42e-5a5f-48f7-ba7f-3fdd7c029004", + "width": 0, + "x": -576, + "y": 2432, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "5d16e34c-fa37-4980-8d2d-ba7d59b70ce5", + "width": 0, + "x": -1280, + "y": 2624, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "8597e021-5cf8-4527-a84e-be8866d231cf", + "width": 0, + "x": -1280, + "y": 3008, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "3ef7e679-1788-43c0-a483-2d95bc7ba2e1", + "width": 0, + "x": -64, + "y": 3008, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "57c955bf-7628-4e0d-ae4e-94bad825c46b", + "width": 0, + "x": -256, + "y": 3008, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "cafa31dd-6a62-47eb-888e-01102ffb26a8", + "width": 1280, + "x": -448, + "y": 2624, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "f5e3da38-0e7f-4a2d-a67c-cc94237894de", + "width": 384, + "x": -1920, + "y": 2176, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "12c47bb0-be33-4a62-9704-9221aeb0cf9b", + "rotationY": 90, + "width": 0, + "x": 1056, + "y": 3584, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "d704a44e-8c28-470c-97d7-3a18110b9249", + "rotationY": 90, + "width": 0, + "x": 864, + "y": 3584, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "c26ba544-05c0-4616-b18c-85093d694e23", + "rotationY": 90, + "width": 0, + "x": 960, + "y": 3584, + "z": 21, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "1e5faafc-0bda-492c-af93-c27000718f46", + "width": 0, + "x": 2136, + "y": 3522, + "z": 4, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "5676bf7a-da5c-47dd-9b3c-6133f151fc78", + "width": 0, + "x": 1528, + "y": 3522, + "z": 4, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "505fcfa8-b875-4017-b97a-a3180a21db6c", + "width": 1920, + "x": 384, + "y": 3456, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "670a9aed-5b62-4372-8ef0-7f2753671574", + "width": 0, + "x": 960, + "y": 3200, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "131d5b79-9334-4560-bb45-1853f4ee8409", + "width": 0, + "x": 1344, + "y": 3392, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "0a245aa6-4d32-47dc-862b-6a1e0c383fe1", + "width": 0, + "x": 2048, + "y": 2624, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "72522327-805e-44c9-ab71-fdde779cfa65", + "width": 0, + "x": 2112, + "y": 3328, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "5ff3314b-0821-45c6-bb61-43342f73487b", + "width": 0, + "x": 448, + "y": 2624, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "8e855d0d-dcc3-40df-81e7-4f7ec1af34d4", + "width": 0, + "x": 1728, + "y": 2432, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "dc228875-2528-44f3-8b59-93dfdb22f738", + "width": 0, + "x": 2112, + "y": 2304, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "9c3d5bba-3a57-4195-83a9-d138fa5bba85", + "width": 0, + "x": 960, + "y": 2240, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "94264588-2af8-4601-babd-82a8707c4d48", + "width": 0, + "x": 576, + "y": 3328, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "f00e1f37-e3dc-4e6c-8c48-06d721cd293b", + "width": 0, + "x": 576, + "y": 2304, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "94215059-7baf-45a8-94cb-6e9c0e6e7ed1", + "width": 0, + "x": 1344, + "y": 3200, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, { - "description": "Turn and move objects forward.", - "fullName": "3D air control", - "name": "AirControl3D", - "objectType": "", - "quickCustomizationVisibility": "hidden", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "HasPressedMoveBackward", - "True", - "" - ] - }, - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "HasPressedMoveForward", - "True", - "" - ] - } - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "HasPressedMoveBackward", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "CurrentForce", - "=", - "-Force" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "HasPressedMoveForward", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "CurrentForce", - "=", - "Force" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Physics3D::Physics3DBehavior::ApplyForceAtCenter" - }, - "parameters": [ - "Object", - "Physics3D", - "XFromAngleAndDistance(Object.Angle(), CurrentForce)", - "YFromAngleAndDistance(Object.Angle(), CurrentForce)", - "0" - ] - } - ] - } - ], - "variables": [ - { - "name": "CurrentForce", - "type": "number", - "value": 0 - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "AirControl3D::AirControl3D", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Simulate a press of the move backward key.", - "fullName": "Simulate move backward key press", - "functionType": "Action", - "group": "Top-down walk state", - "name": "SimulateMoveBackwardKey", - "sentence": "Simulate pressing move backward key for _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "HadPressedMoveBackward", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "HasPressedMoveBackwardLast", - "True", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "HasPressedMoveBackward", - "True", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "AirControl3D::AirControl3D", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Simulate a press of the move forward key.", - "fullName": "Simulate move forward key press", - "functionType": "Action", - "group": "Top-down walk state", - "name": "SimulateMoveForwardKey", - "sentence": "Simulate pressing move forward key for _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "HadPressedMoveForward", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "HasPressedMoveBackwardLast", - "False", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "HasPressedMoveForward", - "True", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "AirControl3D::AirControl3D", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "3D physics engine", - "extraInformation": [ - "Physics3D::Physics3DBehavior" - ], - "choices": [], - "name": "Physics3D" - }, - { - "value": "4000", - "type": "Number", - "unit": "Newton", - "label": "Force", - "name": "Force" - }, - { - "value": "", - "type": "Boolean", - "label": "", - "hidden": true, - "name": "HasPressedMoveForward" - }, - { - "value": "", - "type": "Boolean", - "label": "", - "hidden": true, - "name": "HasPressedMoveBackward" - } - ], - "sharedPropertyDescriptors": [ - { - "value": "0", - "type": "Number", - "label": "", - "hidden": true, - "name": "Cos" - }, - { - "value": "0", - "type": "Number", - "label": "", - "name": "Sin" - } - ] - } - ], - "eventsBasedObjects": [] - } - ], - "externalLayouts": [ - { - "associatedLayout": "Game", - "name": "Level1", - "instances": [ + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "d03f1ecc-4a49-42cc-aa64-dd21d98a82ea", + "width": 0, + "x": 960, + "y": 2432, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "523a2321-57df-4e52-8ead-5b949450d94f", + "width": 0, + "x": 640, + "y": 2624, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "13c701ed-5ff4-4304-8c59-93fce9cf07cd", + "width": 0, + "x": 512, + "y": 3008, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "21529fc4-6d4b-4127-b82c-2048830066d4", + "width": 0, + "x": 2240, + "y": 3008, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "f841b7a8-06dd-4580-85fa-d5d0d7aa50cc", + "width": 0, + "x": 2048, + "y": 3008, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": -90, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadBend", + "persistentUuid": "a1fc6e36-f48e-4397-b2f0-a3e72067e730", + "width": 0, + "x": 2304, + "y": 3456, + "zOrder": 45, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "42b9f2bc-f14c-4fd2-8d9c-aab2c4c8413e", + "width": 1280, + "x": 1856, + "y": 2624, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, { "angle": 0, "customSize": false, - "height": 159.1836734693878, + "height": 0, "keepRatio": true, "layer": "", - "name": "Player", - "persistentUuid": "894bdbd1-6dc0-474b-ae8a-1ced5a9cc957", - "width": 300, - "x": -1407, - "y": 268, - "z": 10, - "zOrder": 26, + "name": "LargeBuildingA", + "persistentUuid": "2edcf5be-e3b1-4b22-a305-fa92c1be5a48", + "width": 0, + "x": 1728, + "y": 3328, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "ce651f5b-6053-4a4d-8e7d-60dee9918dd3", + "width": 0, + "x": 1344, + "y": 2432, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": -90, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadIntersectionPath", + "persistentUuid": "e89950f8-353b-4f24-969c-2c5b3c244db3", + "width": 0, + "x": 2304, + "y": 1792, + "zOrder": 44, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadIntersectionPath", + "persistentUuid": "262650d6-cf38-46b4-be2d-3fb4413ca479", + "width": 0, + "x": 0, + "y": 3456, + "zOrder": 44, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -45615,11 +4438,11 @@ "height": 0, "layer": "", "name": "Coin", - "persistentUuid": "0da5d162-ce33-441f-a8d3-ff017d2fd2d5", + "persistentUuid": "c859da86-521b-4f27-b455-b513b6ea9fae", "rotationY": 90, "width": 0, - "x": 1664, - "y": 371, + "x": -2560, + "y": -909, "z": 21, "zOrder": 27, "numberProperties": [], @@ -45632,11 +4455,11 @@ "height": 0, "layer": "", "name": "Coin", - "persistentUuid": "86323d49-bfee-409d-910f-fdeea6999501", + "persistentUuid": "a73d55ae-1ec2-488b-b55c-6930f485974d", "rotationY": 90, "width": 0, - "x": 1568, - "y": 371, + "x": -2656, + "y": -909, "z": 21, "zOrder": 27, "numberProperties": [], @@ -45649,11 +4472,11 @@ "height": 0, "layer": "", "name": "Coin", - "persistentUuid": "d490a1e4-922e-4837-9160-56f76758c8b6", + "persistentUuid": "6c9e3364-2e91-4303-b317-5bce64b09119", "rotationY": 90, "width": 0, - "x": 1472, - "y": 371, + "x": -2752, + "y": -909, "z": 21, "zOrder": 27, "numberProperties": [], @@ -45666,11 +4489,11 @@ "height": 0, "layer": "", "name": "Coin", - "persistentUuid": "36890c73-8149-4297-981e-d83555bf4dcb", + "persistentUuid": "bb8f1831-e855-41ad-bd31-30e614b65e25", "rotationY": 90, "width": 0, - "x": 1376, - "y": 371, + "x": -2848, + "y": -909, "z": 21, "zOrder": 27, "numberProperties": [], @@ -45683,11 +4506,11 @@ "height": 0, "layer": "", "name": "Coin", - "persistentUuid": "d392011b-0dab-4705-93c6-1565cede70d6", + "persistentUuid": "b07ee07d-86f5-4e59-a7b0-b6c5171099af", "rotationY": 90, "width": 0, - "x": -1664, - "y": 1120, + "x": -1984, + "y": 640, "z": 21, "zOrder": 27, "numberProperties": [], @@ -45700,11 +4523,11 @@ "height": 0, "layer": "", "name": "Coin", - "persistentUuid": "4e80ac91-a9c6-421d-84fb-da675ade03ca", + "persistentUuid": "b1bfa08d-a764-4321-9e9d-9c30b4519ce8", "rotationY": 90, "width": 0, - "x": -1661, - "y": 1309, + "x": -2176, + "y": 640, "z": 21, "zOrder": 27, "numberProperties": [], @@ -45717,11 +4540,11 @@ "height": 0, "layer": "", "name": "Coin", - "persistentUuid": "3f567b7d-564a-4d42-95b9-421816917e0f", + "persistentUuid": "c46f85dc-d5ca-4c5b-8031-2a5a3f958d92", "rotationY": 90, "width": 0, - "x": -864, - "y": 3708, + "x": -2080, + "y": 640, "z": 21, "zOrder": 27, "numberProperties": [], @@ -45733,14 +4556,13 @@ "customSize": false, "height": 0, "layer": "", - "name": "Coin", - "persistentUuid": "84e79653-7e26-4fef-875f-5e858a03fbf9", - "rotationY": 90, + "name": "SuvLuxury", + "persistentUuid": "3e4491d4-692c-4b61-a094-42cb08bc447e", "width": 0, - "x": -1056, - "y": 3708, - "z": 21, - "zOrder": 27, + "x": -2454, + "y": -838, + "z": 4, + "zOrder": 28, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -45750,14 +4572,378 @@ "customSize": false, "height": 0, "layer": "", - "name": "Coin", - "persistentUuid": "eeda5d0e-06b7-4c85-bf36-c3092ccc8d9f", - "rotationY": 90, + "name": "SuvLuxury", + "persistentUuid": "7b26b94b-35ec-42fa-b86f-82e32c55623d", "width": 0, - "x": 544, - "y": 260, - "z": 21, - "zOrder": 27, + "x": -2294, + "y": -838, + "z": 4, + "zOrder": 28, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "4353bab1-3f88-4232-96b2-99ca1f98b2a8", + "width": 0, + "x": -2040, + "y": -838, + "z": 4, + "zOrder": 38, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "f305adba-bcf1-4248-9154-05d17d0cadc7", + "width": 0, + "x": -2582, + "y": -1085, + "z": 4, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "SuvLuxury", + "persistentUuid": "212ed022-9390-4cf7-a4f9-44bff1871667", + "width": 0, + "x": -2710, + "y": -1085, + "z": 4, + "zOrder": 39, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "7902e61e-184e-4054-b623-832507695fb4", + "width": 0, + "x": -2262, + "y": 578, + "z": 4, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "SuvLuxury", + "persistentUuid": "d7618275-6fb6-4bee-a5a8-2a6f5d9cec01", + "width": 0, + "x": -2390, + "y": 578, + "z": 4, + "zOrder": 39, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "71dd5bd5-5081-4456-808f-07f6b36b3458", + "width": 1152, + "x": -3072, + "y": 512, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "589c0d9d-3def-4da2-9a78-9c27a3234ddc", + "width": 1152, + "x": -3072, + "y": -1152, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "1c38b5b1-b741-49f1-8e67-402ec9cea5ae", + "width": 1280, + "x": -3904, + "y": -320, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "5998a7f0-e369-4836-9ef5-5663a87fbb5f", + "width": 0, + "x": -2880, + "y": 384, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "d7aece1e-37c8-46e4-9102-64e16e39b2a6", + "width": 0, + "x": -2496, + "y": 448, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "bc10635b-5e4e-4947-aa41-1ffe1fdd46d0", + "width": 0, + "x": -2048, + "y": -320, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "42a5d940-6fcf-4f93-bd2e-b649a3ef4d54", + "width": 0, + "x": -2992, + "y": -320, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "3114781d-439c-4092-97a5-9fea19bd3484", + "width": 0, + "x": -2880, + "y": -640, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "e705f10b-f9b2-448c-9d3a-1ea8d75c6090", + "width": 0, + "x": -2112, + "y": -640, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "e8525fb0-4377-4e96-8478-d818d10cf3a7", + "width": 0, + "x": -2496, + "y": -704, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "d5d9b093-a2cc-4e24-b20d-97dc5c73c22f", + "width": 0, + "x": -2816, + "y": -320, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "066d761b-d1ad-418f-85b0-2092918d04ca", + "width": 0, + "x": -2496, + "y": -512, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "7d99af49-c26d-4324-a85f-7bc7d79b3ee1", + "width": 0, + "x": -2240, + "y": 256, + "zOrder": 48, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingA", + "persistentUuid": "7a6b3b71-1702-4d7f-bef0-19f17e813745", + "width": 0, + "x": -2816, + "y": 64, + "zOrder": 50, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 270, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "LargeBuildingF", + "persistentUuid": "a33e9c0f-a1d9-4677-81c3-4630f53f1555", + "width": 0, + "x": -1984, + "y": 64, + "zOrder": 49, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadIntersectionPath", + "persistentUuid": "48c14d38-4885-4341-b9cc-25f79a337840", + "width": 0, + "x": -1920, + "y": -1152, + "zOrder": 44, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": -90, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadIntersectionPath", + "persistentUuid": "b7a6e433-4d6c-4c70-a87c-6c2e0b22a949", + "width": 0, + "x": -1920, + "y": 512, + "zOrder": 44, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "RoadBend", + "persistentUuid": "b513f37a-9788-4ca8-ad24-a10607a409be", + "width": 0, + "x": -3456, + "y": -1152, + "zOrder": 45, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -45768,11 +4954,11 @@ "height": 0, "layer": "", "name": "Coin", - "persistentUuid": "274b66e4-c95e-4374-add9-c1db8090bf6d", + "persistentUuid": "cbd66354-aa75-4dbb-a3e8-279964278708", "rotationY": 90, "width": 0, - "x": 448, - "y": 260, + "x": -1984, + "y": 2750, "z": 21, "zOrder": 27, "numberProperties": [], @@ -45785,11 +4971,11 @@ "height": 0, "layer": "", "name": "Coin", - "persistentUuid": "eb1a46fb-2f6b-4f05-8932-eb9d7072b3ca", + "persistentUuid": "b9d44291-2f67-4945-9cf5-fc46e2373c43", "rotationY": 90, "width": 0, - "x": 640, - "y": 260, + "x": -2176, + "y": 2750, "z": 21, "zOrder": 27, "numberProperties": [], @@ -45802,11 +4988,11 @@ "height": 0, "layer": "", "name": "Coin", - "persistentUuid": "b619af0b-588c-42ab-b98e-add403b1c6f7", + "persistentUuid": "1ba16ea5-93e3-424c-91cf-17a1c708f31d", "rotationY": 90, "width": 0, - "x": 736, - "y": 260, + "x": -2080, + "y": 2750, "z": 21, "zOrder": 27, "numberProperties": [], @@ -45819,11 +5005,11 @@ "height": 0, "layer": "", "name": "Coin", - "persistentUuid": "464e62ae-e49a-46ec-b81c-3ffff428122b", + "persistentUuid": "93ec0aa2-0322-46e8-bd55-9cc9f11dde20", "rotationY": 90, "width": 0, - "x": -192, - "y": 384, + "x": -1946, + "y": 2517, "z": 21, "zOrder": 27, "numberProperties": [], @@ -45831,69 +5017,113 @@ "initialVariables": [] }, { - "angle": 0, + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "SuvLuxury", + "persistentUuid": "fdeae199-6038-4af9-8471-6983634af29b", + "width": 0, + "x": -2454, + "y": 791, + "z": 4, + "zOrder": 28, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "SuvLuxury", + "persistentUuid": "8e164f83-fe1e-4c63-8b3d-e66a756aba3a", + "width": 0, + "x": -2294, + "y": 791, + "z": 4, + "zOrder": 28, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Van", + "persistentUuid": "83bfb37d-c6d0-41a9-bdd2-5b502ea7aa54", + "width": 0, + "x": -2040, + "y": 791, + "z": 4, + "zOrder": 38, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 180, "customSize": false, "height": 0, "layer": "", - "name": "Coin", - "persistentUuid": "ffe78002-8cb0-45e8-953f-65648fe0bb6b", - "rotationY": 90, + "name": "Van", + "persistentUuid": "46b869c6-e23b-441f-a55f-582b0964331b", "width": 0, - "x": -288, - "y": 384, - "z": 21, - "zOrder": 27, + "x": -2262, + "y": 2626, + "z": 4, + "zOrder": 37, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 180, "customSize": false, "height": 0, "layer": "", - "name": "Coin", - "persistentUuid": "d5856c94-5ca4-4e9c-ad8a-27f64107011a", - "rotationY": 90, + "name": "SuvLuxury", + "persistentUuid": "ea735180-6642-4fa4-ab42-c868975d232c", "width": 0, - "x": -384, - "y": 384, - "z": 21, - "zOrder": 27, + "x": -2390, + "y": 2626, + "z": 4, + "zOrder": 39, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { "angle": 0, - "customSize": false, - "height": 0, + "customSize": true, + "depth": 8, + "height": 384, "layer": "", - "name": "Coin", - "persistentUuid": "c6cffc5d-5845-469a-a163-11f925f31309", - "rotationY": 90, - "width": 0, - "x": -480, - "y": 384, - "z": 21, - "zOrder": 27, + "name": "RoadStraight", + "persistentUuid": "29a0fefb-02c6-45ce-bf9b-90b4f83d9b34", + "width": 1152, + "x": -3072, + "y": 2560, + "zOrder": 42, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, - "customSize": false, - "height": 0, + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, "layer": "", - "name": "Coin", - "persistentUuid": "37983f2a-555b-4705-a7de-88a8f5145ed4", - "rotationY": 90, - "width": 0, - "x": -1664, - "y": 1216, - "z": 21, - "zOrder": 27, + "name": "RoadStraight", + "persistentUuid": "af6bdbde-6c09-45fa-91fb-2e4f14c2d22e", + "width": 1665, + "x": -4096, + "y": 1536, + "zOrder": 42, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -45902,15 +5132,14 @@ "angle": 0, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "cc3ff3ba-91eb-4e5d-b982-61d5bbedae1e", - "rotationY": 90, + "name": "LargeBuildingA", + "persistentUuid": "2423ce72-6cd9-4419-9606-6080457124bf", "width": 0, - "x": -960, - "y": 3708, - "z": 21, - "zOrder": 27, + "x": -2880, + "y": 2432, + "zOrder": 48, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -45919,32 +5148,30 @@ "angle": 0, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "84e5efdd-e8b2-4eec-a5c8-53026c16cd7c", - "rotationY": 90, + "name": "LargeBuildingF", + "persistentUuid": "039a2ae3-f429-4bf9-8d54-a06d26294aa7", "width": 0, - "x": 2240, - "y": 2046, - "z": 21, - "zOrder": 27, + "x": -2496, + "y": 2480, + "zOrder": 49, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 90, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "2c168740-81d7-4fc4-9470-16f9c927628d", - "rotationY": 90, + "name": "LargeBuildingA", + "persistentUuid": "9ce2bf00-9b32-4171-80ca-71a06e71cfac", "width": 0, - "x": 2048, - "y": 2046, - "z": 21, - "zOrder": 27, + "x": -2176, + "y": 1344, + "zOrder": 50, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -45953,32 +5180,30 @@ "angle": 0, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "f7fc9e25-e24e-4df9-8093-e808223b4b99", - "rotationY": 90, + "name": "LargeBuildingA", + "persistentUuid": "35d29936-54ea-41bb-a6d4-8b08ba17643c", "width": 0, - "x": 2144, - "y": 2046, - "z": 21, - "zOrder": 27, + "x": -2112, + "y": 2432, + "zOrder": 48, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 90, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "902cf497-b394-425a-a9db-5eddefc4e98c", - "rotationY": 90, + "name": "LargeBuildingF", + "persistentUuid": "1b2077a2-f66e-4d15-80d9-682cbfc572c6", "width": 0, - "x": 2464, - "y": 1120, - "z": 21, - "zOrder": 27, + "x": -3008, + "y": 1344, + "zOrder": 49, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -45987,15 +5212,14 @@ "angle": 0, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "527f0396-148d-4b9a-891b-3b030ed4c7c9", - "rotationY": 90, + "name": "LargeBuildingA", + "persistentUuid": "dcdb4b80-0b24-4520-8094-9a15f66e34f9", "width": 0, - "x": 2464, - "y": 1323, - "z": 21, - "zOrder": 27, + "x": -2880, + "y": 1024, + "zOrder": 48, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -46004,49 +5228,46 @@ "angle": 0, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "c43c4f54-000b-49ee-b8e7-fd9f39a65ad6", - "rotationY": 90, + "name": "LargeBuildingA", + "persistentUuid": "ab602015-5ee4-4443-a192-e53617874fde", "width": 0, - "x": 2464, - "y": 1216, - "z": 21, - "zOrder": 27, + "x": -2112, + "y": 1024, + "zOrder": 48, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 180, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "01564816-db2d-4222-9271-691a782814ab", - "rotationY": 90, + "name": "LargeBuildingF", + "persistentUuid": "48ac81d3-9e8f-4c16-9afe-695c11260fe5", "width": 0, - "x": -1664, - "y": -704, - "z": 21, - "zOrder": 27, + "x": -2496, + "y": 960, + "zOrder": 49, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 90, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "4112fc62-34be-4269-b843-94d7ef614ad2", - "rotationY": 90, + "name": "LargeBuildingA", + "persistentUuid": "8846971c-4d3d-4b4e-bf27-f7db6ec3d4a8", "width": 0, - "x": -1664, - "y": -512, - "z": 21, - "zOrder": 27, + "x": -2816, + "y": 1344, + "zOrder": 50, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -46055,15 +5276,14 @@ "angle": 0, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "ae78128d-84ce-4d60-8baa-f0b7edac934c", - "rotationY": 90, + "name": "LargeBuildingA", + "persistentUuid": "f002dcb6-7734-44ff-9c11-03d80f21656d", "width": 0, - "x": -1664, - "y": -608, - "z": 21, - "zOrder": 27, + "x": -2496, + "y": 1152, + "zOrder": 48, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -46072,66 +5292,62 @@ "angle": 0, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "1a6de6d8-8f3a-465c-8872-69f145ddef23", - "rotationY": 90, + "name": "LargeBuildingA", + "persistentUuid": "480c6e8b-cae4-4a0a-ac27-f28ae6a550ed", "width": 0, - "x": -864, - "y": -928, - "z": 21, - "zOrder": 27, + "x": -2496, + "y": 2304, + "zOrder": 48, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 90, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "a38b1d1e-0a5b-405c-ad85-4a4610c1b2c6", - "rotationY": 90, + "name": "LargeBuildingA", + "persistentUuid": "d8a2ca27-e500-4c08-85f4-11ce7bae63fe", "width": 0, - "x": -1056, - "y": -928, - "z": 21, - "zOrder": 27, + "x": -2816, + "y": 1728, + "zOrder": 50, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 270, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "a1fea144-0d41-47fe-9522-0191b2a188a8", - "rotationY": 90, + "name": "LargeBuildingF", + "persistentUuid": "4dc9a0dc-b445-4982-b723-a8a6d9cb0f68", "width": 0, - "x": -960, - "y": -928, - "z": 21, - "zOrder": 27, + "x": -1984, + "y": 1728, + "zOrder": 49, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 90, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "81751047-2c44-4915-aa4c-a8beb7ffb039", - "rotationY": 90, + "name": "LargeBuildingA", + "persistentUuid": "000a2c81-8cdc-4da1-88ed-9afb39fe3d8f", "width": 0, - "x": 736, - "y": -1036, - "z": 21, - "zOrder": 27, + "x": -2176, + "y": 1728, + "zOrder": 50, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -46141,1210 +5357,3363 @@ "customSize": false, "height": 0, "layer": "", - "name": "Coin", - "persistentUuid": "f2f482fe-5abe-4bed-a2a3-3d24fe635a26", - "rotationY": 90, + "name": "RoadBend", + "persistentUuid": "876e06b4-9467-4979-88fb-9adc2bcf6d8c", "width": 0, - "x": 640, - "y": -1036, - "z": 21, - "zOrder": 27, + "x": -3456, + "y": 2560, + "zOrder": 45, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 90, "customSize": false, "height": 0, "layer": "", - "name": "Coin", - "persistentUuid": "8c7022de-259d-408e-a83b-e2dba8f1ac18", - "rotationY": 90, + "name": "RoadIntersectionPath", + "persistentUuid": "6fa14a40-e494-47fc-8816-4a1e91b0c25a", "width": 0, - "x": 544, - "y": -1036, - "z": 21, - "zOrder": 27, + "x": -3456, + "y": 512, + "zOrder": 44, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 90, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "d52ddf39-738d-4e60-bf80-4b43f89099e2", - "rotationY": 90, + "name": "LargeBuildingA", + "persistentUuid": "4390f306-21e7-4c59-8f8d-41d216f95828", "width": 0, - "x": 448, - "y": -1036, - "z": 21, - "zOrder": 27, + "x": -2944, + "y": 2112, + "zOrder": 50, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 90, "customSize": false, "height": 0, + "keepRatio": true, "layer": "", - "name": "Coin", - "persistentUuid": "d50d718d-7834-44dd-9d09-a68d411882f3", - "rotationY": 90, + "name": "LargeBuildingA", + "persistentUuid": "f06efadf-649b-4cf3-a2ed-25adfb55b34a", "width": 0, - "x": 736, - "y": 2048, - "z": 21, - "zOrder": 27, + "x": -2048, + "y": 2112, + "zOrder": 50, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 90, + "customSize": true, + "depth": 8, + "height": 384, + "layer": "", + "name": "RoadStraight", + "persistentUuid": "a8244263-7fac-480c-8710-06a78c500e94", + "width": 512, + "x": -1984, + "y": 3008, + "zOrder": 42, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": -90, "customSize": false, "height": 0, "layer": "", - "name": "Coin", - "persistentUuid": "b954ca9b-4c6e-4478-9606-4e6bbad0aa1e", - "rotationY": 90, + "name": "RoadIntersectionPath", + "persistentUuid": "109f2601-2b75-4462-86ef-e971e00d1221", "width": 0, - "x": 640, - "y": 2048, - "z": 21, - "zOrder": 27, + "x": -1920, + "y": 2560, + "zOrder": 44, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 65, "customSize": false, "height": 0, "layer": "", - "name": "Coin", - "persistentUuid": "0a095649-4dbc-4c54-a193-66cae16a1879", - "rotationY": 90, + "name": "CommonTree", + "persistentUuid": "99e412c0-a22c-4772-aaa4-11d7356a0a0b", "width": 0, - "x": 544, - "y": 2048, - "z": 21, - "zOrder": 27, + "x": -3456, + "y": 5120, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 61, "customSize": false, "height": 0, "layer": "", - "name": "Coin", - "persistentUuid": "2e4839e5-ef94-40e6-b2a6-3671ed98ac00", - "rotationY": 90, + "name": "CommonTree", + "persistentUuid": "3cc3334d-7f26-4e43-b9ae-1cb79823b08b", "width": 0, - "x": 448, - "y": 2048, - "z": 21, - "zOrder": 27, + "x": 4480, + "y": 2432, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 77, "customSize": false, "height": 0, "layer": "", - "name": "Coin", - "persistentUuid": "3c41c0ed-3526-4fe0-adea-135b38a8555f", - "rotationY": 90, + "name": "CommonTree", + "persistentUuid": "0ad08b82-cc6f-4e47-b8d8-105508c828cd", "width": 0, - "x": 2240, - "y": -928, - "z": 21, - "zOrder": 27, + "x": 5632, + "y": -640, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 127, "customSize": false, "height": 0, "layer": "", - "name": "Coin", - "persistentUuid": "7a5ff952-5e59-45d4-b1be-45e53fcdf281", - "rotationY": 90, + "name": "CommonTree", + "persistentUuid": "3c708221-631f-44eb-970a-20632025ef55", "width": 0, - "x": 2048, - "y": -928, - "z": 21, - "zOrder": 27, + "x": -4608, + "y": -1280, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 186, "customSize": false, "height": 0, "layer": "", - "name": "Coin", - "persistentUuid": "502f8c2f-079b-4ee3-8fc2-69e112c4ee13", - "rotationY": 90, + "name": "CommonTree", + "persistentUuid": "064cb7cd-1254-4b63-9f19-327619db650b", "width": 0, - "x": 2144, - "y": -928, - "z": 21, - "zOrder": 27, + "x": 768, + "y": 5376, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 300, "customSize": false, "height": 0, "layer": "", - "name": "SuvLuxury", - "persistentUuid": "9589bc77-0357-4388-b5ec-e1092d0557fe", + "name": "CommonTree", + "persistentUuid": "a45feb42-e790-4346-80a7-9b19cf827dc6", "width": 0, - "x": 426, - "y": 449, - "z": 4, - "zOrder": 28, + "x": 6016, + "y": 5120, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 180, + "angle": 315, "customSize": false, "height": 0, "layer": "", - "name": "Van", - "persistentUuid": "fa97679d-81b5-4edf-91ce-a00d4bc798c2", + "name": "CommonTree", + "persistentUuid": "bf30b634-c017-4a1f-b95d-8f56bb8bb703", "width": 0, - "x": 472, - "y": 192, - "z": 4, - "zOrder": 37, + "x": 6144, + "y": 1024, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 255, "customSize": false, "height": 0, "layer": "", - "name": "SuvLuxury", - "persistentUuid": "2dd3cdfa-a9aa-4fca-969d-a9b53a744eb2", + "name": "CommonTree", + "persistentUuid": "e3ca34a5-bfc6-4ef6-82ac-d5806c6ade12", "width": 0, - "x": -391, - "y": -835, - "z": 4, - "zOrder": 28, + "x": -1024, + "y": -2944, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 180, + "angle": 315, "customSize": false, "height": 0, "layer": "", - "name": "Van", - "persistentUuid": "c1c8cd46-9a2b-4927-858b-76316c5a95b6", + "name": "CommonTree", + "persistentUuid": "5361970d-57dd-49d5-8cf5-dc346013f6fd", "width": 0, - "x": -216, - "y": -1087, - "z": 4, - "zOrder": 37, + "x": 3072, + "y": -4096, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 315, "customSize": false, "height": 0, "layer": "", - "name": "SuvLuxury", - "persistentUuid": "32547478-ebd7-4242-8afc-5c8f969bd186", + "name": "CommonTree", + "persistentUuid": "4c45061f-ef62-4a10-8c44-956d7ddc5e64", "width": 0, - "x": 1770, - "y": 442, - "z": 4, - "zOrder": 28, + "x": 3200, + "y": -1664, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 315, "customSize": false, "height": 0, "layer": "", - "name": "SuvLuxury", - "persistentUuid": "5f2e97f0-7bb3-457f-925e-d2d38ba0e7ab", + "name": "CommonTree", + "persistentUuid": "f84b0986-298d-439c-8b3a-016aeda4fd5c", "width": 0, - "x": 1930, - "y": 442, - "z": 4, - "zOrder": 28, + "x": 1408, + "y": -1792, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 325, "customSize": false, "height": 0, "layer": "", - "name": "Van", - "persistentUuid": "384c861f-fddd-4481-b559-448e68de9746", - "width": 0, - "x": 2184, - "y": 442, - "z": 4, - "zOrder": 38, + "name": "CommonTree", + "persistentUuid": "69960099-26da-4e9e-99bf-53f491642e0b", + "width": 0, + "x": 5760, + "y": -3456, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 61, "customSize": false, "height": 0, "layer": "", - "name": "SuvLuxury", - "persistentUuid": "478f6d08-f51b-46ce-b5ae-a9ad98378e33", + "name": "CommonTree", + "persistentUuid": "81d67980-48c0-4f09-9e0c-0e4ca7043345", "width": 0, - "x": -1078, - "y": 450, - "z": 4, - "zOrder": 28, + "x": -3584, + "y": -3840, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 47, "customSize": false, "height": 0, "layer": "", - "name": "SuvLuxury", - "persistentUuid": "3fce5402-89bd-4976-a7b4-b4238e485fb3", + "name": "CommonTree", + "persistentUuid": "95e04ddf-e6fc-418e-a4db-03a49d4cdadd", "width": 0, - "x": -918, - "y": 450, - "z": 4, - "zOrder": 28, + "x": -5376, + "y": 1920, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 96, "customSize": false, "height": 0, "layer": "", - "name": "Van", - "persistentUuid": "acb3437b-84fc-4e7f-8260-5e39448bef0f", + "name": "CommonTree", + "persistentUuid": "09b945b8-f879-4a21-8afa-62b9bcabb77d", "width": 0, - "x": -662, - "y": 450, - "z": 4, - "zOrder": 38, + "x": 1536, + "y": -3200, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 81, "customSize": false, "height": 0, "layer": "", - "name": "SuvLuxury", - "persistentUuid": "9d4b0ad2-7092-4d04-83ee-25f42217d50b", + "name": "CommonTree", + "persistentUuid": "0a0211cf-e0f5-485c-9cd0-16b206107314", "width": 0, - "x": -1014, - "y": -834, - "z": 4, - "zOrder": 28, + "x": 3328, + "y": 4352, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 103, "customSize": false, "height": 0, "layer": "", - "name": "SuvLuxury", - "persistentUuid": "778bca32-1711-492f-a3b0-a7818a0be53a", + "name": "CommonTree", + "persistentUuid": "ce007c64-db91-427e-b50b-ba07a1f8e747", "width": 0, - "x": -854, - "y": -834, - "z": 4, - "zOrder": 28, + "x": -896, + "y": 4352, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 0, + "angle": 80, "customSize": false, "height": 0, "layer": "", - "name": "Van", - "persistentUuid": "50e40d07-e62f-4bbc-95f4-31e3a00b13a7", + "name": "CommonTree", + "persistentUuid": "9db87156-732c-40bb-a128-c61241e5841b", "width": 0, - "x": -598, - "y": -834, - "z": 4, - "zOrder": 38, + "x": -2560, + "y": 3584, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 180, + "angle": 117, "customSize": false, "height": 0, "layer": "", - "name": "Van", - "persistentUuid": "db6379dd-828b-4b97-8c34-1e3aefd16053", + "name": "CommonTree", + "persistentUuid": "e41ae06f-c7d3-4041-a54c-61eea4782aa9", "width": 0, - "x": 616, - "y": 192, - "z": 4, - "zOrder": 37, + "x": -4352, + "y": 512, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 180, + "angle": 61, "customSize": false, "height": 0, "layer": "", - "name": "Van", - "persistentUuid": "24c0eb97-df17-4ec3-b525-6775f3e4b171", + "name": "CommonTree", + "persistentUuid": "38c811e2-2946-43c3-bec5-3910c34774ea", "width": 0, - "x": -168, - "y": 3522, - "z": 4, - "zOrder": 37, + "x": 3585, + "y": 512, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 180, + "angle": 325, "customSize": false, "height": 0, "layer": "", - "name": "Van", - "persistentUuid": "3867bff0-bc6b-4cde-bd55-aa0e1acb951f", + "name": "CommonTree", + "persistentUuid": "7a247fc9-d3e9-4fe9-aa36-412158e2efae", "width": 0, - "x": -392, - "y": 3522, - "z": 4, - "zOrder": 37, + "x": -2688, + "y": -2047, + "zOrder": 46, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 180, + "angle": 0, "customSize": false, "height": 0, "layer": "", - "name": "Van", - "persistentUuid": "573153a2-d34f-4f7d-a078-d591f21417dd", + "name": "Coin", + "persistentUuid": "a6bd15cc-17ed-4904-8dce-f728639a545c", + "rotationY": 90, "width": 0, - "x": 1267, - "y": -1099, - "z": 4, - "zOrder": 37, + "x": 2496, + "y": -1053, + "z": 155, + "zOrder": 27, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 180, + "angle": 0, "customSize": false, "height": 0, "layer": "", - "name": "Van", - "persistentUuid": "6c3d140a-a1d9-4713-be38-d77dadcc147a", + "name": "Coin", + "persistentUuid": "d9e7ad70-9d32-467e-9357-66dcf441d32d", + "rotationY": 90, "width": 0, - "x": 1427, - "y": -1099, - "z": 4, - "zOrder": 37, + "x": 2496, + "y": -850, + "z": 155, + "zOrder": 27, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 180, + "angle": 0, "customSize": false, "height": 0, "layer": "", - "name": "Van", - "persistentUuid": "2cc2aad3-8095-45bf-b31c-3ea4c53a54fe", + "name": "Coin", + "persistentUuid": "78f946eb-b0f5-4a76-ab7a-e629994dfe91", + "rotationY": 90, "width": 0, - "x": 2247, - "y": -1086, - "z": 4, - "zOrder": 37, + "x": 2496, + "y": -957, + "z": 155, + "zOrder": 27, "numberProperties": [], "stringProperties": [], "initialVariables": [] + } + ], + "objects": [ + { + "assetStoreId": "", + "name": "Dust", + "type": "ParticleEmitter3D::ParticleEmitter3D", + "variant": "", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "StartColor": "255;255;255", + "EndColor": "177;177;177", + "Blending": "Normal", + "Flow": 20, + "Duration": 123456, + "StartSizeMin": 5, + "StartSizeMax": 5, + "EndScale": 4, + "StartSpeedMin": 30, + "StartSpeedMax": 50, + "GravityTop": "Z+", + "Gravity": -30, + "EndOpacity": 0, + "StartOpacity": 220, + "SpayConeAngle": 45, + "Z": 9, + "RotationX": 0, + "LifespanMin": 0.5, + "LifespanMax": 1, + "RotationY": -22.5 + }, + "childrenContent": { + "Particle": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Particle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "assets\\Particle.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 32, + "y": 0 + }, + { + "x": 32, + "y": 32 + }, + { + "x": 0, + "y": 32 + } + ] + ] + } + ] + } + ] + } + ] + } + } + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "BestTimeText", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Best: 0", + "font": "Chango-Regular.ttf", + "textAlignment": "left", + "characterSize": 25, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Best: 0", + "font": "Chango-Regular.ttf", + "textAlignment": "left", + "verticalTextAlignment": "top", + "characterSize": 25, + "lineHeight": 0, + "color": "255;255;255" + } + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "RemainingText", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Remaining: 0", + "font": "Chango-Regular.ttf", + "textAlignment": "left", + "characterSize": 25, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Remaining: 0", + "font": "Chango-Regular.ttf", + "textAlignment": "left", + "verticalTextAlignment": "top", + "characterSize": 25, + "lineHeight": 0, + "color": "255;255;255" + } + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "TimeText", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Time:", + "font": "Chango-Regular.ttf", + "textAlignment": "left", + "characterSize": 40, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Time:", + "font": "Chango-Regular.ttf", + "textAlignment": "left", + "verticalTextAlignment": "top", + "characterSize": 40, + "lineHeight": 0, + "color": "255;255;255" + } + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "TutorialText", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Arrow keys to drive. Collect all coins.", + "font": "Chango-Regular.ttf", + "textAlignment": "left", + "characterSize": 20, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Arrow keys to drive. Collect all coins.", + "font": "Chango-Regular.ttf", + "textAlignment": "left", + "verticalTextAlignment": "top", + "characterSize": 20, + "lineHeight": 0, + "color": "255;255;255" + } + }, + { + "assetStoreId": "112c69f62e03fa6df7716cc6b8f174c17857fbf71c8d3fffd16fa8fdbfa49bf1", + "name": "SteerJoystick", + "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "variant": "", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "DeadZoneRadius": 0.33 + }, + "childrenContent": { + "Border": { + "adaptCollisionMaskAutomatically": false, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\Line light joystick border LeftRightt.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + "Thumb": { + "adaptCollisionMaskAutomatically": false, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Line light joystick thumb.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + } + } }, { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "SuvLuxury", - "persistentUuid": "e5a60d8e-77ff-4627-af10-ad2af0055da7", - "width": 0, - "x": 2102, - "y": -1085, - "z": 4, - "zOrder": 39, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "assetStoreId": "112c69f62e03fa6df7716cc6b8f174c17857fbf71c8d3fffd16fa8fdbfa49bf1", + "name": "SpeedJoystick", + "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "variant": "", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "DeadZoneRadius": 0.33, + "JoystickIdentifier": "Secondary" + }, + "childrenContent": { + "Border": { + "adaptCollisionMaskAutomatically": false, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\Line light joystick border UpDown.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + "Thumb": { + "adaptCollisionMaskAutomatically": false, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Line light joystick thumb.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + } + } }, { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "Van", - "persistentUuid": "bc21ef32-eb2c-4588-8535-9bbaf10b0fe8", - "width": 0, - "x": 1642, - "y": 195, - "z": 4, - "zOrder": 37, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "assetStoreId": "cddab55130dbd5a0b36f763200e876fb514aa608e1b057a136ebdb5f80006e2c", + "name": "Player", + "type": "Scene3D::Model3DObject", + "variables": [ + { + "folded": true, + "name": "Force", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "Direction", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [ + { + "name": "AirControl3D", + "type": "AirControl3D::AirControl3D", + "Physics3D": "Physics3D", + "RotationSpeedMax": 180, + "RotationAcceleration": 720, + "RotationDeceleration": 720, + "TranslationSpeedMax": 400, + "TranslationAcceleration": 1600, + "TranslationDeceleration": 1600, + "CurrentRotationSpeed": 0, + "PreviousRotationSpeed": 0, + "CurrentForwardSpeed": 0, + "CurrentSidewaysSpeed": 0, + "PreviousForwardSpeed": 0, + "PreviousSidewaysSpeed": 0, + "HasPressedTurnLeft": false, + "HasPressedTurnRight": false, + "HasPressedTurnLeftLast": false, + "HadPressedTurnLeft": false, + "HadPressedTurnRight": false, + "HasPressedMoveForward": false, + "HasPressedMoveBackward": false, + "HadPressedMoveForward": false, + "HadPressedMoveBackward": false, + "HasPressedMoveBackwardLast": false, + "HasPressedMoveLeft": false, + "HasPressedMoveRight": false, + "HadPressedMoveLeft": false, + "HadPressedMoveRight": false, + "HasPressedMoveLeftLast": false, + "TargetedForwardSpeed": 0, + "TargetedSidewaysSpeed": 0, + "TargetedRotationSpeed": 0 + }, + { + "name": "MultiplayerObject", + "type": "Multiplayer::MultiplayerObjectBehavior", + "playerNumber": 0, + "actionOnPlayerDisconnect": "DestroyObject" + }, + { + "name": "Physics3D", + "type": "Physics3D::Physics3DBehavior", + "object3D": "Object3D", + "bodyType": "Dynamic", + "bullet": false, + "fixedRotation": false, + "shape": "Box", + "shapeOrientation": "Z", + "shapeDimensionA": 74, + "shapeDimensionB": 39, + "shapeDimensionC": 27, + "density": 1, + "friction": 10, + "restitution": 0.5, + "linearDamping": 0.1, + "angularDamping": 0.1, + "gravityScale": 6, + "layers": 17, + "masks": 17, + "shapeOffsetX": 0, + "shapeOffsetY": 0, + "shapeOffsetZ": 9, + "massCenterOffsetX": 0, + "massCenterOffsetY": 0, + "massCenterOffsetZ": -25, + "massOverride": 1500 + }, + { + "name": "PhysicsCar3D", + "type": "Physics3D::PhysicsCar3D", + "physics3D": "Physics3D", + "steerAngleMax": 70, + "beginningSteerSpeed": 140, + "endSteerSpeed": 10, + "mass": 1500, + "engineTorqueMax": 8000, + "engineSpeedMax": 6000, + "engineInertia": 0.1, + "reverseGearRatio1": -2.9, + "gearRatio1": 2.66, + "gearRatio2": 1.78, + "gearRatio3": 1.3, + "gearRatio4": 1, + "gearRatio5": 0.74, + "gearRatio6": 0, + "backWheelOffsetX": -6, + "frontWheelOffsetX": -5, + "wheelOffsetY": 0, + "wheelOffsetZ": 0, + "wheelRadius": 6, + "wheelWidth": 3, + "brakeTorqueMax": 3000, + "handBrakeTorqueMax": 6000, + "hasBackWheelDrive": false, + "hasFrontWheelDrive": true, + "pitchRollAngleMax": 89 + }, + { + "name": "PhysicsCar3DGamepadMapper", + "type": "Gamepads::PhysicsCar3DGamepadMapper", + "PhysicsCar3D": "PhysicsCar3D", + "GamepadIdentifier": 1, + "UseArrows": true, + "UseLeftStick": true, + "UseRightStick": false, + "HandBrakeButton": "B or Circle" + }, + { + "name": "PhysicsCar3DKeyboardMapper", + "type": "PhysicsCar3DKeyMapper::PhysicsCar3DKeyboardMapper", + "PhysicsCar3D": "PhysicsCar3D", + "HandBrake": "Space", + "Up": "Up", + "Left": "Left", + "Down": "Down", + "Right": "Right" + }, + { + "name": "PhysicsCar3DMultitouchMapper", + "type": "SpriteMultitouchJoystick::PhysicsCar3DMultitouchMapper", + "PhysicsCar3D": "PhysicsCar3D", + "ControllerIdentifier": 1, + "SteerJoystickIdentifier": "Primary", + "SpeedJoystickIdentifier": "Secondary", + "HandBrakeButton": "B" + }, + { + "name": "ThirdPersonCamera", + "type": "ThirdPersonCamera::ThirdPersonCamera", + "Object3D": "Object3D", + "RotationHalfwayDuration": 0.125, + "TranslationZHalfwayDuration": 0.125, + "Distance": 450, + "LateralOffset": 0, + "AheadOffset": 200, + "OffsetZ": 0, + "RotationAngleOffset": 0, + "ElevationAngleOffset": 10, + "FollowFreeAreaZMax": 0, + "FollowFreeAreaZMin": 0, + "RotationLogSpeed": 2.0247e-320, + "TranslationZLogSpeed": 2.0247e-320, + "IsCalledManually": false, + "CameraZ": 0, + "LocalOffsetY": 200, + "LocalOffsetX": 0, + "OffsetY": 200, + "ElevationHalfwayDuration": 1, + "IsElevatingWithObject": false + } + ], + "content": { + "centerLocation": "ObjectCenter", + "crossfadeDuration": 0, + "depth": 74, + "height": 74, + "isCastingShadow": true, + "isReceivingShadow": true, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Sedan Sports.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": -90, + "width": 74, + "animations": [] + } }, { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "SuvLuxury", - "persistentUuid": "634c6020-2d28-47be-b2e4-2f0acdff4326", - "width": 0, - "x": 1514, - "y": 195, - "z": 4, - "zOrder": 39, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "assetStoreId": "541d82997e1d0e79b20a617cfcc249d1169d838db8512612894f18d64ea7374f", + "name": "LargeBuildingF", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Physics3D", + "type": "Physics3D::Physics3DBehavior", + "object3D": "Object3D", + "bodyType": "Static", + "bullet": false, + "fixedRotation": false, + "shape": "Box", + "shapeOrientation": "Z", + "shapeDimensionA": 0, + "shapeDimensionB": 0, + "shapeDimensionC": 0, + "density": 5, + "friction": 0.01, + "restitution": 0.01, + "linearDamping": 0.1, + "angularDamping": 0.1, + "gravityScale": 1, + "layers": 17, + "masks": 17, + "shapeOffsetX": 0, + "shapeOffsetY": 0, + "shapeOffsetZ": 0, + "massCenterOffsetX": 0, + "massCenterOffsetY": 0, + "massCenterOffsetZ": 0, + "massOverride": 0 + } + ], + "content": { + "centerLocation": "ObjectCenter", + "crossfadeDuration": 0, + "depth": 282, + "height": 128, + "isCastingShadow": true, + "isReceivingShadow": true, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Large Building F2.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 0, + "width": 384, + "animations": [] + } }, { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "Van", - "persistentUuid": "c2d673cd-0b27-4ab6-b26b-641469b9514b", - "width": 0, - "x": 1962, - "y": 1858, - "z": 4, - "zOrder": 37, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "assetStoreId": "479c508ead309e45d684605c3539fd2b3a3a3a1ea8a277f102e8366873aad249", + "name": "LargeBuildingA", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Physics3D", + "type": "Physics3D::Physics3DBehavior", + "object3D": "Object3D", + "bodyType": "Static", + "bullet": false, + "fixedRotation": false, + "shape": "Box", + "shapeOrientation": "Z", + "shapeDimensionA": 0, + "shapeDimensionB": 0, + "shapeDimensionC": 0, + "density": 5, + "friction": 0.01, + "restitution": 0.01, + "linearDamping": 0.1, + "angularDamping": 0.1, + "gravityScale": 1, + "layers": 17, + "masks": 17, + "shapeOffsetX": 0, + "shapeOffsetY": 0, + "shapeOffsetZ": 0, + "massCenterOffsetX": 0, + "massCenterOffsetY": 0, + "massCenterOffsetZ": 0, + "massOverride": 0 + } + ], + "content": { + "centerLocation": "ObjectCenter", + "crossfadeDuration": 0, + "depth": 316, + "height": 256, + "isCastingShadow": true, + "isReceivingShadow": true, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Large Building A.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 0, + "width": 384, + "animations": [] + } }, { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", + "assetStoreId": "fcb1a484380a00837bfc40406681f434dd57cce8bdf94694b237fc809bf7b4fb", "name": "SuvLuxury", - "persistentUuid": "f1ea9686-2334-44fb-8dc3-981db82aea0d", - "width": 0, - "x": 1834, - "y": 1858, - "z": 4, - "zOrder": 39, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "8f939289-ce00-49c8-8646-515c85580db9", - "width": 1536, - "x": -1536, - "y": 3456, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Physics3D", + "type": "Physics3D::Physics3DBehavior", + "object3D": "Object3D", + "bodyType": "Dynamic", + "bullet": false, + "fixedRotation": false, + "shape": "Box", + "shapeOrientation": "Z", + "shapeDimensionA": 0, + "shapeDimensionB": 0, + "shapeDimensionC": 0, + "density": 5, + "friction": 0.5, + "restitution": 0.2, + "linearDamping": 7, + "angularDamping": 4, + "gravityScale": 1, + "layers": 17, + "masks": 17, + "shapeOffsetX": 0, + "shapeOffsetY": 0, + "shapeOffsetZ": 0, + "massCenterOffsetX": 0, + "massCenterOffsetY": 0, + "massCenterOffsetZ": 0, + "massOverride": 0 + } + ], + "content": { + "centerLocation": "ObjectCenter", + "crossfadeDuration": 0, + "depth": 84, + "height": 84, + "isCastingShadow": true, + "isReceivingShadow": true, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Suv Luxury5.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": -90, + "width": 84, + "animations": [] + } }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "cb18e3ac-db07-44c5-8746-0baeeadebe74", - "width": 0, - "x": 384, - "y": 1792, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "assetStoreId": "0d7e7a700fe654df077830ff50844449cdaddbb46dbe23de65f970569e6a983b", + "name": "Van", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Physics3D", + "type": "Physics3D::Physics3DBehavior", + "object3D": "Object3D", + "bodyType": "Dynamic", + "bullet": false, + "fixedRotation": false, + "shape": "Box", + "shapeOrientation": "Z", + "shapeDimensionA": 0, + "shapeDimensionB": 0, + "shapeDimensionC": 0, + "density": 5, + "friction": 0.3, + "restitution": 0.2, + "linearDamping": 7, + "angularDamping": 4, + "gravityScale": 1, + "layers": 17, + "masks": 17, + "shapeOffsetX": 0, + "shapeOffsetY": 0, + "shapeOffsetZ": 0, + "massCenterOffsetX": 0, + "massCenterOffsetY": 0, + "massCenterOffsetZ": 0, + "massOverride": 0 + } + ], + "content": { + "centerLocation": "ObjectCenter", + "crossfadeDuration": 0, + "depth": 79, + "height": 79, + "isCastingShadow": true, + "isReceivingShadow": true, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Van2.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": -90, + "width": 79, + "animations": [] + } }, { - "angle": 0, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "dff9b457-42ce-4d46-a93e-a8bd0f44030f", - "width": 1152, - "x": 1152, - "y": 1792, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "assetStoreId": "", + "name": "Arrow", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "width": 32, + "height": 32, + "depth": 1, + "enableTextureTransparency": true, + "facesOrientation": "Y", + "frontFaceResourceName": "Arrow.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" + } }, { - "angle": 0, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", + "assetStoreId": "bbdd1d6c7d452e1847310eb327cddabe057cb893886f3a7a1af1c38e353eac92", "name": "RoadStraight", - "persistentUuid": "27286779-2ffd-4ad3-affe-39dbdbc8ef75", - "width": 1152, - "x": 1152, - "y": 128, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Physics3D", + "type": "Physics3D::Physics3DBehavior", + "object3D": "Object3D", + "bodyType": "Static", + "bullet": false, + "fixedRotation": false, + "shape": "Box", + "shapeOrientation": "Z", + "shapeDimensionA": 0, + "shapeDimensionB": 0, + "shapeDimensionC": 0, + "density": 1, + "friction": 7, + "restitution": 0.1, + "linearDamping": 0.1, + "angularDamping": 0.1, + "gravityScale": 1, + "layers": 17, + "masks": 17, + "shapeOffsetX": 0, + "shapeOffsetY": 0, + "shapeOffsetZ": -4, + "massCenterOffsetX": 0, + "massCenterOffsetY": 0, + "massCenterOffsetZ": 0, + "massOverride": 0 + } + ], + "content": { + "centerLocation": "ObjectCenter", + "crossfadeDuration": 0, + "depth": 8, + "height": 384, + "isCastingShadow": true, + "isReceivingShadow": true, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Road Straight.glb", + "originLocation": "TopLeft", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 0, + "width": 384, + "animations": [] + } }, { - "angle": 0, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "9ed137cb-69e5-4d3c-8acd-f81b10baedc1", - "width": 1536, - "x": -1536, - "y": -1152, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "assetStoreId": "ae09642f549122b398405ffda9bd787c20f0fdfcb555a4535c710a3f218c8130", + "name": "RoadCrossroadPath", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ObjectCenter", + "crossfadeDuration": 0, + "depth": 8, + "height": 384, + "isCastingShadow": true, + "isReceivingShadow": true, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Road Crossroad Path.glb", + "originLocation": "TopLeft", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 0, + "width": 384, + "animations": [] + } }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "75d41047-aac4-492d-a434-7c292fdc5932", - "width": 0, - "x": 384, - "y": -1152, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "assetStoreId": "fad6af3a34db69705540270898681716e47359bbb1b474b27104f823098ef0aa", + "name": "RoadIntersectionPath", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ObjectCenter", + "crossfadeDuration": 0, + "depth": 8, + "height": 384, + "isCastingShadow": true, + "isReceivingShadow": true, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Road Intersection Path.glb", + "originLocation": "TopLeft", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 0, + "width": 384, + "animations": [] + } }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "6bb6f7ac-9bdb-400d-bf70-164a7fe5bfec", - "width": 0, - "x": 384, - "y": 128, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "assetStoreId": "79a334f5403b6c2daa0625e37c715ede02c9283c06721ee917767f36efff8570", + "name": "RoadBend", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ObjectCenter", + "crossfadeDuration": 0, + "depth": 8, + "height": 384, + "isCastingShadow": true, + "isReceivingShadow": true, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Road Bend.glb", + "originLocation": "TopLeft", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 0, + "width": 384, + "animations": [] + } }, { - "angle": 90, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "3fcc1379-d254-481e-bad2-bc5d4c12de0d", - "width": 896, - "x": -256, - "y": -512, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "assetStoreId": "16fac9714ba0a9eb3c83984910c70b11affca1b4e6a8bed49c22af1d30f957da", + "name": "CommonTree", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Physics3D", + "type": "Physics3D::Physics3DBehavior", + "object3D": "Object3D", + "bodyType": "Static", + "bullet": false, + "fixedRotation": false, + "shape": "Cylinder", + "shapeOrientation": "Z", + "shapeDimensionA": 15, + "shapeDimensionB": 100, + "shapeDimensionC": 0, + "shapeOffsetX": 0, + "shapeOffsetY": 0, + "shapeOffsetZ": 50, + "massCenterOffsetX": 0, + "massCenterOffsetY": 0, + "massCenterOffsetZ": 0, + "density": 1, + "friction": 0.01, + "restitution": 0.01, + "linearDamping": 0.1, + "angularDamping": 0.1, + "gravityScale": 1, + "layers": 17, + "masks": 17, + "massOverride": 0 + } + ], + "content": { + "centerLocation": "ModelOrigin", + "crossfadeDuration": 0, + "depth": 250, + "height": 250, + "isCastingShadow": true, + "isReceivingShadow": true, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Common Tree 1.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 0, + "width": 250, + "animations": [] + } }, { - "angle": 90, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "b3fcfd40-daf0-4ac0-8ff4-c1ddcf9dcb2f", - "width": 896, - "x": 512, - "y": -512, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "assetStoreId": "", + "name": "Grass", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Physics3D", + "type": "Physics3D::Physics3DBehavior", + "object3D": "Object3D", + "bodyType": "Static", + "bullet": false, + "fixedRotation": false, + "shape": "Box", + "shapeOrientation": "Z", + "shapeDimensionA": 0, + "shapeDimensionB": 0, + "shapeDimensionC": 0, + "density": 1, + "friction": 7, + "restitution": 0.1, + "linearDamping": 0.1, + "angularDamping": 0.1, + "gravityScale": 1, + "layers": 17, + "masks": 17, + "shapeOffsetX": 0, + "shapeOffsetY": 0, + "shapeOffsetZ": 4, + "massCenterOffsetX": 0, + "massCenterOffsetY": 0, + "massCenterOffsetZ": 0, + "massOverride": 0 + } + ], + "content": { + "width": 100, + "height": 100, + "depth": 100, + "enableTextureTransparency": false, + "facesOrientation": "Y", + "frontFaceResourceName": "assets\\Grass.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": "StandardWithoutMetalness", + "isReceivingShadow": true, + "isCastingShadow": true + } }, { - "angle": 90, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "e9045c79-8c9f-433c-87f1-489cd7c5d8b5", - "width": 1280, - "x": 1856, - "y": 960, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "assetStoreId": "", + "name": "CoinPickUp", + "type": "ParticleEmitter3D::ParticleEmitter3D", + "variant": "", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "StartColor": "255;230;145", + "EndOpacity": 255, + "StartOpacity": 128, + "EndScale": 0, + "SpayConeAngle": 180, + "RotationY": 90, + "StartSpeedMin": 400, + "StartSpeedMax": 600, + "LifespanMax": 0.5, + "LifespanMin": 0.25, + "Duration": 0.0625, + "Flow": 200, + "StartSizeMin": 15, + "EndColor": "255;230;142", + "Blending": "Normal", + "StartSizeMax": 30 + }, + "childrenContent": { + "Particle": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Image", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "assets\\Particle.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 32, + "y": 0 + }, + { + "x": 32, + "y": 32 + }, + { + "x": 0, + "y": 32 + } + ] + ] + } + ] + } + ] + } + ] + } + } }, { - "angle": 90, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "f7b9a20a-970f-46a1-a0a9-2345c3082812", - "width": 1280, - "x": 320, - "y": 960, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "assetStoreId": "e5919fb86a559b00001678c710efe55f4e9f2e032a9ff9610087370f998d57de", + "name": "ScreenOrientationChecker", + "type": "ScreenOrientationChecker::ScreenOrientationChecker", + "variant": "Black screen orientation checker", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "IsForceShown": false, + "BackgroundColor": "24;24;24", + "CornerRadius": 8, + "Padding": 5 + } }, { - "angle": 90, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "c382140e-8041-4b53-b182-4d3afef43ceb", - "width": 1280, - "x": -448, - "y": 960, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "assetStoreId": "0e3ee52ba8369c68fe75e3b34a056876ba39b1d0dbb9de6e83e1f2ea0e6f94ac", + "name": "Coin", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Collectible", + "type": "Collectible::Collectible", + "RotationSpeed": 50 + }, + { + "name": "InOnScreen", + "type": "IsOnScreen::InOnScreen" + } + ], + "content": { + "centerLocation": "ModelOrigin", + "crossfadeDuration": 0, + "depth": 31, + "height": 31, + "isCastingShadow": true, + "isReceivingShadow": true, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Coin.glb", + "originLocation": "ModelOrigin", + "rotationX": 0, + "rotationY": 0, + "rotationZ": 0, + "width": 31, + "animations": [] + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "folderName": "Obstacles", + "quickCustomizationVisibility": "visible", + "children": [ + { + "objectName": "CommonTree" + }, + { + "objectName": "Van" + }, + { + "objectName": "SuvLuxury" + }, + { + "objectName": "LargeBuildingA" + }, + { + "objectName": "LargeBuildingF" + } + ] + }, + { + "folderName": "UI", + "quickCustomizationVisibility": "hidden", + "children": [ + { + "objectName": "Arrow" + }, + { + "objectName": "SteerJoystick" + }, + { + "objectName": "SpeedJoystick" + }, + { + "objectName": "ScreenOrientationChecker" + }, + { + "objectName": "TutorialText" + }, + { + "objectName": "TimeText" + }, + { + "objectName": "RemainingText" + }, + { + "objectName": "BestTimeText" + } + ] + }, + { + "folderName": "VFX", + "quickCustomizationVisibility": "hidden", + "children": [ + { + "objectName": "Dust" + }, + { + "objectName": "CoinPickUp" + } + ] + }, + { + "folderName": "Floor", + "quickCustomizationVisibility": "hidden", + "children": [ + { + "objectName": "RoadStraight" + }, + { + "objectName": "RoadCrossroadPath" + }, + { + "objectName": "RoadIntersectionPath" + }, + { + "objectName": "RoadBend" + }, + { + "objectName": "Grass" + } + ] + }, + { + "objectName": "Player" + }, + { + "objectName": "Coin" + } + ] + }, + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Game Set Up and controls for mobile." }, { - "angle": 90, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "f97d31b2-91e4-4d98-8ec8-894830e52c4f", - "width": 896, - "x": -2176, - "y": 1152, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "BuiltinExternalLayouts::CreateObjectsFromExternalLayout" + }, + "parameters": [ + "", + "\"UI\"", + "0", + "0", + "" + ] + } + ] }, { - "angle": 90, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "92323d5f-fd91-4f0c-b2ba-7bed3b8a28a9", - "width": 896, - "x": -2176, - "y": -512, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "CentreCamera" + }, + "parameters": [ + "", + "Player", + "", + "\"\"", + "" + ] + }, + { + "type": { + "value": "ReadNumberFromStorage" + }, + "parameters": [ + "\"HighScore\"", + "\"HighScore\"", + "", + "HighScore" + ] + }, + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "BestTimeText", + "Text", + "=", + "\"Best: \" + TimeFormatter::SecondsToHHMMSS000(Variable(HighScore))" + ] + }, + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "RemainingText", + "Text", + "=", + "\"Remaining: \" + ToString(SceneInstancesCount(Coin) - 20)" + ] + }, + { + "type": { + "value": "PlaySoundCanal" + }, + "parameters": [ + "", + "assets\\CarEngine.mp3", + "0", + "yes", + "30", + "1" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SystemInfo::HasTouchScreen" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "TutorialText", + "" + ] + } + ] + } + ] }, { - "angle": 0, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "9ce5b297-a47a-4ca1-978f-48440f38ed59", - "width": 1536, - "x": -1536, - "y": 128, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Multiplayer::MultiplayerObjectBehavior::TakeObjectOwnership" + }, + "parameters": [ + "Player", + "MultiplayerObject" + ] + } + ] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadCrossroadPath", - "persistentUuid": "a65bdf09-c0a8-40f2-bef2-dcde130625b7", - "width": 0, - "x": 768, - "y": 128, - "zOrder": 43, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Multiplayer::MultiplayerObjectBehavior::IsObjectOwnedByCurrentPlayer" + }, + "parameters": [ + "Player", + "MultiplayerObject" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Player", + "ThirdPersonCamera", + "" + ] + }, + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Player", + "PhysicsCar3DKeyboardMapper", + "" + ] + }, + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Player", + "PhysicsCar3DGamepadMapper", + "" + ] + }, + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Player", + "PhysicsCar3DMultitouchMapper", + "" + ] + } + ] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadCrossroadPath", - "persistentUuid": "efa57fb9-dd0b-431b-ba97-e56bd554f4cb", - "width": 0, - "x": 0, - "y": 128, - "zOrder": 43, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Multiplayer::MultiplayerObjectBehavior::IsObjectOwnedByCurrentPlayer" + }, + "parameters": [ + "Player", + "MultiplayerObject" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Player", + "ThirdPersonCamera", + "yes" + ] + }, + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Player", + "PhysicsCar3DKeyboardMapper", + "yes" + ] + }, + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Player", + "PhysicsCar3DGamepadMapper", + "yes" + ] + }, + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Player", + "PhysicsCar3DMultitouchMapper", + "yes" + ] + } + ], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "When the game is playing", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "GameState", + "=", + "\"Playing\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Start timer only when the SedanPlayer starts moving." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Physics3D::Physics3DBehavior::LinearVelocityLength" + }, + "parameters": [ + "Player", + "Physics3D", + ">", + "0" + ] + }, + { + "type": { + "inverted": true, + "value": "CompareTimer" + }, + "parameters": [ + "", + "\"Time\"", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetTimer" + }, + "parameters": [ + "", + "\"Time\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Display the timer." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "TimeText", + "Text", + "=", + "\"Time: \" + TimeFormatter::SecondsToHHMMSS000(TimerElapsedTime(\"Time\"))" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Floating joysticks", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SystemInfo::HasTouchScreen" + }, + "parameters": [ + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "BuiltinExternalLayouts::CreateObjectsFromExternalLayout" + }, + "parameters": [ + "", + "\"Touch controls\"", + "0", + "0", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "SteerJoystick" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "SpeedJoystick" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "SteerJoystick", + "", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "SpeedJoystick", + "", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "SteerJoystick", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "SteerJoystick", + "CursorX(\"UI\")", + "CursorY(\"UI\")", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "SpeedJoystick", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "SpeedJoystick", + "CursorX(\"UI\")", + "CursorY(\"UI\")", + "" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Air control", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::IsOnFloor" + }, + "parameters": [ + "Player", + "PhysicsCar3D" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Player", + "AirControl3D", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Physics3D::PhysicsCar3D::IsOnFloor" + }, + "parameters": [ + "Player", + "PhysicsCar3D" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Player", + "AirControl3D", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "\"Down\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "1", + "\"LT\"", + "\"Up\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "SpeedJoystick", + "\"Down\"", + "" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "AirControl3D::AirControl3D::SimulateMoveBackwardKey" + }, + "parameters": [ + "Player", + "AirControl3D", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "\"Up\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "1", + "\"RT\"", + "\"Up\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "SpeedJoystick", + "\"Up\"", + "" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "AirControl3D::AirControl3D::SimulateMoveForwardKey" + }, + "parameters": [ + "Player", + "AirControl3D", + "" + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Particles and car rev volume", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Dust", + "=", + "Player.Angle() + 180" + ] + }, + { + "type": { + "value": "MettreAutour" + }, + "parameters": [ + "Dust", + "Player", + "10", + "Player.Angle() - 180" + ] + }, + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Dust", + "=", + "Dust.X() + RandomFloatInRange(-6, 6)", + "=", + "Dust.Y() + RandomFloatInRange(-6, 6)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Dust", + "Object3D", + "=", + "Player.Object3D::Z() + 10" + ] + }, + { + "type": { + "value": "ModPitchSoundChannel" + }, + "parameters": [ + "", + "0", + "=", + "min((Player.Physics3D::LinearVelocityLength() / 300), 1)" + ] + }, + { + "type": { + "value": "ModVolumeSoundCanal" + }, + "parameters": [ + "", + "0", + "=", + "min(Player.Physics3D::LinearVelocityLength() * 10, 25)" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetFlow" + }, + "parameters": [ + "Dust", + "=", + "20 + 0.01 * Player.Physics3D::LinearVelocityLength()", + "-90" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSpeedMin" + }, + "parameters": [ + "Dust", + "=", + "30 + 0.1 * Player.Physics3D::LinearVelocityLength()", + "-90" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSpeedMax" + }, + "parameters": [ + "Dust", + "=", + "50 + 0.3 * Player.Physics3D::LinearVelocityLength()", + "-90" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Coins", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Coins indicator" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PickNearest" + }, + "parameters": [ + "Coin", + "Player.CenterX()", + "Player.CenterY()", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "RotateTowardAngle" + }, + "parameters": [ + "Arrow", + "AngleBetweenPositions(Player.CenterX(), Player.CenterY(), Coin.CenterX(), Coin.CenterY())", + "30", + "" + ] + }, + { + "type": { + "value": "MettreAutour" + }, + "parameters": [ + "Arrow", + "Player", + "60", + "Arrow.Angle()" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "IsOnScreen::InOnScreen::IsOnScreen" + }, + "parameters": [ + "Coin", + "InOnScreen", + "0", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Arrow" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "IsOnScreen::InOnScreen::IsOnScreen" + }, + "parameters": [ + "Coin", + "InOnScreen", + "10", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Arrow", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Collision3D::AreWithinDistance" + }, + "parameters": [ + "", + "Coin", + "Player", + "45", + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "CoinPickUp", + "Coin.CenterX()", + "Coin.CenterY()", + "" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetCenterZ" + }, + "parameters": [ + "CoinPickUp", + "Object3D", + "=", + "Coin.Object3D::CenterZ()" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Coin", + "" + ] + }, + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "RemainingText", + "Text", + "=", + "\"Remaining: \" + ToString(SceneInstancesCount(Coin) - 20)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Collect all coins" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneInstancesCount" + }, + "parameters": [ + "", + "Coin", + "<=", + "20" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "GameState", + "=", + "\"GameOver\"" + ] + }, + { + "type": { + "value": "ChangeTimeScale" + }, + "parameters": [ + "", + "0.5" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Score", + "=", + "TimerElapsedTime(\"Time\")" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Wait" + }, + "parameters": [ + "1.5" + ] + }, + { + "type": { + "value": "Scene" + }, + "parameters": [ + "", + "\"Leaderboard\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "CompareTimer" + }, + "parameters": [ + "", + "\"Time\"", + "<", + "HighScore" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "HighScore", + "=", + "0" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "HighScore", + "=", + "Score" + ] + }, + { + "type": { + "value": "EcrireFichierExp" + }, + "parameters": [ + "\"HighScore\"", + "\"HighScore\"", + "HighScore" + ] + }, + { + "type": { + "value": "TextObject::ChangeColor" + }, + "parameters": [ + "BestTimeText", + "\"248;231;28\"" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Collision sound effects", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Physics3D::Collision" + }, + "parameters": [ + "Player", + "Physics3D", + "Obstacle", + "Physics3D", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "PlaySound" + }, + "parameters": [ + "", + "Collision", + "", + "50", + "RandomFloatInRange(0.8,1)" + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 5000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", + "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::DirectionalLight", + "name": "DirectionalLight", + "doubleParameters": { + "distanceFromCamera": 1500, + "elevation": 40, + "frustumSize": 4000, + "intensity": 0.75, + "minimumShadowBias": 0, + "rotation": 300 + }, + "stringParameters": { + "color": "255;255;255", + "shadowQuality": "medium", + "top": "Z+" + }, + "booleanParameters": { + "isCastingShadow": true + } + }, + { + "effectType": "Scene3D::ExponentialFog", + "name": "Fog", + "doubleParameters": { + "density": 0.0006 + }, + "stringParameters": { + "color": "239;254;255" + }, + "booleanParameters": {} + }, + { + "effectType": "Scene3D::HemisphereLight", + "name": "HemisphereLight", + "doubleParameters": { + "elevation": 80, + "intensity": 0.33, + "rotation": 120 + }, + "stringParameters": { + "groundColor": "128;128;128", + "skyColor": "255;255;255", + "top": "Z+" + }, + "booleanParameters": {} + }, + { + "effectType": "Scene3D::Skybox", + "name": "Skybox", + "doubleParameters": {}, + "stringParameters": { + "backFaceResourceName": "assets\\Cubemap_Sky_02-512x512_Back.png", + "bottomFaceResourceName": "assets\\Cubemap_Sky_02-512x512_Bottom.png", + "frontFaceResourceName": "assets\\Cubemap_Sky_02-512x512_Front.png", + "leftFaceResourceName": "assets\\Cubemap_Sky_02-512x512_Left.png", + "rightFaceResourceName": "assets\\Cubemap_Sky_02-512x512_Right.png", + "topFaceResourceName": "assets\\Cubemap_Sky_02-512x512_Top.png" + }, + "booleanParameters": {} + } + ] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadIntersectionPath", - "persistentUuid": "eb323bf0-2c9f-470d-8f30-7b79ca5b1c15", - "width": 0, - "x": 768, - "y": 1792, - "zOrder": 44, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "UI", + "renderingType": "", + "visibility": true, + "cameras": [], + "effects": [ + { + "effectType": "Outline", + "name": "Effect", + "doubleParameters": { + "padding": 3, + "thickness": 3 + }, + "stringParameters": { + "color": "0;0;0" + }, + "booleanParameters": {} + } + ] }, { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadIntersectionPath", - "persistentUuid": "92e15216-85fa-4eeb-bb9a-04d8f369f724", - "width": 0, - "x": 0, - "y": -1152, - "zOrder": 44, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "MobileControls", + "renderingType": "", + "visibility": true, + "cameras": [], + "effects": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadIntersectionPath", - "persistentUuid": "a5d5abcc-c6db-41b5-9eed-36f231b1422f", - "width": 0, - "x": -1920, - "y": 128, - "zOrder": 44, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "Debug", + "renderingType": "", + "visibility": true, + "cameras": [], + "effects": [ + { + "effectType": "Scene3D::HemisphereLight", + "name": "3D Light", + "doubleParameters": { + "elevation": 45, + "intensity": 1, + "rotation": 0 + }, + "stringParameters": { + "groundColor": "64;64;64", + "skyColor": "255;255;255", + "top": "Y-" + }, + "booleanParameters": {} + } + ] + } + ], + "behaviorsSharedData": [ { - "angle": -90, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadIntersectionPath", - "persistentUuid": "e8b0b84a-62f4-453c-beca-103132724997", - "width": 0, - "x": 2304, - "y": 128, - "zOrder": 44, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "AirControl3D", + "type": "AirControl3D::AirControl3D", + "Cos": 0, + "Sin": 0 }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadBend", - "persistentUuid": "e22cf8f0-a157-4ec5-9e42-663c7f0af27b", - "width": 0, - "x": -1920, - "y": 3456, - "zOrder": 45, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior" }, { - "angle": 315, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "52d896d4-1113-4367-94bf-9398965ca670", - "width": 0, - "x": -989, - "y": 765, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" }, { - "angle": 61, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "10990ae3-86ae-4dc3-af87-9f72cfbed80e", - "width": 0, - "x": -230, - "y": 958, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Collectible", + "type": "Collectible::Collectible" }, { - "angle": 274, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "79f0c61e-6546-421b-bdb9-fef257734726", - "width": 0, - "x": -1057, - "y": 1403, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Effect", + "type": "EffectCapability::EffectBehavior" }, { - "angle": 57, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "85b17f12-f2b5-45c8-b365-ddfbbef7f2a0", - "width": 0, - "x": 2086, - "y": -274, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Flippable", + "type": "FlippableCapability::FlippableBehavior" }, { - "angle": 299, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "e45f54e4-ed85-40d5-98eb-a3d7c77285d3", - "width": 0, - "x": 1495, - "y": -270, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "InOnScreen", + "type": "IsOnScreen::InOnScreen" }, { - "angle": 348, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "da1362be-1156-4cd4-af4b-891bb73a43fa", - "width": 0, - "x": 1660, - "y": -579, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "MultiplayerObject", + "type": "Multiplayer::MultiplayerObjectBehavior" }, { - "angle": 0, - "customSize": true, - "depth": 100, - "height": 12160, - "layer": "", - "locked": true, - "name": "Grass", - "persistentUuid": "05276cd6-3502-4c9d-a19e-58308fbbb417", - "sealed": true, - "width": 14080, - "x": -6784, - "y": -5376, - "z": -100, - "zOrder": 47, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Object3D", + "type": "Scene3D::Base3DBehavior" }, { - "angle": 90, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "0866ad67-4291-45e1-bd2e-acb5d17c92fc", - "width": 665, - "x": 2163, - "y": -1152, - "z": 134, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" }, { - "angle": 90, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "baab3977-f3bb-4c36-a33e-6d2972b42526", - "rotationY": -10, - "width": 768, - "x": 2112, - "y": -1862, - "z": 67, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Physics3D", + "type": "Physics3D::Physics3DBehavior", + "gravityX": 0, + "gravityY": 0, + "gravityZ": -9.8, + "worldScale": 20 }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadCrossroadPath", - "persistentUuid": "5961bfb2-8241-47f6-a034-a6e49fcdc2fb", - "width": 0, - "x": 768, - "y": -1152, - "zOrder": 43, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "PhysicsCar3D", + "type": "Physics3D::PhysicsCar3D" }, { - "angle": 90, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadBend", - "persistentUuid": "d263b9dc-1a77-4310-9793-2f190eba291b", - "width": 0, - "x": 768, - "y": -2432, - "zOrder": 45, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "PhysicsCar3DGamepadMapper", + "type": "Gamepads::PhysicsCar3DGamepadMapper" }, { - "angle": 0, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "a6b06625-0a37-4a1d-9bab-1a76ab861f03", - "width": 1152, - "x": 1152, - "y": -2432, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "PhysicsCar3DKeyboardMapper", + "type": "PhysicsCar3DKeyMapper::PhysicsCar3DKeyboardMapper" }, { - "angle": 90, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "c3bad554-72dc-45f0-8a9b-2c66cc1f0aaa", - "width": 896, - "x": 512, - "y": -1792, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "PhysicsCar3DMultitouchMapper", + "type": "SpriteMultitouchJoystick::PhysicsCar3DMultitouchMapper" }, { - "angle": 0, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "da682bb0-4557-458e-b5ea-b32e8262032c", - "width": 2688, - "x": 1152, - "y": -1152, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Resizable", + "type": "ResizableCapability::ResizableBehavior" }, { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadIntersectionPath", - "persistentUuid": "20ad94a9-ce9e-43fc-a13e-f0016396863f", - "width": 0, - "x": 2304, - "y": -2432, - "zOrder": 44, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Scale", + "type": "ScalableCapability::ScalableBehavior" }, { - "angle": 0, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "057fa597-6ecc-4bff-806a-e19758e1663c", - "width": 1152, - "x": 2688, - "y": -2432, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Text", + "type": "TextContainerCapability::TextContainerBehavior" }, { - "angle": -90, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadBend", - "persistentUuid": "354d04e4-df29-449f-91b1-aac59a19afa0", - "width": 0, - "x": 3840, - "y": -1152, - "zOrder": 45, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "name": "ThirdPersonCamera", + "type": "ThirdPersonCamera::ThirdPersonCamera" + } + ] + }, + { + "b": 0, + "disableInputWhenNotFocused": true, + "mangledName": "Leaderboard", + "name": "Leaderboard", + "r": 0, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 0, + "uiSettings": { + "grid": true, + "gridType": "rectangular", + "gridWidth": 16, + "gridHeight": 16, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridColor": 16777215, + "gridAlpha": 0.21, + "snap": true, + "zoomFactor": 0.6022931537048508, + "windowMask": false, + "selectedLayer": "" + }, + "objectsGroups": [], + "variables": [ { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadBend", - "persistentUuid": "a007e09f-46d4-456a-b9b2-ded15847a436", - "width": 0, - "x": 3840, - "y": -2432, - "zOrder": 45, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "name": "LeaderboardScore", + "type": "string", + "value": "" + } + ], + "instances": [ { - "angle": 90, + "angle": 0, "customSize": true, - "depth": 8, - "height": 384, + "height": 64, "layer": "", - "name": "RoadStraight", - "persistentUuid": "e7d0d051-a9cb-4789-9a0b-ca84f0c2d2e4", - "width": 896, - "x": 3584, - "y": -1792, - "zOrder": 42, + "name": "Platform", + "persistentUuid": "c2c6a11c-e8f8-4ee6-aedb-369f62303136", + "width": 1152, + "x": -96, + "y": 512, + "zOrder": 14, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": -90, + "angle": 0, "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "a836ecad-7cb3-4928-b975-bc2e24743699", - "rotationY": -10, - "width": 768, - "x": 2112, - "y": -442, - "z": 67, - "zOrder": 42, + "height": 896, + "layer": "3D", + "name": "Background", + "persistentUuid": "968c9c47-08c4-44eb-917a-906d2ecee36b", + "width": 1024, + "x": -32, + "y": -320, + "zOrder": 15, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -47352,2717 +8721,41303 @@ { "angle": 0, "customSize": false, - "height": 0, + "height": 496, "keepRatio": true, "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "95ef1e5a-74b1-4e83-83b9-b2efbf806d58", - "width": 0, - "x": -960, - "y": -128, - "zOrder": 48, + "name": "LeaderboardDialog", + "persistentUuid": "24fb9077-19e6-49ff-b3c3-65ff89f4364f", + "width": 704, + "x": 304, + "y": 128, + "zOrder": 38, "numberProperties": [], "stringProperties": [], "initialVariables": [] + } + ], + "objects": [ + { + "assetStoreId": "", + "name": "LeaderboardDialog", + "persistentUuid": "be15c1ab-e476-499a-86bc-351227ed37ce", + "type": "LeaderboardDialog::LeaderboardDialog", + "variant": "Grey and yellow", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeaderboardId": "0d5ac561-afa4-45dc-bf58-561d557f7954", + "DefaultPlayerName": "", + "ScoreLabelText": "Time: ", + "Format": "MM:SS.ms" + } }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "febbfff0-96f7-4aa7-8824-e2c255f59eb0", - "width": 0, - "x": -576, - "y": 64, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "assetStoreId": "0e3ee52ba8369c68fe75e3b34a056876ba39b1d0dbb9de6e83e1f2ea0e6f94ac", + "name": "Coin", + "type": "Scene3D::Model3DObject", + "variables": [ + { + "folded": true, + "name": "RotationX", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "RotationY", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "RotationZ", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [ + { + "name": "ScreenWrap", + "type": "ScreenWrap::ScreenWrap", + "HorizontalWrapping": false, + "VerticalWrapping": true, + "BorderTop": 0, + "BorderLeft": 0, + "BorderRight": 0, + "BorderBottom": 0, + "TriggerOffset": 500 + } + ], + "content": { + "centerLocation": "ModelOrigin", + "crossfadeDuration": 0, + "depth": 64, + "height": 64, + "isCastingShadow": false, + "isReceivingShadow": false, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Coin.glb", + "originLocation": "ModelOrigin", + "rotationX": 0, + "rotationY": 0, + "rotationZ": 0, + "width": 64, + "animations": [] + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "LeaderboardDialog" + }, + { + "objectName": "Coin" + } + ] + }, + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Handle leaderboards.\nTo create a leaderboard, make sure your game is registered in Home > Profile > Games Dashboard and then, click on \"Manage game\" > Leaderboards. When a leaderboard is created, it should be available in the actions." }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "e6c94a26-8c81-4c05-8e45-151e85f1b377", - "width": 0, - "x": -128, - "y": -320, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "LeaderboardDialog::LeaderboardDialog::SetScore" + }, + "parameters": [ + "LeaderboardDialog", + "=", + "Score", + "" + ] + }, + { + "type": { + "value": "LeaderboardDialog::LeaderboardDialog::SetDefaultPlayerName" + }, + "parameters": [ + "LeaderboardDialog", + "=", + "PlayerName", + "" + ] + } + ] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "7fbca3aa-2a94-4cb9-b9e1-60168fcdd3a6", - "width": 0, - "x": -192, - "y": 0, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "LeaderboardDialog::LeaderboardDialog::IsRestartClicked" + }, + "parameters": [ + "LeaderboardDialog", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene" + }, + "parameters": [ + "", + "\"Game\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "LeaderboardDialog::LeaderboardDialog::IsScoreSubmitted" + }, + "parameters": [ + "LeaderboardDialog", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "PlayerName", + "=", + "LeaderboardDialog.PlayerName()" + ] + }, + { + "type": { + "value": "Scene" + }, + "parameters": [ + "", + "\"Game\"", + "" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Coins animation", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "100", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Coin", + "RandomInRange(CameraBorderLeft(), CameraBorderRight())", + "RandomInRange(-500 + CameraBorderTop(), CameraBorderBottom() + 500)", + "\"3D\"" + ] + }, + { + "type": { + "value": "SetNumberObjectVariable" + }, + "parameters": [ + "Coin", + "RotationX", + "=", + "RandomFloatInRange(20, 45)" + ] + }, + { + "type": { + "value": "SetNumberObjectVariable" + }, + "parameters": [ + "Coin", + "RotationY", + "=", + "RandomFloatInRange(20, 45)" + ] + }, + { + "type": { + "value": "SetNumberObjectVariable" + }, + "parameters": [ + "Coin", + "RotationZ", + "=", + "RandomFloatInRange(20, 45)" + ] + }, + { + "type": { + "value": "AddForceXY" + }, + "parameters": [ + "Coin", + "0", + "200", + "1" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Coin", + "Object3D", + "=", + "RandomFloatInRange(-1000, -32)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Coin", + "Object3D", + "=", + "RandomFloat(360)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Coin", + "Object3D", + "=", + "RandomFloat(360)" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Coin", + "Object3D", + "+", + "Coin.RotationX * TimeDelta()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Coin", + "Object3D", + "+", + "Coin.RotationY * TimeDelta()" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Coin", + "+", + "Coin.RotationZ * TimeDelta()" + ] + } + ] + } + ], + "parameters": [] + } + ], + "layers": [ + { + "ambientLightColorB": 167797870, + "ambientLightColorG": 6032144, + "ambientLightColorR": 8563600, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "3D", + "renderingType": "3d", + "visibility": true, + "cameras": [], + "effects": [ + { + "effectType": "Scene3D::HemisphereLight", + "name": "Light", + "doubleParameters": { + "elevation": 90, + "intensity": 0.5, + "rotation": 0 + }, + "stringParameters": { + "groundColor": "127;127;127", + "skyColor": "255;255;255", + "top": "Y-" + }, + "booleanParameters": {} + } + ] + }, + { + "ambientLightColorB": 3, + "ambientLightColorG": 134217728, + "ambientLightColorR": 1597197633, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", + "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": "Anchor", + "type": "AnchorBehavior::AnchorBehavior" }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "4f4d0089-55cf-4503-801d-40c9028a06b4", - "width": 0, - "x": -1472, - "y": -320, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "42935809-851d-4def-8303-3db218ba2166", - "width": 0, - "x": -960, - "y": -640, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Effect", + "type": "EffectCapability::EffectBehavior" }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "86397906-b3ad-405f-813d-586b8a72fbed", - "width": 0, - "x": -192, - "y": -640, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Flippable", + "type": "FlippableCapability::FlippableBehavior" }, { - "angle": 180, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "8c3e300a-b991-44e1-8d2f-c12129ca95d4", - "width": 0, - "x": -576, - "y": -704, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Object3D", + "type": "Scene3D::Base3DBehavior" }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "6c1f5561-24c8-4305-a22c-8604162282fa", - "width": 0, - "x": 576, - "y": 64, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" }, { - "angle": 180, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "7bcc160b-2587-452e-b7e4-68b584cbc754", - "width": 0, - "x": 576, - "y": -704, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Resizable", + "type": "ResizableCapability::ResizableBehavior" }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "5d87155a-1c5d-41b6-bc1f-e102fef4e92f", - "width": 0, - "x": 512, - "y": -448, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "Scale", + "type": "ScalableCapability::ScalableBehavior" }, { - "angle": 270, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "d7b328c3-82a1-4035-b6bc-80091cb3ccb1", - "width": 0, - "x": 704, - "y": -448, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "name": "ScreenWrap", + "type": "ScreenWrap::ScreenWrap" + } + ] + } + ], + "externalEvents": [], + "eventsFunctionsExtensions": [ + { + "author": "", + "category": "Input", + "extensionNamespace": "", + "fullName": "Screen Orientation Checker", + "gdevelopVersion": ">=5.5.222", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXNjcmVlbi1yb3RhdGlvbiIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik03LjUsMjEuNUM0LjI1LDE5Ljk0IDEuOTEsMTYuNzYgMS41NSwxM0gwLjA1QzAuNTYsMTkuMTYgNS43MSwyNCAxMiwyNEwxMi42NiwyMy45N0w4Ljg1LDIwLjE2TTE0LjgzLDIxLjE5TDIuODEsOS4xN0w5LjE3LDIuODFMMjEuMTksMTQuODNNMTAuMjMsMS43NUM5LjY0LDEuMTYgOC42OSwxLjE2IDguMTEsMS43NUwxLjc1LDguMTFDMS4xNiw4LjcgMS4xNiw5LjY1IDEuNzUsMTAuMjNMMTMuNzcsMjIuMjVDMTQuMzYsMjIuODQgMTUuMzEsMjIuODQgMTUuODksMjIuMjVMMjIuMjUsMTUuODlDMjIuODQsMTUuMyAyMi44NCwxNC4zNSAyMi4yNSwxMy43N0wxMC4yMywxLjc1TTE2LjUsMi41QzE5Ljc1LDQuMDcgMjIuMDksNy4yNCAyMi40NSwxMUgyMy45NUMyMy40NCw0Ljg0IDE4LjI5LDAgMTIsMEwxMS4zNCwwLjAzTDE1LjE1LDMuODRMMTYuNSwyLjVaIiAvPjwvc3ZnPg==", + "name": "ScreenOrientationChecker", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/0126888931a4a4f82bb2824df9f096347ace1c47f510c44df42aa8dc9e49e24a_screen-rotation.svg", + "shortDescription": "Display a customizable screen asking the user to rotate their phone/tablet if not in the right orientation.", + "version": "0.2.0", + "description": "Display a customizable screen asking the user to rotate their phone/tablet if not in the right orientation.", + "origin": { + "identifier": "ScreenOrientationChecker", + "name": "gdevelop-extension-store" + }, + "tags": [ + "screen", + "orientation" + ], + "authorIds": [ + "wWP8BSlAW0UP4NeaHa2LcmmDzmH2" + ], + "dependencies": [], + "globalVariables": [ { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "fd10ab85-50ef-448a-8074-4464bb4cda43", - "width": 0, - "x": 576, - "y": -128, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "name": "TargetOrientation", + "type": "string", + "value": "" + } + ], + "sceneVariables": [], + "eventsFunctions": [ { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "f38817e1-18ec-4228-8963-c7695c2af241", - "width": 0, - "x": 576, - "y": 1728, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Check if the events are running for the editor.", + "fullName": "Editor is running", + "functionType": "Condition", + "name": "IsInGameEdition", + "private": true, + "sentence": "Events are running for the editor", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const game = runtimeScene.getGame();\r", + "eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] }, { - "angle": 180, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "649c4082-ff47-44cd-b0f2-0bd27024ac52", - "width": 0, - "x": 576, - "y": 591, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "fullName": "Get game target orientation", + "functionType": "StringExpression", + "name": "ProjectOrientation", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = runtimeScene.getGame().getGameData().properties.orientation;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "a048fa2c-7f7e-490e-86f3-2e75bc2f8a5c", - "width": 0, - "x": 512, - "y": 832, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "ScreenOrientationChecker::ProjectOrientation()" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [ + { + "areaMaxX": 400, + "areaMaxY": 200, + "areaMaxZ": 0, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "defaultName": "", + "description": "Automatically display a screen asking the player to rotate their screen if needed - on mobile phones and tablets only. Set up Anchor behavior on this object so that top/bottom/left/right edges are anchored to the screen top/bottom/left/right.", + "fullName": "Screen Orientation Checker", + "isInnerAreaFollowingParentSize": true, + "isUsingLegacyInstancesRenderer": false, + "name": "ScreenOrientationChecker", + "objects": [ + { + "assetStoreId": "", + "bold": true, + "italic": false, + "name": "Text", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 0, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ], + "string": "Rotate screen to play", + "font": "", + "textAlignment": "center", + "characterSize": 30, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": true, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Rotate screen to play", + "font": "", + "textAlignment": "center", + "verticalTextAlignment": "top", + "characterSize": 30, + "lineHeight": 0, + "color": "255;255;255" + } + }, + { + "assetStoreId": "", + "name": "BackgroundPainter", + "type": "PrimitiveDrawing::Drawer", + "variables": [], + "effects": [], + "behaviors": [], + "fillOpacity": 255, + "outlineSize": 0, + "outlineOpacity": 255, + "absoluteCoordinates": true, + "clearBetweenFrames": true, + "antialiasing": "none", + "fillColor": { + "r": 0, + "g": 0, + "b": 0 + }, + "outlineColor": { + "r": 0, + "g": 0, + "b": 0 + } + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Icon", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "topEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "rotate-screen-icon.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 52.5, + "y": 56.5 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 1 + }, + { + "x": 105, + "y": 1 + }, + { + "x": 105, + "y": 113 + }, + { + "x": 0, + "y": 113 + } + ] + ] + } + ] + } + ] + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Text" + }, + { + "objectName": "BackgroundPainter" + }, + { + "objectName": "Icon" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 35, + "keepRatio": true, + "layer": "", + "name": "Text", + "persistentUuid": "65c003ea-19c0-4f18-a189-a02a24378f35", + "width": 207, + "x": 104, + "y": 120, + "zOrder": 15, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "BackgroundPainter", + "persistentUuid": "49ff4576-6406-41de-a43b-1355529d61fe", + "width": 0, + "x": 38, + "y": 17, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Icon", + "persistentUuid": "39cbfc66-13f4-43dc-b6ef-2bda83153277", + "width": 0, + "x": 204, + "y": 64, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": {}, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::ClearBetweenFrames" + }, + "parameters": [ + "BackgroundPainter", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenOrientationChecker::IsInGameEdition" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::DrawBackground" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ScreenOrientationChecker::IsInGameEdition" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Check if the screen must be shown" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SystemInfo::IsMobile" + }, + "parameters": [] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "SceneWindowWidth()", + ">", + "SceneWindowHeight()" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsShown", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "!=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsShown", + "False", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "SceneWindowWidth()", + "<=", + "SceneWindowHeight()" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "\"landscape\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsShown", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsShown", + "False", + "" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Show/hide the screen as needed" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsShown", + "True", + "" + ] + }, + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsForceShown", + "True", + "" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::DrawBackground" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "IsShown", + "True", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "IsForceShown", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Object" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Icon", + "=", + "Text.Y() - 100" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Animate the icon" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Tween::Exists" + }, + "parameters": [ + "Icon", + "Tween", + "\"Rotate\"" + ] + }, + { + "type": { + "inverted": true, + "value": "Tween::Exists" + }, + "parameters": [ + "Icon", + "Tween", + "\"RotateBack\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::TweenBehavior::AddObjectAngleTween2" + }, + "parameters": [ + "Icon", + "Tween", + "\"Rotate\"", + "8", + "\"easeInOutQuad\"", + "2", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween::HasFinished" + }, + "parameters": [ + "Icon", + "Tween", + "\"RotateBack\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::TweenBehavior::AddObjectAngleTween2" + }, + "parameters": [ + "Icon", + "Tween", + "\"Rotate\"", + "8", + "\"easeInOutQuad\"", + "2", + "" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Icon", + "Tween", + "\"RotateBack\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween::HasFinished" + }, + "parameters": [ + "Icon", + "Tween", + "\"Rotate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::TweenBehavior::AddObjectAngleTween2" + }, + "parameters": [ + "Icon", + "Tween", + "\"RotateBack\"", + "-8", + "\"easeInOutQuad\"", + "2", + "" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Icon", + "Tween", + "\"Rotate\"" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Draw the background.", + "fullName": "Draw the background", + "functionType": "Action", + "name": "DrawBackground", + "private": true, + "sentence": "Draw the background of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::RoundedRectangle" + }, + "parameters": [ + "BackgroundPainter", + "Padding", + "Padding", + "Object.Width()-Padding", + "Object.Height()-Padding", + "CornerRadius" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the screen should be forced to be shown. Use this to test the screen in your game.", + "fullName": "Force show the screen", + "functionType": "Condition", + "name": "IsForceShown", + "sentence": "_PARAM0_ is forced to be shown", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsForceShown", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Change if the screen should be forced to be shown. Use this to test the screen in your game.", + "fullName": "Force show the screen", + "functionType": "Action", + "name": "SetIsForceShown", + "sentence": "Force _PARAM0_ to be shown: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "Value", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsForceShown", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Value", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsForceShown", + "False", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + }, + { + "defaultValue": "yes", + "description": "Force show the screen?", + "name": "Value", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "the message of the object.", + "fullName": "Message", + "functionType": "ExpressionAndCondition", + "name": "Message", + "sentence": "the message", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Text.Text::Value()" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Message", + "name": "SetMessage", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "Text", + "Text", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Boolean", + "label": "", + "hidden": true, + "name": "IsShown" + }, + { + "value": "", + "type": "Boolean", + "label": "Force show the screen", + "description": "Use this to test the screen in your game", + "name": "IsForceShown" + }, + { + "value": "5", + "type": "Number", + "unit": "Pixel", + "label": "Padding", + "group": "Appearance", + "name": "Padding" + }, + { + "value": "10", + "type": "Number", + "unit": "Pixel", + "label": "Corner radius", + "description": "Corner radius for the background", + "group": "Appearance", + "name": "CornerRadius" + } + ], + "variants": [ + { + "areaMaxX": 400, + "areaMaxY": 200, + "areaMaxZ": 0, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "assetStoreAssetId": "2743bcd6cf431c6c00cda3a59684eb152b3a09d598b799b15383e4f77daf8b37", + "assetStoreOriginalName": "Black screen orientation checker", + "name": "Black screen orientation checker", + "objects": [ + { + "assetStoreId": "", + "bold": true, + "italic": false, + "name": "Text", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 0, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ], + "string": "Rotate screen to play", + "font": "", + "textAlignment": "center", + "characterSize": 30, + "color": { + "b": 255, + "g": 255, + "r": 255 + }, + "content": { + "bold": true, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Rotate screen to play", + "font": "", + "textAlignment": "center", + "verticalTextAlignment": "top", + "characterSize": 30, + "lineHeight": 0, + "color": "255;255;255" + } + }, + { + "assetStoreId": "", + "name": "BackgroundPainter", + "type": "PrimitiveDrawing::Drawer", + "variables": [], + "effects": [], + "behaviors": [], + "fillOpacity": 255, + "outlineSize": 0, + "outlineOpacity": 255, + "absoluteCoordinates": true, + "clearBetweenFrames": true, + "antialiasing": "none", + "fillColor": { + "r": 0, + "g": 0, + "b": 0 + }, + "outlineColor": { + "r": 0, + "g": 0, + "b": 0 + } + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Icon", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "topEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "rotate-screen-icon.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 52.5, + "y": 56.5 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 1 + }, + { + "x": 105, + "y": 1 + }, + { + "x": 105, + "y": 113 + }, + { + "x": 0, + "y": 113 + } + ] + ] + } + ] + } + ] + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Text" + }, + { + "objectName": "BackgroundPainter" + }, + { + "objectName": "Icon" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 35, + "keepRatio": true, + "layer": "", + "name": "Text", + "persistentUuid": "65c003ea-19c0-4f18-a189-a02a24378f35", + "width": 207, + "x": 104, + "y": 120, + "zOrder": 15, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "BackgroundPainter", + "persistentUuid": "49ff4576-6406-41de-a43b-1355529d61fe", + "width": 0, + "x": 38, + "y": 17, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "Icon", + "persistentUuid": "39cbfc66-13f4-43dc-b6ef-2bda83153277", + "width": 0, + "x": 204, + "y": 64, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": {} + } + ] + } + ] + }, + { + "author": "Bouh", + "category": "Input", + "extensionNamespace": "", + "fullName": "Gamepads (controllers)", + "gdevelopVersion": ">=5.5.222", + "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.9.0", + "description": [ + "Add support for gamepads (or other physical controllers).", + "", + "It gives access to:", + "- button presses,", + "- axis positions and force,", + "- trigger pressure,", + "- configurable deadzone,", + "- vibration,", + "- automatic \"gamepad mapper\" behaviors for 2D and 3D movement behaviors (platformer characters, top-down movement, 3D character etc...). Add one of these to the object with the movement behavior (i.e: the player most of the time) and the behavior will then be controlled automatically by the gamepad (it works by reading the gamepad state and simulating controls). No need for additional events to make it work once the behaviors are set up.", + "", + "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", + "platformer", + "platform", + "top-down" + ], + "authorIds": [ + "2OwwM8ToR9dx9RJ2sAKTcrLmCB92", + "taRwmWxwAFYFL9yyBwB3cwBw0BO2", + "mnImQKdn8nQxwzkS5D6a1JB27V23", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [ + { + "name": "Buttons", + "type": "structure", + "children": [ + { + "name": "A or Cross", + "type": "string", + "value": "A" + }, + { + "name": "B or Circle", + "type": "string", + "value": "B" + }, + { + "name": "LB or L1", + "type": "string", + "value": "LB" + }, + { + "name": "LT or L2", + "type": "string", + "value": "LT" + }, + { + "name": "RB or R1", + "type": "string", + "value": "RB" + }, + { + "name": "RT or R2", + "type": "string", + "value": "RT" + }, + { + "name": "X or Square", + "type": "string", + "value": "X" + }, + { + "name": "Y or Triangle", + "type": "string", + "value": "Y" + } + ] + } + ], + "eventsFunctions": [ { - "angle": 270, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "f98ac4e1-de20-46bf-886b-52017a7ae87a", - "width": 0, - "x": 704, - "y": 832, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (gdjs._extensionController) {\r", + " return;\r", + "}\r", + "\r", + "/**\r", + " * Associate controller button ids to button names\r", + " */\r", + "const controllerButtonNames = {\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", + " * @param {number} playerId\r", + " */\r", + "function getGamepad(playerId) {\r", + " /** @type {Gamepad[]} */\r", + " const gamepads = navigator.getGamepads ? navigator.getGamepads() : [];\r", + " return gamepads[playerId];\r", + "}\r", + "\r", + "/** @type {{[playerId: number]: Player}} */\r", + "const players = {};\r", + "\r", + "/**\r", + " * @param {number} playerId\r", + " */\r", + "function getPlayer(playerId) {\r", + " let player = players[playerId];\r", + " if (!player) {\r", + " player = new Player(playerId);\r", + " players[playerId] = player;\r", + " }\r", + " return player;\r", + "}\r", + "\r", + "class Player {\r", + " /** @type {number} */\r", + " playerId;\r", + " mapping = 'DEFAULT';\r", + " lastButtonUsed = -1;\r", + " deadzone = 0.2;\r", + " /** @type {{[buttonId: number]: ButtonState}} */\r", + " buttonStates = {};\r", + " rumble = { elapsedTime: 0, duration: 0, weakMagnitude: 0, strongMagnitude: 0 };\r", + "\r", + " /**\r", + " * @param {number} playerId\r", + " */\r", + " constructor(playerId) {\r", + " this.playerId = playerId;\r", + " }\r", + "\r", + " /**\r", + " * @param {number} buttonId\r", + " */\r", + " getButtonState(buttonId) {\r", + " let buttonState = this.buttonStates[buttonId];\r", + " if (!buttonState) {\r", + " buttonState = new ButtonState();\r", + " this.buttonStates[buttonId] = buttonState;\r", + " }\r", + " return buttonState;\r", + " }\r", + "\r", + " /**\r", + " * @param {number} buttonId\r", + " */\r", + " isButtonPressed(buttonId) {\r", + " return this.getButtonState(buttonId).isPressed;\r", + " }\r", + "\r", + " /**\r", + " * @param {number} buttonId\r", + " */\r", + " isButtonJustPressed(buttonId) {\r", + " return this.getButtonState(buttonId).isJustPressed();\r", + " }\r", + "\r", + " /**\r", + " * @param {number} buttonId\r", + " */\r", + " isButtonReleased(buttonId) {\r", + " return this.getButtonState(buttonId).isReleased();\r", + " }\r", + "\r", + " isAnyButtonReleased() {\r", + " for (const buttonId in this.buttonStates) {\r", + " const buttonState = this.buttonStates[buttonId];\r", + " if (buttonState.isReleased()) {\r", + " return true;\r", + " }\r", + " }\r", + " return false;\r", + " }\r", + "\r", + " isAnyButtonPressed() {\r", + " for (const buttonId in this.buttonStates) {\r", + " const buttonState = this.buttonStates[buttonId];\r", + " if (buttonState.isPressed) {\r", + " return true;\r", + " }\r", + " }\r", + " return false;\r", + " }\r", + "}\r", + "\r", + "class ButtonState {\r", + " wasPressed = false;\r", + " isPressed = false;\r", + "\r", + " isReleased() {\r", + " return this.wasPressed && !this.isPressed;\r", + " }\r", + "\r", + " isJustPressed() {\r", + " return !this.wasPressed && this.isPressed;\r", + " }\r", + "}\r", + "\r", + "// Async tasks are run before everything.\r", + "// This is a hack to make sure that button states are updated\r", + "// before mapping behavior events.\r", + "const frameBeginningTask = new class extends gdjs.AsyncTask {\r", + " update() {\r", + " /** @type {Gamepad[]} */\r", + " const gamepads = navigator.getGamepads ? navigator.getGamepads() : [];\r", + " for (let playerId = 0; playerId < gamepads.length; playerId++) {\r", + " const gamepad = gamepads[playerId];\r", + " if (gamepad == null) {\r", + " // The gamepad is not connected.\r", + " continue;\r", + " }\r", + " const player = getPlayer(playerId);\r", + "\r", + " for (let buttonId = 0; buttonId < Object.keys(gamepad.buttons).length; buttonId++) {\r", + " const buttonState = player.getButtonState(buttonId);\r", + " buttonState.wasPressed = buttonState.isPressed;\r", + " buttonState.isPressed = gamepad.buttons[buttonId].pressed;\r", + " if (buttonState.isJustPressed()) {\r", + " player.lastButtonUsed = buttonId;\r", + " }\r", + " }\r", + " }\r", + " return false;\r", + " }\r", + "}();\r", + "\r", + "function onScenePostEvents() {\r", + " /** @type {Gamepad[]} */\r", + " const gamepads = navigator.getGamepads ? navigator.getGamepads() : [];\r", + " for (let playerId = 0; playerId < gamepads.length; playerId++) {\r", + " let gamepad = gamepads[playerId];\r", + " if (gamepad == null) {\r", + " // The gamepad is not connected.\r", + " continue;\r", + " }\r", + " const player = getPlayer(playerId);\r", + " const rumble = player.rumble;\r", + " rumble.elapsedTime += runtimeScene.getElapsedTime(runtimeScene) / 1000;\r", + " if (rumble.duration - rumble.elapsedTime <= 0 &&\r", + " (rumble.weakMagnitude || rumble.strongMagnitude)\r", + " ) {\r", + " rumble.weakMagnitude = 0;\r", + " rumble.strongMagnitude = 0;\r", + " }\r", + " }\r", + "}\r", + "\r", + "/**\r", + " * @param {string} type\r", + " * @param {number} buttonId\r", + " */\r", + "function getInputString(type, buttonId) {\r", + " if (!controllerButtonNames[type]) {\r", + " return \"UNKNOWN_BUTTON\";\r", + " }\r", + " return controllerButtonNames[type][buttonId];\r", + "}\r", + "\r", + "function getButtonId(buttonName) {\r", + " switch (buttonName) {\r", + " case 'A':\r", + " case 'CROSS':\r", + " return 0;\r", + " case 'B':\r", + " case 'CIRCLE':\r", + " return 1;\r", + " case 'X':\r", + " case 'SQUARE':\r", + " return 2;\r", + " case 'Y':\r", + " case 'TRIANGLE':\r", + " return 3;\r", + " case 'LB':\r", + " case 'L1':\r", + " return 4;\r", + " case 'RB':\r", + " case 'R1':\r", + " return 5;\r", + " case 'LT':\r", + " case 'L2':\r", + " return 6;\r", + " case 'RT':\r", + " case 'R2':\r", + " return 7;\r", + " case 'UP':\r", + " return 12;\r", + " case 'DOWN':\r", + " return 13;\r", + " case 'LEFT':\r", + " return 14;\r", + " case 'RIGHT':\r", + " return 15;\r", + " case 'BACK':\r", + " case 'SHARE':\r", + " return 8;\r", + " case 'START':\r", + " case 'OPTIONS':\r", + " return 9;\r", + " case 'CLICK_STICK_LEFT':\r", + " return 10;\r", + " case 'CLICK_STICK_RIGHT':\r", + " return 11;\r", + " //PS4\r", + " case 'PS_BUTTON':\r", + " return 16;\r", + " case 'CLICK_TOUCHPAD':\r", + " return 17;\r", + " default:\r", + " console.error('The gamepad button: ' + buttonName + ' is not valid.');\r", + " return null;\r", + " }\r", + "}\r", + "\r", + "/**\r", + " * @param {number} playerId\r", + " * @param {string} directionName\r", + " * @param {number} axisValueX\r", + " * @param {number} axisValueY\r", + " */\r", + "function isAxisPushed(playerId, directionName, axisValueX, axisValueY) {\r", + " switch (directionName) {\r", + " case 'LEFT':\r", + " return getNormalizedAxisValue(axisValueX, playerId) < 0;\r", + " case 'RIGHT':\r", + " return getNormalizedAxisValue(axisValueX, playerId) > 0;\r", + " case 'UP':\r", + " return getNormalizedAxisValue(axisValueY, playerId) < 0;\r", + " case 'DOWN':\r", + " return getNormalizedAxisValue(axisValueY, playerId) > 0;\r", + " case 'ANY':\r", + " return getNormalizedAxisValue(axisValueX, playerId) < 0\r", + " || getNormalizedAxisValue(axisValueX, playerId) > 0\r", + " || getNormalizedAxisValue(axisValueY, playerId) < 0\r", + " || getNormalizedAxisValue(axisValueY, playerId) > 0\r", + " default:\r", + " console.error('The value stick direction is not valid.');\r", + " return false;\r", + " }\r", + "}\r", + "\r", + "/**\r", + " * @param {number} deltaX\r", + " * @param {number} deltaY\r", + " */\r", + "function axisToAngle(deltaX, deltaY) {\r", + " const rad = Math.atan2(deltaY, deltaX);\r", + " const deg = rad * (180 / Math.PI);\r", + " return deg;\r", + "}\r", + "\r", + "/**\r", + " * @param {{id: string}} gamepad\r", + " */\r", + "function isXbox(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", + "/**\r", + " * Returns the new value taking into account the dead zone for the player_ID given\r", + " * @param {number} value\r", + " * @param {number} playerID\r", + " */\r", + "function getNormalizedAxisValue(value, playerID) {\r", + " // gdjs._extensionController = gdjs._extensionController || { deadzone: 0.2 };\r", + "\r", + " // Anything smaller than this is assumed to be 0,0\r", + " const deadzone = getPlayer(playerID).deadzone;\r", + "\r", + " if (Math.abs(value) < deadzone) {\r", + " return 0;\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 value from\r", + " // deadzone..1 to 0..(1-deadzone)\r", + " // or from\r", + " // -1..-deadzone to -(1-deadzone)..0\r", + " value = value - Math.sign(value) * deadzone;\r", + "\r", + " // Remap value from\r", + " // 0..(1-deadzone) to 0..1\r", + " // or from\r", + " // -(1-deadzone)..0 to -1..0\r", + " return value / (1 - deadzone);\r", + " }\r", + "}\r", + "\r", + "gdjs._extensionController = {\r", + " getPlayer,\r", + " controllerButtonNames,\r", + " getInputString,\r", + " getButtonId,\r", + " axisToAngle,\r", + " isXbox,\r", + " getNormalizedAxisValue,\r", + " isAxisPushed,\r", + " getGamepad,\r", + " onScenePostEvents,\r", + " frameBeginningTask,\r", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "2353214c-8af5-4b43-8ab8-b2cec80398da", - "width": 0, - "x": 576, - "y": 1152, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "fullName": "", + "functionType": "Action", + "name": "onSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "// Async tasks are run before everything.\r", + "// This is a hack to make sure that button states are updated\r", + "// before mapping behavior events.\r", + "runtimeScene.getAsyncTasksManager().addTask(gdjs._extensionController.frameBeginningTask);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "5509575e-7090-4fe2-a614-e02f10db8663", - "width": 0, - "x": 1728, - "y": 1728, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "fullName": "", + "functionType": "Action", + "name": "onScenePostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._extensionController.onScenePostEvents();", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "6d1b66fc-01e6-46ae-8c77-09900f3d6e33", - "width": 0, - "x": 2048, - "y": 960, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "fullName": "Accelerated speed", + "functionType": "Expression", + "name": "AcceleratedSpeed", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "CurrentSpeed" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TargetedSpeed", + "<", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Reduce the speed to match the stick force." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "-", + "Acceleration * TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Turn back at least as fast as it would stop." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TargetedSpeed", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Reduce the speed to match the stick force." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "+", + "Acceleration * TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Turn back at least as fast as it would stop." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TargetedSpeed", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(0, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(0, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "clamp(AcceleratedSpeed, -SpeedMax, SpeedMax)" + ] + } + ] + } + ], + "variables": [ + { + "name": "AcceleratedSpeed", + "type": "number", + "value": 0 + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Current speed", + "name": "CurrentSpeed", + "type": "expression" + }, + { + "description": "Targeted speed", + "name": "TargetedSpeed", + "type": "expression" + }, + { + "description": "Max speed", + "name": "SpeedMax", + "type": "expression" + }, + { + "description": "Acceleration", + "name": "Acceleration", + "type": "expression" + }, + { + "description": "Deceleration", + "name": "Deceleration", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "4766be12-e1f3-44ec-89a9-6fc331da38d5", - "width": 0, - "x": 2112, - "y": 1664, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "\r", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", + "const trigger = eventsFunctionContext.getArgument(\"Trigger\").toUpperCase();\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", + "/** @type {Gamepad} */\r", + "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", + "if (!gamepad) {\r", + " // The gamepad is not connected.\r", + " 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": "PlayerId", + "type": "expression" + }, + { + "description": "Trigger button", + "name": "Trigger", + "supplementaryInformation": "[\"LT\",\"RT\",\"L2\",\"R2\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "3940ad48-378a-48e3-9d92-cedcb10308d2", - "width": 0, - "x": 1216, - "y": 960, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "the force of gamepad stick (from 0 to 1).", + "fullName": "Stick force", + "functionType": "ExpressionAndCondition", + "name": "StickForce", + "sentence": "the gamepad _PARAM1_ _PARAM2_ stick force", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const { getNormalizedAxisValue } = gdjs._extensionController;\r", + "\r", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"Stick\").toUpperCase();\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", + "/** @type {Gamepad} */\r", + "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", + "if (!gamepad) {\r", + " // The gamepad is not connected.\r", + " return;\r", + "}\r", + "const axisValueX = stick === 'RIGHT' ? gamepad.axes[2] : gamepad.axes[0];\r", + "const axisValueY = stick === 'RIGHT' ? gamepad.axes[3] : gamepad.axes[1];\r", + "\r", + "eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(\r", + " Math.abs(getNormalizedAxisValue(axisValueX, playerId)) +\r", + " Math.abs(getNormalizedAxisValue(axisValueY, playerId)), 0, 1);\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "Stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "3e4187c0-4978-4d33-a7f7-64ea7ff9548d", - "width": 0, - "x": 1344, - "y": 640, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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 (deprecated)", + "functionType": "Expression", + "name": "StickRotationValue", + "private": true, + "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Gamepads::StickAngle(PlayerId, Stick)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "Stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "1406f52f-153c-4b10-baa4-6b5fdda54048", - "width": 0, - "x": 2112, - "y": 640, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Return the angle 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": "Stick angle", + "functionType": "Expression", + "name": "StickAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const { getNormalizedAxisValue } = gdjs._extensionController;\r", + "\r", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"Stick\").toUpperCase();\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", + "/** @type {Gamepad} */\r", + "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", + "if (!gamepad) {\r", + " // The gamepad is not connected.\r", + " return;\r", + "}\r", + "const axisValueX = stick === 'RIGHT' ? gamepad.axes[2] : gamepad.axes[0];\r", + "const axisValueY = stick === 'RIGHT' ? gamepad.axes[3] : gamepad.axes[1];\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(\r", + " getNormalizedAxisValue(axisValueX, playerId),\r", + " getNormalizedAxisValue(axisValueY, playerId));" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "Stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 180, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "ccd4a0fa-581c-4933-a10b-f2c1ef120793", - "width": 0, - "x": 1728, - "y": 576, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Get the value of axis of a gamepad stick.", + "fullName": "Value of a gamepad axis (deprecated)", + "functionType": "Expression", + "name": "AxisValue", + "private": true, + "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\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", + "/** @type {Gamepad} */\r", + "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", + "if (!gamepad) {\r", + " // The gamepad is not connected.\r", + " 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": "PlayerId", + "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": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "3554af30-b961-4eaf-9cf5-0ad3540bff95", - "width": 0, - "x": -1344, - "y": 0, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Return the gamepad stick force on X axis (from -1 at the left to 1 at the right).", + "fullName": "Stick X force", + "functionType": "Expression", + "name": "StickForceX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\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", + "/** @type {Gamepad} */\r", + "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", + "if (!gamepad) {\r", + " // The gamepad is not connected.\r", + " return;\r", + "}\r", + "const axisIndex = stick === 'right' ? 2 : 0;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[axisIndex], playerId);\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Gamepad", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "Stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "e7a083e6-6a13-49ad-a89d-a308b067bc39", - "width": 0, - "x": -1344, - "y": -640, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Return the gamepad stick force on Y axis (from -1 at the top to 1 at the bottom).", + "fullName": "Stick Y force", + "functionType": "Expression", + "name": "StickForceY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\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", + "/** @type {Gamepad} */\r", + "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", + "if (!gamepad) {\r", + " // The gamepad is not connected.\r", + " return;\r", + "}\r", + "const axisIndex = stick === 'right' ? 3 : 1;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[axisIndex], playerId);\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Gamepad", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "Stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "4a6b79d5-04d7-41dc-b298-f1c4b4489cff", - "width": 0, - "x": -576, - "y": -128, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "\r", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", + "const button = eventsFunctionContext.getArgument(\"Button\").toUpperCase();\r", + "\r", + "let buttonId = gdjs._extensionController.getButtonId(button);\r", + "if (buttonId === null) {\r", + " return;\r", + "}\r", + "const player = gdjs._extensionController.getPlayer(playerId)\r", + "eventsFunctionContext.returnValue = player.isButtonReleased(buttonId);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "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": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "a8218166-4a3c-472b-a07d-204129798258", - "width": 0, - "x": -576, - "y": -512, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Check if a button was just pressed 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 just pressed", + "functionType": "Condition", + "name": "IsButtonJustPressed", + "sentence": "Button _PARAM2_ of gamepad _PARAM1_ was just pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", + "const button = eventsFunctionContext.getArgument(\"Button\").toUpperCase();\r", + "\r", + "let buttonId = gdjs._extensionController.getButtonId(button);\r", + "if (buttonId === null) {\r", + " return;\r", + "}\r", + "const player = gdjs._extensionController.getPlayer(playerId)\r", + "eventsFunctionContext.returnValue = player.isButtonJustPressed(buttonId);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "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": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "e908618e-e7cc-4045-8b46-94621aaddd5f", - "width": 0, - "x": -1280, - "y": -320, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "\r", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.getPlayer(playerId).lastButtonUsed;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "8b08aee5-40d7-4e88-baaa-724339da2676", - "width": 0, - "x": 1408, - "y": 960, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "\r", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", + "const player = gdjs._extensionController.getPlayer(playerId)\r", + "eventsFunctionContext.returnValue = player.isAnyButtonPressed();\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "9e417898-319c-4686-821f-0d3aae0cf39c", - "width": 0, - "x": 1728, - "y": 768, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "\r", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", + "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();\r", + "/** @type {Gamepad} */\r", + "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", + "if (!gamepad) {\r", + " // The gamepad is not connected.\r", + " return;\r", + "}\r", + "const lastButtonUsedID = gdjs._extensionController.getPlayer(playerId).lastButtonUsed;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.getInputString(controllerType, lastButtonUsedID);\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "type": "expression" + }, + { + "description": "Controller type", + "name": "controller_type", + "supplementaryInformation": "[\"Xbox\",\"PS4\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "129fd98d-d1a0-437e-a303-34c6704dca48", - "width": 0, - "x": 1600, - "y": 1536, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Return the number of gamepads.", + "fullName": "Gamepad count", + "functionType": "Expression", + "name": "GamepadCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : [];\r", + "let lastGamepadIndex = -1;\r", + "for (let playerId = 0; playerId < gamepads.length; playerId++) {\r", + " // Gamepads can be disconnected and become null\r", + " if (gamepads[playerId]) {\r", + " lastGamepadIndex = playerId\r", + " }\r", + "}\r", + "eventsFunctionContext.returnValue = lastGamepadIndex + 1;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadCrossroadPath", - "persistentUuid": "db65c2fe-8864-4796-9737-ebcb9e7ef71b", - "width": 0, - "x": 0, - "y": 1792, - "zOrder": 43, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "\r", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", + "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", + "\r", + "const buttonId = gdjs._extensionController.getButtonId(button);\r", + "if (buttonId === null) {\r", + " return;\r", + "}\r", + "const player = gdjs._extensionController.getPlayer(playerId)\r", + "eventsFunctionContext.returnValue = player.isButtonPressed(buttonId);\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "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": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "bc0f10ae-6f79-40a2-bcd9-454922ec5aa7", - "width": 0, - "x": 640, - "y": 1472, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "\r", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.getPlayer(playerId).deadzone;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 270, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "f4fe86be-f476-419f-a8c2-cdb7290fb99a", - "width": 0, - "x": 448, - "y": 1472, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "\r", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", + "const newDeadzone = eventsFunctionContext.getArgument(\"deadzone\");\r", + "\r", + "// https://github.com/4ian/GDevelop-extensions/pull/33#issuecomment-618224857\r", + "gdjs._extensionController.getPlayer(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": "PlayerId", + "type": "expression" + }, + { + "description": "Deadzone for sticks, 0.2 by default (0 to 1)", + "name": "deadzone", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "b8cbd6c9-29ac-404f-a499-8849d840e357", - "width": 0, - "x": 1280, - "y": 1344, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "\r", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\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 direction in condition: \"Gamepad stick pushed (axis)\", is not valid, must be UP, DOWN, LEFT or RIGHT');\r", + " return;\r", + "}\r", + "/** @type {Gamepad} */\r", + "const gamepad = gdjs._extensionController.getGamepad(playerId);\r", + "if (!gamepad) {\r", + " // The gamepad is not connected.\r", + " return;\r", + "}\r", + "const axisValueX = stick === 'RIGHT' ? gamepad.axes[2] : gamepad.axes[0];\r", + "const axisValueY = stick === 'RIGHT' ? gamepad.axes[3] : gamepad.axes[1];\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.isAxisPushed(playerId, direction, axisValueX, axisValueY);\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "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": [] }, { - "angle": 270, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "f8d1e4c8-24fd-4314-a8ad-c36720f56fcd", - "width": 0, - "x": 2240, - "y": 1344, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Return the number of connected gamepads.", + "fullName": "Connected gamepads count", + "functionType": "Expression", + "name": "ConnectedGamepadsCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : [];\r", + "let connectedGamepadCount = 0;\r", + "for (let playerId = 0; playerId < gamepads.length; playerId++) {\r", + " // Gamepads can be disconnected and become null\r", + " if (gamepads[playerId]) {\r", + " connectedGamepadCount++;\r", + " }\r", + "}\r", + "eventsFunctionContext.returnValue = connectedGamepadCount;\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "8a03770e-07a6-419b-95dd-6295893ecfa7", - "width": 0, - "x": 2048, - "y": 1344, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;", + "/** @type {Gamepad} */", + "const gamepad = gdjs._extensionController.getGamepad(playerId);", + "if (!gamepad) {", + " // The gamepad is not connected.", + " 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": "PlayerId", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadIntersectionPath", - "persistentUuid": "a397dd3b-81d1-4a3f-922d-dcd5defd35e0", - "width": 0, - "x": -1920, - "y": 1792, - "zOrder": 44, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;", + "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();", + "/** @type {Gamepad} */", + "const gamepad = gdjs._extensionController.getGamepad(playerId);", + "if (!gamepad) {", + " // The gamepad is not connected.", + " 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": "PlayerId", + "type": "expression" + }, + { + "description": "Type: \"Xbox\", \"PS4\", \"Steam\" or \"PS3\" (among other)", + "name": "controller_type", + "type": "string" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "85f422a3-4acc-410b-846f-8a18820411c9", - "width": 1536, - "x": -1536, - "y": 1792, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;", + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : [];", + "// 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": "PlayerId", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "30e259c2-b893-48d6-b07b-c3b0de682167", - "width": 0, - "x": -960, - "y": 3200, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;", + "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", + "/** @type {Gamepad} */", + "const gamepad = gdjs._extensionController.getGamepad(playerId);", + "if (!gamepad) {", + " // The gamepad is not connected.", + " return;", + "}", + "//Vibration work only on game in browser.", + "if (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": "PlayerId", + "type": "expression" + }, + { + "description": "Time of the vibration, in seconds (optional, default value is 1)", + "name": "Duration", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "9818f0b2-49d6-4351-8d89-27dd81b1e6f8", - "width": 0, - "x": -576, - "y": 3392, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "const { clamp } = gdjs.evtTools.common;", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;", + "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", + "const strongRumbleMagnitude = clamp(eventsFunctionContext.getArgument(\"StrongMagnitude\"), 0, 1);", + "const weakRumbleMagnitude = clamp(eventsFunctionContext.getArgument(\"WeakMagnitude\"), 0, 1);", + "/** @type {Gamepad} */", + "const gamepad = gdjs._extensionController.getGamepad(playerId);", + "if (!gamepad) {", + " // The gamepad is not connected.", + " return;", + "}", + "//Vibration work only on game in browser.", + "if (gamepad.vibrationActuator) {", + " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", + " startDelay: 0,", + " duration: duration * 1000,", + " weakMagnitude: weakRumbleMagnitude,", + " strongMagnitude: strongRumbleMagnitude", + " });", + "}", + "const player = gdjs._extensionController.getPlayer(playerId)", + "player.rumble.duration = duration;", + "player.rumble.elapsedTime = 0;", + "player.rumble.weakMagnitude = weakRumbleMagnitude;", + "player.rumble.strongMagnitude = strongRumbleMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "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": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "0e519ba6-bc33-45f5-878b-06e37ec35d59", - "width": 0, - "x": -256, - "y": 2624, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "const { clamp } = gdjs.evtTools.common;", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;", + "const player = gdjs._extensionController.getPlayer(playerId);", + "const elapsedTime = player.rumble.elapsedTime || 0;", + "const originalDuration = player.rumble.duration || 1;", + "const strongRumbleMagnitude = clamp(eventsFunctionContext.getArgument(\"StrongMagnitude\"), 0, 1);", + "const weakRumbleMagnitude = clamp(eventsFunctionContext.getArgument(\"WeakMagnitude\"), 0, 1);", + "/** @type {Gamepad} */", + "const gamepad = gdjs._extensionController.getGamepad(playerId);", + "if (!gamepad) {", + " // The gamepad is not connected.", + " return;", + "}", + "if (originalDuration - elapsedTime <= 0) return;", + "//Vibration work only on game in browser.", + "if (gamepad.vibrationActuator) {", + " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", + " startDelay: 0,", + " duration: 1000 * (originalDuration - elapsedTime),", + " weakMagnitude: weakRumbleMagnitude,", + " strongMagnitude: strongRumbleMagnitude", + " });", + "}", + "", + "player.rumble.weakMagnitude = weakRumbleMagnitude;", + "player.rumble.strongMagnitude = strongRumbleMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "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": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "79060b35-70d2-4426-946f-02b7d702354b", - "width": 0, - "x": -192, - "y": 3328, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [ + "\r", + "const playerId = eventsFunctionContext.getArgument(\"PlayerId\") - 1;\r", + "const player = gdjs._extensionController.getPlayer(playerId)\r", + "eventsFunctionContext.returnValue = player.isAnyButtonReleased();" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "3dafd08a-bc5a-4d6d-af3e-e57eb432a56d", - "width": 0, - "x": -1472, - "y": 2624, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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(\"PlayerId\") - 1;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.getPlayer(playerId).rumble.weakMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "f7963d9e-d1c6-4505-8e74-c0a17c473b7e", - "width": 0, - "x": -960, - "y": 2304, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "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(\"PlayerId\") - 1;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.getPlayer(playerId).rumble.strongMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "PlayerId", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "0ee005d2-a09c-4d0c-a33b-27364608dd73", - "width": 0, - "x": -192, - "y": 2304, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Control a platformer character with a gamepad.", + "fullName": "Platformer gamepad mapper", + "name": "PlatformerGamepadMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "GamepadIdentifier", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "UseArrows", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"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": [ + "", + "GamepadIdentifier", + "\"Down\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "UseLeftStick", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"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": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "UseRightStick", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"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": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "Buttons[JumpButton]", + "\"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", + "extraInformation": [ + "PlatformBehavior::PlatformerObjectBehavior" + ], + "choices": [], + "name": "PlatformerCharacter" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "name": "GamepadIdentifier" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use directional pad", + "group": "Controls", + "name": "UseArrows" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use left stick", + "group": "Controls", + "name": "UseLeftStick" + }, + { + "value": "", + "type": "Boolean", + "label": "Use right stick", + "group": "Controls", + "name": "UseRightStick" + }, + { + "value": "A or Cross", + "type": "Choice", + "label": "Jump button", + "group": "Controls", + "choices": [ + { + "label": "A or Cross", + "value": "A or Cross" + }, + { + "label": "B or Circle", + "value": "B or Circle" + }, + { + "label": "X or Square", + "value": "X or Square" + }, + { + "label": "Y or Triangle", + "value": "Y or Triangle" + }, + { + "label": "LB or L1", + "value": "LB or L1" + }, + { + "label": "RB or R1", + "value": "RB or R1" + }, + { + "label": "LT or L2", + "value": "LT or L2" + }, + { + "label": "RT or R2", + "value": "RT or R2" + } + ], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] }, { - "angle": 180, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "16c1e9a8-7cc9-4fee-8d01-d3372e4d5e81", - "width": 0, - "x": -576, - "y": 2240, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Control a 3D physics character with a gamepad.", + "fullName": "3D platformer gamepad mapper", + "name": "Platformer3DGamepadMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "GamepadIdentifier", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "GamepadIdentifier", + "JoystickIdentifier", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SetForwardAngle" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D", + "=", + "Gamepads::StickAngle(GamepadIdentifier, JoystickIdentifier) + CameraAngle(Object.Layer())" + ] + }, + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D", + "-90", + "Gamepads::StickForce(GamepadIdentifier, JoystickIdentifier)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "Buttons[JumpButton]", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::Platformer3DGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D physics character", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "choices": [], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "name": "GamepadIdentifier" + }, + { + "value": "Left", + "type": "Choice", + "label": "Walk joystick", + "group": "Controls", + "choices": [ + { + "label": "Left", + "value": "Left" + }, + { + "label": "Right", + "value": "Right" + } + ], + "name": "JoystickIdentifier" + }, + { + "value": "A or Cross", + "type": "Choice", + "label": "Jump button", + "group": "Controls", + "choices": [ + { + "label": "A or Cross", + "value": "A or Cross" + }, + { + "label": "B or Circle", + "value": "B or Circle" + }, + { + "label": "X or Square", + "value": "X or Square" + }, + { + "label": "Y or Triangle", + "value": "Y or Triangle" + }, + { + "label": "LB or L1", + "value": "LB or L1" + }, + { + "label": "RB or R1", + "value": "RB or R1" + }, + { + "label": "LT or L2", + "value": "LT or L2" + }, + { + "label": "RT or R2", + "value": "RT or R2" + } + ], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "51eab286-233a-4cd3-bd7f-2bad20a6a2de", - "width": 0, - "x": -1344, - "y": 3328, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Control a 3D physics character with a gamepad.", + "fullName": "3D shooter gamepad mapper", + "name": "Shooter3DGamepadMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "GamepadIdentifier", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "GamepadIdentifier", + "WalkStick", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D", + "Gamepads::StickAngle(GamepadIdentifier, WalkStick)", + "Gamepads::StickForce(GamepadIdentifier, WalkStick)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "Buttons[JumpButton]", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::Shooter3DGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D physics character", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "choices": [], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "name": "GamepadIdentifier" + }, + { + "value": "Left", + "type": "Choice", + "label": "Walk joystick", + "group": "Controls", + "choices": [ + { + "label": "Left", + "value": "Left" + }, + { + "label": "Right", + "value": "Right" + } + ], + "name": "WalkStick" + }, + { + "value": "Right", + "type": "Choice", + "label": "Camera joystick", + "group": "Controls", + "choices": [ + { + "label": "Left", + "value": "Left" + }, + { + "label": "Right", + "value": "Right" + } + ], + "name": "CameraStick" + }, + { + "value": "A or Cross", + "type": "Choice", + "label": "Jump button", + "group": "Controls", + "choices": [ + { + "label": "A or Cross", + "value": "A or Cross" + }, + { + "label": "B or Circle", + "value": "B or Circle" + }, + { + "label": "X or Square", + "value": "X or Square" + }, + { + "label": "Y or Triangle", + "value": "Y or Triangle" + }, + { + "label": "LB or L1", + "value": "LB or L1" + }, + { + "label": "RB or R1", + "value": "RB or R1" + }, + { + "label": "LT or L2", + "value": "LT or L2" + }, + { + "label": "RT or R2", + "value": "RT or R2" + } + ], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "69a45893-74cb-4f02-b3dd-4d3ec60cfc75", - "width": 0, - "x": -1344, - "y": 2304, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Control camera rotations with a gamepad.", + "fullName": "First person camera gamepad mapper", + "name": "FirstPersonGamepadMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "TODO It's probably a bad idea to rotate the object around Y." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CurrentRotationSpeedZ", + "=", + "Gamepads::AcceleratedSpeed(CurrentRotationSpeedZ, Gamepads::StickForceX(GamepadIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "CurrentRotationSpeedZ * TimeDelta()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CurrentRotationSpeedY", + "=", + "Gamepads::AcceleratedSpeed(CurrentRotationSpeedY, Gamepads::StickForceY(GamepadIdentifier, CameraStick) * VerticalRotationSpeedMax, VerticalRotationSpeedMax, VerticalRotationAcceleration, VerticalRotationDeceleration)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "CurrentRotationSpeedY * TimeDelta()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "clamp(Object.Object3D::RotationY(), VerticalAngleMin, VerticalAngleMax)" + ] + }, + { + "type": { + "value": "Gamepads::FirstPersonGamepadMapper::LookFromObjectEyes" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera to look though _PARAM1_ eyes. The object must look to the right when all its angles are 0 and the top of its head be toward Z+.", + "fullName": "Look through object eyes", + "functionType": "Action", + "group": "Layers and cameras", + "name": "LookFromObjectEyes", + "private": true, + "sentence": "Move the camera to look though _PARAM0_ eyes", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "CentreCamera" + }, + "parameters": [ + "", + "Object", + "", + "Object.Layer()", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraZ" + }, + "parameters": [ + "", + "=", + "Object.Object3D::Z() + Object.Object3D::Depth() + OffsetZ", + "", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraRotationX" + }, + "parameters": [ + "", + "=", + "- Object.Object3D::RotationY() + 90", + "GetArgumentAsString(\"Layer\")", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraRotationY" + }, + "parameters": [ + "", + "=", + "Object.Object3D::RotationX()", + "GetArgumentAsString(\"Layer\")", + "" + ] + }, + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "=", + "Object.Angle() + 90", + "Object.Layer()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum horizontal rotation speed of the object.", + "fullName": "Maximum horizontal rotation speed", + "functionType": "ExpressionAndCondition", + "group": "First person camera gamepad mapper horizontal rotation configuration", + "name": "HorizontalRotationSpeedMax", + "sentence": "the maximum horizontal rotation speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "HorizontalRotationSpeedMax" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationSpeedMax", + "name": "SetHorizontalRotationSpeedMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "HorizontalRotationSpeedMax", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the horizontal rotation acceleration of the object.", + "fullName": "Horizontal rotation acceleration", + "functionType": "ExpressionAndCondition", + "group": "First person camera gamepad mapper horizontal rotation configuration", + "name": "HorizontalRotationAcceleration", + "sentence": "the horizontal rotation acceleration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "HorizontalRotationAcceleration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationAcceleration", + "name": "SetHorizontalRotationAcceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "HorizontalRotationAcceleration", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the horizontal rotation deceleration of the object.", + "fullName": "Horizontal rotation deceleration", + "functionType": "ExpressionAndCondition", + "group": "First person camera gamepad mapper horizontal rotation configuration", + "name": "HorizontalRotationDeceleration", + "sentence": "the horizontal rotation deceleration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "HorizontalRotationDeceleration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationDeceleration", + "name": "SetHorizontalRotationDeceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "HorizontalRotationDeceleration", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum vertical rotation speed of the object.", + "fullName": "Maximum vertical rotation speed", + "functionType": "ExpressionAndCondition", + "group": "First person camera gamepad mapper vertical rotation configuration", + "name": "VerticalRotationSpeedMax", + "sentence": "the maximum vertical rotation speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "VerticalRotationSpeedMax" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationSpeedMax", + "name": "SetVerticalRotationSpeedMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "VerticalRotationSpeedMax", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the vertical rotation acceleration of the object.", + "fullName": "Vertical rotation acceleration", + "functionType": "ExpressionAndCondition", + "group": "First person camera gamepad mapper vertical rotation configuration", + "name": "VerticalRotationAcceleration", + "sentence": "the vertical rotation acceleration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "VerticalRotationAcceleration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationAcceleration", + "name": "SetVerticalRotationAcceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "VerticalRotationAcceleration", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the vertical rotation deceleration of the object.", + "fullName": "Vertical rotation deceleration", + "functionType": "ExpressionAndCondition", + "group": "First person camera gamepad mapper vertical rotation configuration", + "name": "VerticalRotationDeceleration", + "sentence": "the vertical rotation deceleration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "VerticalRotationDeceleration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationDeceleration", + "name": "SetVerticalRotationDeceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "VerticalRotationDeceleration", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the minimum vertical camera angle of the object.", + "fullName": "Minimum vertical camera angle", + "functionType": "ExpressionAndCondition", + "group": "First person camera gamepad mapper vertical rotation configuration", + "name": "VerticalAngleMin", + "sentence": "the minimum vertical camera angle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "VerticalAngleMin" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalAngleMin", + "name": "SetVerticalAngleMin", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "VerticalAngleMin", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum vertical camera angle of the object.", + "fullName": "Maximum vertical camera angle", + "functionType": "ExpressionAndCondition", + "group": "First person camera gamepad mapper vertical rotation configuration", + "name": "VerticalAngleMax", + "sentence": "the maximum vertical camera angle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "VerticalAngleMax" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalAngleMax", + "name": "SetVerticalAngleMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "VerticalAngleMax", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the z position offset of the object.", + "fullName": "Z position offset", + "functionType": "ExpressionAndCondition", + "group": "First person camera gamepad mapper position configuration", + "name": "OffsetZ", + "sentence": "the z position offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "OffsetZ" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "OffsetZ", + "name": "SetOffsetZ", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OffsetZ", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "choices": [], + "name": "Object3D" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "name": "GamepadIdentifier" + }, + { + "value": "Right", + "type": "Choice", + "label": "Camera joystick", + "choices": [ + { + "label": "Left", + "value": "Left" + }, + { + "label": "Right", + "value": "Right" + } + ], + "name": "CameraStick" + }, + { + "value": "180", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "group": "Horizontal rotation", + "name": "HorizontalRotationSpeedMax" + }, + { + "value": "360", + "type": "Number", + "label": "Rotation acceleration", + "group": "Horizontal rotation", + "name": "HorizontalRotationAcceleration" + }, + { + "value": "720", + "type": "Number", + "label": "Rotation deceleration", + "group": "Horizontal rotation", + "name": "HorizontalRotationDeceleration" + }, + { + "value": "120", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "group": "Vertical rotation", + "name": "VerticalRotationSpeedMax" + }, + { + "value": "240", + "type": "Number", + "label": "Rotation acceleration", + "group": "Vertical rotation", + "name": "VerticalRotationAcceleration" + }, + { + "value": "480", + "type": "Number", + "label": "Rotation deceleration", + "group": "Vertical rotation", + "name": "VerticalRotationDeceleration" + }, + { + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Minimum angle", + "group": "Vertical rotation", + "name": "VerticalAngleMin" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Maximum angle", + "group": "Vertical rotation", + "name": "VerticalAngleMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z position offset", + "group": "Position", + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Z", + "hidden": true, + "name": "CurrentRotationSpeedZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Y", + "hidden": true, + "name": "CurrentRotationSpeedY" + } + ], + "sharedPropertyDescriptors": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "52324b1a-e783-4ce6-8e63-0cedbcb8ce20", - "width": 0, - "x": -576, - "y": 3200, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Control a 3D physics car with a gamepad.", + "fullName": "3D car gamepad mapper", + "name": "PhysicsCar3DGamepadMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "GamepadIdentifier", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "UseArrows", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateLeftKey" + }, + "parameters": [ + "Object", + "PhysicsCar3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateRightKey" + }, + "parameters": [ + "Object", + "PhysicsCar3D" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "UseLeftStick", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "1", + "\"Left\"", + "\"Any\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateSteeringStick" + }, + "parameters": [ + "Object", + "PhysicsCar3D", + "Gamepads::StickForceX(GamepadIdentifier, \"Left\")" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "UseRightStick", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "1", + "\"Right\"", + "\"Any\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateSteeringStick" + }, + "parameters": [ + "Object", + "PhysicsCar3D", + "Gamepads::StickForceX(GamepadIdentifier, \"Right\")" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "1", + "\"LT\"", + "\"Up\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "1", + "\"RT\"", + "\"Up\"" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateAcceleratorStick" + }, + "parameters": [ + "Object", + "PhysicsCar3D", + "Gamepads::TriggerPressure(GamepadIdentifier, \"RT\") - Gamepads::TriggerPressure(GamepadIdentifier, \"LT\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "Buttons[HandBrakeButton]", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateHandBrakeKey" + }, + "parameters": [ + "Object", + "PhysicsCar3D" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::PhysicsCar3DGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D physics car", + "extraInformation": [ + "Physics3D::PhysicsCar3D" + ], + "choices": [], + "name": "PhysicsCar3D" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "name": "GamepadIdentifier" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use directional pad", + "group": "Controls", + "name": "UseArrows" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use left stick", + "group": "Controls", + "name": "UseLeftStick" + }, + { + "value": "", + "type": "Boolean", + "label": "Use right stick", + "group": "Controls", + "name": "UseRightStick" + }, + { + "value": "B or Circle", + "type": "Choice", + "label": "Hand brake button", + "group": "Controls", + "choices": [ + { + "label": "A or Cross", + "value": "A or Cross" + }, + { + "label": "B or Circle", + "value": "B or Circle" + }, + { + "label": "X or Square", + "value": "X or Square" + }, + { + "label": "Y or Triangle", + "value": "Y or Triangle" + }, + { + "label": "LB or L1", + "value": "LB or L1" + }, + { + "label": "RB or R1", + "value": "RB or R1" + }, + { + "label": "LT or L2", + "value": "LT or L2" + }, + { + "label": "RT or R2", + "value": "RT or R2" + } + ], + "name": "HandBrakeButton" + } + ], + "sharedPropertyDescriptors": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "b5ceb42e-5a5f-48f7-ba7f-3fdd7c029004", - "width": 0, - "x": -576, - "y": 2432, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "description": "Control a top-down character with a gamepad.", + "fullName": "Top-down gamepad mapper", + "name": "TopDownGamepadMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "GamepadIdentifier", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "UseArrows", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Up\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Down\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "UseLeftStick", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "StickMode", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "Gamepads::StickRotationValue(GamepadIdentifier, \"Left\")", + "Gamepads::StickForce(GamepadIdentifier, \"Left\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "StickMode", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "Gamepads::StickRotationValue(GamepadIdentifier, \"Left\")", + "sign(Gamepads::StickForce(GamepadIdentifier, \"Left\"))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "StickMode", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "UseRightStick", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "StickMode", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "Gamepads::StickRotationValue(GamepadIdentifier, \"Right\")", + "Gamepads::StickForce(GamepadIdentifier, \"Right\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "StickMode", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "sign(Gamepads::StickForce(GamepadIdentifier, \"Right\"))", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "StickMode", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"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", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" + ], + "choices": [], + "name": "TopDownMovement" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "name": "GamepadIdentifier" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use directional pad", + "group": "Controls", + "name": "UseArrows" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use left stick", + "group": "Controls", + "name": "UseLeftStick" + }, + { + "value": "", + "type": "Boolean", + "label": "Use right stick", + "group": "Controls", + "name": "UseRightStick" + }, + { + "value": "Analog", + "type": "Choice", + "label": "Stick mode", + "group": "Controls", + "choices": [ + { + "label": "Analog", + "value": "Analog" + }, + { + "label": "360°", + "value": "360°" + }, + { + "label": "8 Directions", + "value": "8 Directions" + } + ], + "name": "StickMode" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Input", + "extensionNamespace": "", + "fullName": "Multitouch joystick and buttons (sprite)", + "gdevelopVersion": ">=5.5.222", + "helpPath": "/objects/multitouch-joystick", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMTYiIGN5PSIxNiIgcj0iMTMiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjI4LjQsMTIgMjAsMTIgMjAsMy42ICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMjAsMjguNCAyMCwyMCAyOC40LDIwICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMy42LDIwIDEyLDIwIDEyLDI4LjQgIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIxMiwzLjYgMTIsMTIgMy42LDEyICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIxNiw2IDE2LjcsNyAxNS4zLDcgIi8+DQo8cG9seWdvbiBjbGFzcz0ic3QwIiBwb2ludHM9IjE2LDI2IDE1LjMsMjUgMTYuNywyNSAiLz4NCjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iNiwxNiA3LDE1LjMgNywxNi43ICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIyNiwxNiAyNSwxNi43IDI1LDE1LjMgIi8+DQo8L3N2Zz4NCg==", + "name": "SpriteMultitouchJoystick", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Videogames/Videogames_controller_joystick_arrows_direction.svg", + "shortDescription": "Joysticks or buttons for touchscreens.", + "version": "1.9.0", + "description": [ + "Multitouch joysticks are objects showing a joystick on the screen, useful for mobile. They work like a physical gamepad:", + "- 4 or 8 directions", + "- Analogus pads", + "- Player selection", + "- Automatic \"mapper\" behaviors for 2D and 3D movement behaviors (platformer characters, top-down movement, 3D character etc...). Add one of these to the object with the movement behavior (i.e: the player most of the time) and the behavior will then be controlled automatically by the virtual joystick (it works by reading the multitouch joystick state and simulating controls). No need for additional events to make it work once the behaviors are set up.", + "", + "There are ready-to-use joysticks in the asset-store [multitouch joysticks pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=multitouch-joysticks-multitouch-joysticks)." + ], + "origin": { + "identifier": "SpriteMultitouchJoystick", + "name": "gdevelop-extension-store" + }, + "tags": [ + "multitouch", + "joystick", + "thumbstick", + "controller", + "touchscreen", + "twin stick", + "shooter", + "virtual", + "platformer", + "platform", + "top-down" + ], + "authorIds": [ + "gqDaZjCfevOOxBYkK6zlhtZnXCg1", + "1OgYzWp5UeVPbiWGJwI6vqfgZLC3", + "v0YRpdAnIucZFgiRCCecqVnGKno2", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [ { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "5d16e34c-fa37-4980-8d2d-ba7d59b70ce5", - "width": 0, - "x": -1280, - "y": 2624, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "name": "Controllers", + "type": "array", + "children": [ + { + "type": "structure", + "children": [ + { + "name": "Buttons", + "type": "array", + "children": [ + { + "type": "structure", + "children": [ + { + "name": "State", + "type": "string", + "value": "Idle" + } + ] + } + ] + }, + { + "name": "Joystick", + "type": "structure", + "children": [] + } + ] + } + ] + } + ], + "eventsFunctions": [ { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "8597e021-5cf8-4527-a84e-be8866d231cf", - "width": 0, - "x": -1280, - "y": 3008, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Check if the events are running for the editor.", + "fullName": "Editor is running", + "functionType": "Condition", + "name": "IsInGameEdition", + "private": true, + "sentence": "Events are running for the editor", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const game = runtimeScene.getGame();\r", + "eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] }, { - "angle": 270, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "3ef7e679-1788-43c0-a483-2d95bc7ba2e1", - "width": 0, - "x": -64, - "y": 3008, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "fullName": "Accelerated speed", + "functionType": "Expression", + "name": "AcceleratedSpeed", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "CurrentSpeed" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TargetedSpeed", + "<", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Reduce the speed to match the stick force." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "-", + "Acceleration * TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Turn back at least as fast as it would stop." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TargetedSpeed", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Reduce the speed to match the stick force." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "+", + "Acceleration * TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Turn back at least as fast as it would stop." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TargetedSpeed", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(0, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(0, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "clamp(AcceleratedSpeed, -SpeedMax, SpeedMax)" + ] + } + ] + } + ], + "variables": [ + { + "name": "AcceleratedSpeed", + "type": "number", + "value": 0 + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Current speed", + "name": "CurrentSpeed", + "type": "expression" + }, + { + "description": "Targeted speed", + "name": "TargetedSpeed", + "type": "expression" + }, + { + "description": "Max speed", + "name": "SpeedMax", + "type": "expression" + }, + { + "description": "Acceleration", + "name": "Acceleration", + "type": "expression" + }, + { + "description": "Deceleration", + "name": "Deceleration", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "57c955bf-7628-4e0d-ae4e-94bad825c46b", - "width": 0, - "x": -256, - "y": 3008, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Check if a button was just pressed on a multitouch controller.", + "fullName": "Multitouch controller button just pressed", + "functionType": "Condition", + "name": "IsButtonJustPressed", + "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ was just pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Buttons[Button].State", + "=", + "\"JustPressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Button name", + "name": "Button", + "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", + "type": "string" + } + ], + "objectGroups": [] }, { - "angle": 90, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "cafa31dd-6a62-47eb-888e-01102ffb26a8", - "width": 1280, - "x": -448, - "y": 2624, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Check if a button is pressed on a multitouch controller.", + "fullName": "Multitouch controller button pressed", + "functionType": "Condition", + "name": "IsButtonPressed", + "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Buttons[Button].State", + "=", + "\"Pressed\"" + ] + }, + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Buttons[Button].State", + "=", + "\"JustPressed\"" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Button name", + "name": "Button", + "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", + "type": "string" + } + ], + "objectGroups": [] }, { - "angle": 90, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "f5e3da38-0e7f-4a2d-a67c-cc94237894de", - "width": 384, - "x": -1920, - "y": 2176, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Check if a button is released on a multitouch controller.", + "fullName": "Multitouch controller button released", + "functionType": "Condition", + "name": "IsButtonReleased", + "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is released", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Buttons[Button].State", + "=", + "\"Released\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Button name", + "name": "Button", + "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", + "type": "string" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Coin", - "persistentUuid": "12c47bb0-be33-4a62-9704-9221aeb0cf9b", - "rotationY": 90, - "width": 0, - "x": 1056, - "y": 3584, - "z": 21, - "zOrder": 27, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Change a button state for a multitouch controller.", + "fullName": "Button state", + "functionType": "Action", + "name": "SetButtonState", + "private": true, + "sentence": "Mark _PARAM2_ button as _PARAM3_ for multitouch controller _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Buttons[Button].State", + "=", + "ButtonState" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Button name", + "name": "Button", + "type": "string" + }, + { + "description": "Button state", + "name": "ButtonState", + "supplementaryInformation": "[\"Idle\",\"Pressed\",\"JustPressed\",\"Released\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Coin", - "persistentUuid": "d704a44e-8c28-470c-97d7-3a18110b9249", - "rotationY": 90, - "width": 0, - "x": 864, - "y": 3584, - "z": 21, - "zOrder": 27, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Change the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", + "fullName": "Dead zone radius", + "functionType": "Action", + "name": "SetDeadZone", + "private": true, + "sentence": "Change the dead zone of multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", + "=", + "DeadZoneRadius" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "type": "string" + }, + { + "description": "Dead zone radius", + "name": "DeadZoneRadius", + "supplementaryInformation": "[]", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Coin", - "persistentUuid": "c26ba544-05c0-4616-b18c-85093d694e23", - "rotationY": 90, - "width": 0, - "x": 960, - "y": 3584, - "z": 21, - "zOrder": 27, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Return the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", + "fullName": "Dead zone radius", + "functionType": "Expression", + "name": "DeadZone", + "private": true, + "sentence": "Change multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ dead zone to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "type": "string" + } + ], + "objectGroups": [] }, { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "Van", - "persistentUuid": "1e5faafc-0bda-492c-af93-c27000718f46", - "width": 0, - "x": 2136, - "y": 3522, - "z": 4, - "zOrder": 37, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "the direction index (left = 1, bottom = 1, right = 2, top = 3) for an angle (in degrees).", + "fullName": "Angle to 4-way index", + "functionType": "ExpressionAndCondition", + "name": "AngleTo4Way", + "private": true, + "sentence": "The angle _PARAM1_ 4-way index", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "mod(round(Angle * 4 / 360), 4)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Angle", + "name": "Angle", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "Van", - "persistentUuid": "5676bf7a-da5c-47dd-9b3c-6133f151fc78", - "width": 0, - "x": 1528, - "y": 3522, - "z": 4, - "zOrder": 37, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "the direction index (left = 1, bottom-left = 1... top-left = 7) for an angle (in degrees).", + "fullName": "Angle to 8-way index", + "functionType": "ExpressionAndCondition", + "name": "AngleTo8Way", + "private": true, + "sentence": "The angle _PARAM1_ 8-way index", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "mod(round(Angle * 8 / 360), 8)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Angle", + "name": "Angle", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "505fcfa8-b875-4017-b97a-a3180a21db6c", - "width": 1920, - "x": 384, - "y": 3456, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Check if angle is in a given direction.", + "fullName": "Angle 4-way direction", + "functionType": "Condition", + "name": "IsAngleIn4WayDirection", + "private": true, + "sentence": "The angle _PARAM1_ is the 4-way direction _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Direction", + "=", + "\"Right\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo4Way" + }, + "parameters": [ + "", + "=", + "0", + "Angle", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Direction", + "=", + "\"Down\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo4Way" + }, + "parameters": [ + "", + "=", + "1", + "Angle", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Direction", + "=", + "\"Left\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo4Way" + }, + "parameters": [ + "", + "=", + "2", + "Angle", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Direction", + "=", + "\"Up\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo4Way" + }, + "parameters": [ + "", + "=", + "3", + "Angle", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Angle", + "name": "Angle", + "type": "expression" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "670a9aed-5b62-4372-8ef0-7f2753671574", - "width": 0, - "x": 960, - "y": 3200, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Check if angle is in a given direction.", + "fullName": "Angle 8-way direction", + "functionType": "Condition", + "name": "IsAngleIn8WayDirection", + "private": true, + "sentence": "The angle _PARAM1_ is the 8-way direction _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Direction", + "=", + "\"Right\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "0", + "Angle", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Direction", + "=", + "\"DownRight\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "1", + "Angle", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Direction", + "=", + "\"Down\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "2", + "Angle", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Direction", + "=", + "\"DownLeft\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "3", + "Angle", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Direction", + "=", + "\"Left\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "4", + "Angle", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Direction", + "=", + "\"UpLeft\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "5", + "Angle", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Direction", + "=", + "\"Up\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "6", + "Angle", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Direction", + "=", + "\"UpRight\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "7", + "Angle", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Angle", + "name": "Angle", + "type": "expression" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "131d5b79-9334-4560-bb45-1853f4ee8409", - "width": 0, - "x": 1344, - "y": 3392, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (4-way)", + "functionType": "Condition", + "name": "IsDirectionPushed4Way", + "sentence": "Joystick _PARAM2_ of multitouch controller _PARAM1_ is pushed in direction _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make sure the joystick has moved from center" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::JoystickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "JoystickIdentifier", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::IsAngleIn4WayDirection" + }, + "parameters": [ + "", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "0a245aa6-4d32-47dc-862b-6a1e0c383fe1", - "width": 0, - "x": 2048, - "y": 2624, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (8-way)", + "functionType": "Condition", + "name": "IsDirectionPushed8Way", + "sentence": "Joystick _PARAM2_ of multitouch controller _PARAM1_ is pushed in direction _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make sure the joystick has moved from center" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::JoystickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "JoystickIdentifier", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::IsAngleIn8WayDirection" + }, + "parameters": [ + "", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "72522327-805e-44c9-ab71-fdde779cfa65", - "width": 0, - "x": 2112, - "y": 3328, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "the percentage the thumb has been pulled away from the joystick center (Range: 0 to 1).", + "fullName": "Joystick force (deprecated)", + "functionType": "ExpressionAndCondition", + "name": "JoystickForce", + "private": true, + "sentence": "Joystick _PARAM2_ of multitouch controller _PARAM1_ force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + }, + { + "description": "", + "name": "Coucou", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "5ff3314b-0821-45c6-bb61-43342f73487b", - "width": 0, - "x": 448, - "y": 2624, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "the force of multitouch contoller stick (from 0 to 1).", + "fullName": "Stick force", + "functionType": "ExpressionAndCondition", + "name": "StickForce", + "sentence": "multitouch controller _PARAM1_ _PARAM2_ stick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "max(0, Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier)) / (1 - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Stick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "8e855d0d-dcc3-40df-81e7-4f7ec1af34d4", - "width": 0, - "x": 1728, - "y": 2432, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Change the percentage the thumb has been pulled away from the joystick center (Range: 0 to 1).", + "fullName": "Joystick force", + "functionType": "Action", + "name": "SetJoystickForce", + "private": true, + "sentence": "Change the force of the joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "type": "string" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "dc228875-2528-44f3-8b59-93dfdb22f738", - "width": 0, - "x": 2112, - "y": 2304, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Return the angle the joystick is pointing towards (Range: -180 to 180).", + "fullName": "Joystick angle (deprecated)", + "functionType": "Expression", + "name": "JoystickAngle", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 180, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "9c3d5bba-3a57-4195-83a9-d138fa5bba85", - "width": 0, - "x": 960, - "y": 2240, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Return the angle the multitouch controller stick is pointing towards (Range: -180 to 180).", + "fullName": "Stick angle", + "functionType": "Expression", + "name": "StickAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "94264588-2af8-4601-babd-82a8707c4d48", - "width": 0, - "x": 576, - "y": 3328, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Change the angle the joystick is pointing towards (Range: -180 to 180).", + "fullName": "Joystick angle", + "functionType": "Action", + "name": "SetJoystickAngle", + "private": true, + "sentence": "Change the angle of the joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "type": "string" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "f00e1f37-e3dc-4e6c-8c48-06d721cd293b", - "width": 0, - "x": 576, - "y": 2304, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Return the multitouch contoller stick force on X axis (from -1 at the left to 1 at the right).", + "fullName": "Stick X force", + "functionType": "Expression", + "name": "StickForceX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "XFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "94215059-7baf-45a8-94cb-6e9c0e6e7ed1", - "width": 0, - "x": 1344, - "y": 3200, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Return the multitouch contoller stick force on Y axis (from -1 at the top to 1 at the bottom).", + "fullName": "Stick Y force", + "functionType": "Expression", + "name": "StickForceY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "YFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "d03f1ecc-4a49-42cc-aa64-dd21d98a82ea", - "width": 0, - "x": 960, - "y": 2432, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "description": "Check if a new touch has started on the right or left side of the screen.", + "fullName": "New touch on a screen side", + "functionType": "Condition", + "group": "Multitouch Joystick", + "name": "HasTouchStartedOnScreenSide", + "sentence": "A new touch has started on the _PARAM2_ side of the screen on _PARAM1_'s layer", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Side", + "=", + "\"Left\"" + ] + }, + { + "type": { + "value": "TouchX" + }, + "parameters": [ + "", + "StartedTouchOrMouseId(0)", + "<", + "CameraCenterX(Object.Layer())", + "Object.Layer()", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Side", + "=", + "\"Right\"" + ] + }, + { + "type": { + "value": "TouchX" + }, + "parameters": [ + "", + "StartedTouchOrMouseId(0)", + ">=", + "CameraCenterX(Object.Layer())", + "Object.Layer()", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch joystick", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "objectList" + }, + { + "description": "Screen side", + "name": "Side", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "523a2321-57df-4e52-8ead-5b949450d94f", - "width": 0, - "x": 640, - "y": 2624, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Joystick that can be controlled by interacting with a touchscreen.", + "fullName": "Multitouch Joystick", + "name": "MultitouchJoystick", + "objectType": "", + "private": true, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SetDeadZone" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "DeadZoneRadius", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::IsInGameEdition" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasGameJustResumed" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Manage touches", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchIndex", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StartedTouchOrMouseCount()", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TouchId", + "=", + "0" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchId", + "=", + "StartedTouchOrMouseId(TouchIndex)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchIndex", + "+", + "1" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Move thumb back to center when not being pressed (acts like a spring on a real controller)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasTouchEnded" + }, + "parameters": [ + "", + "TouchId" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Update joystick position", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TouchId", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickAngle" + }, + "parameters": [ + "Object", + "Behavior", + "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(TouchId, Object.Layer(), 0), TouchY(TouchId, Object.Layer(), 0))", + "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(TouchId, Object.Layer(), 0), TouchY(TouchId, Object.Layer(), 0))" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(2 * DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(TouchId, Object.Layer(), 0), TouchY(TouchId, Object.Layer(), 0)) / Object.Width(), 0, 1)", + "" + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick force (from 0 to 1).", + "fullName": "Joystick force", + "functionType": "ExpressionAndCondition", + "name": "JoystickForce", + "sentence": "the joystick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "max(0, JoystickForce - DeadZoneRadius) / (1 - DeadZoneRadius)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JoystickForce", + "name": "SetJoystickForce", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "JoystickForce", + "=", + "Value" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SetJoystickForce" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickForce", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, + { + "description": "", + "name": "Parameter", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the joystick is pointing towards (Range: -180 to 180).", + "fullName": "Joystick angle", + "functionType": "Expression", + "name": "JoystickAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "JoystickAngle" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the angle the joystick is pointing towards (Range: -180 to 180).", + "fullName": "Joystick angle", + "functionType": "Action", + "name": "SetJoystickAngle", + "private": true, + "sentence": "Change the joystick angle of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "JoystickAngle", + "=", + "Value" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SetJoystickAngle" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickAngle", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, + { + "description": "Angle", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the stick force on X axis (from -1 at the left to 1 at the right).", + "fullName": "Stick X force", + "functionType": "Expression", + "name": "StickForceX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::JoystickForce() * cos(ToRad(Object.Behavior::JoystickAngle()))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the stick force on Y axis (from -1 at the top to 1 at the bottom).", + "fullName": "Stick Y force", + "functionType": "Expression", + "name": "StickForceY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::JoystickForce() * sin(ToRad(Object.Behavior::JoystickAngle()))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (4-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed4Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::IsAngleIn4WayDirection" + }, + "parameters": [ + "", + "JoystickAngle", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (8-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed8Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::IsAngleIn8WayDirection" + }, + "parameters": [ + "", + "JoystickAngle", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a joystick is pressed.", + "fullName": "Joystick pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Joystick _PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TouchId", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Reset the joystick values (except for angle, which stays the same)", + "fullName": "Reset", + "functionType": "Action", + "name": "Reset", + "private": true, + "sentence": "Reset the joystick of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchId", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the multitouch controller identifier.", + "fullName": "Multitouch controller identifier", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "ControllerIdentifier", + "sentence": "the multitouch controller identifier", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ControllerIdentifier" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ControllerIdentifier", + "name": "SetControllerIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ControllerIdentifier", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick name.", + "fullName": "Joystick name", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "JoystickIdentifier", + "sentence": "the joystick name", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "JoystickIdentifier" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JoystickIdentifier", + "name": "SetJoystickIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "JoystickIdentifier", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the dead zone radius (range: 0 to 1) of the joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", + "fullName": "Dead zone radius", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "DeadZoneRadius", + "sentence": "the dead zone radius", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "DeadZoneRadius" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DeadZoneRadius", + "name": "SetDeadZoneRadius", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DeadZoneRadius", + "=", + "Value" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SetDeadZone" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Force the joystick into the pressing state.", + "fullName": "Force start pressing", + "functionType": "Action", + "name": "ForceStartPressing", + "sentence": "Force start pressing _PARAM0_ with touch identifier: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchId", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, + { + "description": "Touch identifier", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "String", + "label": "Joystick name", + "name": "JoystickIdentifier" + }, + { + "value": "0.4", + "type": "Number", + "label": "Dead zone radius (range: 0 to 1)", + "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", + "name": "DeadZoneRadius" + }, + { + "value": "0", + "type": "Number", + "label": "Joystick angle (range: -180 to 180)", + "hidden": true, + "name": "JoystickAngle" + }, + { + "value": "0", + "type": "Number", + "label": "Joystick force (range: 0 to 1)", + "hidden": true, + "name": "JoystickForce" + }, + { + "value": "0", + "type": "Number", + "label": "", + "hidden": true, + "name": "TouchId" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "TouchIndex" + } + ], + "sharedPropertyDescriptors": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "13c701ed-5ff4-4304-8c59-93fce9cf07cd", - "width": 0, - "x": 512, - "y": 3008, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Detect presses made on a touchscreen on the object so it acts like a button and automatically trigger the button having the same identifier for the mapper behaviors.", + "fullName": "Multitouch button", + "name": "MultitouchButton", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsReleased", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsReleased", + "False", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" + }, + "parameters": [ + "Object", + "Behavior", + "\"Idle\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsJustPressed", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsJustPressed", + "False", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" + }, + "parameters": [ + "Object", + "Behavior", + "\"Pressed\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchIndex", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StartedTouchOrMouseCount()", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer())", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer())" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Radius", + ">", + "DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer()), TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer()))" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchId", + "=", + "StartedTouchOrMouseId(TouchIndex)" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" + }, + "parameters": [ + "Object", + "Behavior", + "\"JustPressed\"", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsJustPressed", + "True", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchIndex", + "+", + "1" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "HasTouchEnded" + }, + "parameters": [ + "", + "TouchId" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" + }, + "parameters": [ + "Object", + "Behavior", + "\"Released\"", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsReleased", + "True", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsJustPressed", + "False", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchId", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button was just pressed.", + "fullName": "Button just pressed", + "functionType": "Condition", + "name": "IsJustPressed", + "sentence": "Button _PARAM0_ was just pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsJustPressed", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is pressed.", + "fullName": "Button pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Button _PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TouchId", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is released.", + "fullName": "Button released", + "functionType": "Condition", + "name": "IsReleased", + "sentence": "Button _PARAM0_ is released", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsReleased", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Button state", + "functionType": "Action", + "name": "SetButtonState", + "private": true, + "sentence": "Mark the button _PARAM0_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SetButtonState" + }, + "parameters": [ + "", + "ControllerIdentifier", + "ButtonIdentifier", + "ButtonState", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + }, + { + "description": "Button state", + "name": "ButtonState", + "supplementaryInformation": "[\"Idle\",\"JustPressed\",\"Pressed\",\"Released\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Button identifier", + "name": "ButtonIdentifier" + }, + { + "value": "0", + "type": "Number", + "label": "TouchID", + "hidden": true, + "name": "TouchId" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "TouchIndex" + }, + { + "value": "", + "type": "Boolean", + "label": "Button released", + "hidden": true, + "name": "IsReleased" + }, + { + "value": "", + "type": "Boolean", + "label": "Button just pressed", + "hidden": true, + "name": "IsJustPressed" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Triggering circle radius", + "description": "This circle adds up to the object collision mask.", + "name": "Radius" + } + ], + "sharedPropertyDescriptors": [] }, { - "angle": 270, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "21529fc4-6d4b-4127-b82c-2048830066d4", - "width": 0, - "x": 2240, - "y": 3008, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Control a platformer character with a multitouch controller.", + "fullName": "Platformer multitouch controller mapper", + "name": "PlatformerMultitouchMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "Property" + ] + }, + { + "type": { + "value": "PlatformBehavior::SimulateLadderKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsButtonPressed" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JumpButton", + "\"Down\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::PlatformerMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Platform character behavior", + "extraInformation": [ + "PlatformBehavior::PlatformerObjectBehavior" + ], + "choices": [], + "name": "Property" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "group": "Controls", + "choices": [ + { + "label": "Primary", + "value": "Primary" + }, + { + "label": "Secondary", + "value": "Secondary" + } + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "group": "Controls", + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "f841b7a8-06dd-4580-85fa-d5d0d7aa50cc", - "width": 0, - "x": 2048, - "y": 3008, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D platformer multitouch controller mapper", + "name": "Platformer3DMultitouchMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "JoystickIdentifier", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SetForwardAngle" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D", + "=", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier) + CameraAngle(Object.Layer())" + ] + }, + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D", + "-90", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsButtonPressed" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JumpButton", + "\"Down\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::Platformer3DMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D physics character", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "choices": [], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "group": "Controls", + "choices": [ + { + "label": "Primary", + "value": "Primary" + }, + { + "label": "Secondary", + "value": "Secondary" + } + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "group": "Controls", + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] }, { - "angle": -90, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadBend", - "persistentUuid": "a1fc6e36-f48e-4397-b2f0-a3e72067e730", - "width": 0, - "x": 2304, - "y": 3456, - "zOrder": 45, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D shooter multitouch controller mapper", + "name": "Shooter3DMultitouchMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "JoystickIdentifier", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsButtonPressed" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JumpButton", + "\"Down\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::Shooter3DMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D physics character", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "choices": [], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "group": "Controls", + "choices": [ + { + "label": "Primary", + "value": "Primary" + }, + { + "label": "Secondary", + "value": "Secondary" + } + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "group": "Controls", + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] }, { - "angle": 90, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "42b9f2bc-f14c-4fd2-8d9c-aab2c4c8413e", - "width": 1280, - "x": 1856, - "y": 2624, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Control camera rotations with a multitouch controller.", + "fullName": "First person camera multitouch controller mapper", + "name": "FirstPersonMultitouchMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "TODO It's probably a bad idea to rotate the object around Y." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CurrentRotationSpeedZ", + "=", + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedZ, SpriteMultitouchJoystick::StickForceX(ControllerIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "CurrentRotationSpeedZ * TimeDelta()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CurrentRotationSpeedY", + "=", + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedY, SpriteMultitouchJoystick::StickForceY(ControllerIdentifier, CameraStick) * VerticalRotationSpeedMax, VerticalRotationSpeedMax, VerticalRotationAcceleration, VerticalRotationDeceleration)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "CurrentRotationSpeedY * TimeDelta()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "clamp(Object.Object3D::RotationY(), VerticalAngleMin, VerticalAngleMax)" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::LookFromObjectEyes" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera to look though _PARAM1_ eyes. The object must look to the right when all its angles are 0 and the top of its head be toward Z+.", + "fullName": "Look through object eyes", + "functionType": "Action", + "group": "Layers and cameras", + "name": "LookFromObjectEyes", + "private": true, + "sentence": "Move the camera to look though _PARAM0_ eyes", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "CentreCamera" + }, + "parameters": [ + "", + "Object", + "", + "Object.Layer()", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraZ" + }, + "parameters": [ + "", + "=", + "Object.Object3D::Z() + Object.Object3D::Depth() + OffsetZ", + "", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraRotationX" + }, + "parameters": [ + "", + "=", + "- Object.Object3D::RotationY() + 90", + "GetArgumentAsString(\"Layer\")", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraRotationY" + }, + "parameters": [ + "", + "=", + "Object.Object3D::RotationX()", + "GetArgumentAsString(\"Layer\")", + "" + ] + }, + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "=", + "Object.Angle() + 90", + "Object.Layer()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum horizontal rotation speed of the object.", + "fullName": "Maximum horizontal rotation speed", + "functionType": "ExpressionAndCondition", + "group": "First person camera multitouch controller mapper horizontal rotation configuration", + "name": "HorizontalRotationSpeedMax", + "sentence": "the maximum horizontal rotation speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "HorizontalRotationSpeedMax" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationSpeedMax", + "name": "SetHorizontalRotationSpeedMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "HorizontalRotationSpeedMax", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the horizontal rotation acceleration of the object.", + "fullName": "Horizontal rotation acceleration", + "functionType": "ExpressionAndCondition", + "group": "First person camera multitouch controller mapper horizontal rotation configuration", + "name": "HorizontalRotationAcceleration", + "sentence": "the horizontal rotation acceleration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "HorizontalRotationAcceleration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationAcceleration", + "name": "SetHorizontalRotationAcceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "HorizontalRotationAcceleration", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the horizontal rotation deceleration of the object.", + "fullName": "Horizontal rotation deceleration", + "functionType": "ExpressionAndCondition", + "group": "First person camera multitouch controller mapper horizontal rotation configuration", + "name": "HorizontalRotationDeceleration", + "sentence": "the horizontal rotation deceleration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "HorizontalRotationDeceleration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationDeceleration", + "name": "SetHorizontalRotationDeceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "HorizontalRotationDeceleration", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum vertical rotation speed of the object.", + "fullName": "Maximum vertical rotation speed", + "functionType": "ExpressionAndCondition", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalRotationSpeedMax", + "sentence": "the maximum vertical rotation speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "VerticalRotationSpeedMax" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationSpeedMax", + "name": "SetVerticalRotationSpeedMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "VerticalRotationSpeedMax", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the vertical rotation acceleration of the object.", + "fullName": "Vertical rotation acceleration", + "functionType": "ExpressionAndCondition", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalRotationAcceleration", + "sentence": "the vertical rotation acceleration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "VerticalRotationAcceleration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationAcceleration", + "name": "SetVerticalRotationAcceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "VerticalRotationAcceleration", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the vertical rotation deceleration of the object.", + "fullName": "Vertical rotation deceleration", + "functionType": "ExpressionAndCondition", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalRotationDeceleration", + "sentence": "the vertical rotation deceleration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "VerticalRotationDeceleration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationDeceleration", + "name": "SetVerticalRotationDeceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "VerticalRotationDeceleration", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the minimum vertical camera angle of the object.", + "fullName": "Minimum vertical camera angle", + "functionType": "ExpressionAndCondition", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalAngleMin", + "sentence": "the minimum vertical camera angle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "VerticalAngleMin" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalAngleMin", + "name": "SetVerticalAngleMin", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "VerticalAngleMin", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum vertical camera angle of the object.", + "fullName": "Maximum vertical camera angle", + "functionType": "ExpressionAndCondition", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalAngleMax", + "sentence": "the maximum vertical camera angle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "VerticalAngleMax" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalAngleMax", + "name": "SetVerticalAngleMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "VerticalAngleMax", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the z position offset of the object.", + "fullName": "Z position offset", + "functionType": "ExpressionAndCondition", + "group": "First person camera multitouch controller mapper position configuration", + "name": "OffsetZ", + "sentence": "the z position offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "OffsetZ" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "OffsetZ", + "name": "SetOffsetZ", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OffsetZ", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "choices": [], + "name": "Object3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "Secondary", + "type": "Choice", + "label": "Camera joystick", + "group": "Controls", + "choices": [ + { + "label": "Primary", + "value": "Primary" + }, + { + "label": "Secondary", + "value": "Secondary" + } + ], + "name": "CameraStick" + }, + { + "value": "180", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "group": "Horizontal rotation", + "name": "HorizontalRotationSpeedMax" + }, + { + "value": "360", + "type": "Number", + "label": "Rotation acceleration", + "group": "Horizontal rotation", + "name": "HorizontalRotationAcceleration" + }, + { + "value": "720", + "type": "Number", + "label": "Rotation deceleration", + "group": "Horizontal rotation", + "name": "HorizontalRotationDeceleration" + }, + { + "value": "120", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "group": "Vertical rotation", + "name": "VerticalRotationSpeedMax" + }, + { + "value": "240", + "type": "Number", + "label": "Rotation acceleration", + "group": "Vertical rotation", + "name": "VerticalRotationAcceleration" + }, + { + "value": "480", + "type": "Number", + "label": "Rotation deceleration", + "group": "Vertical rotation", + "name": "VerticalRotationDeceleration" + }, + { + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Minimum angle", + "group": "Vertical rotation", + "name": "VerticalAngleMin" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Maximum angle", + "group": "Vertical rotation", + "name": "VerticalAngleMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z position offset", + "group": "Position", + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Z", + "hidden": true, + "name": "CurrentRotationSpeedZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Y", + "hidden": true, + "name": "CurrentRotationSpeedY" + } + ], + "sharedPropertyDescriptors": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "2edcf5be-e3b1-4b22-a305-fa92c1be5a48", - "width": 0, - "x": 1728, - "y": 3328, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Control a 3D physics car with a multitouch controller.", + "fullName": "3D car multitouch controller mapper", + "name": "PhysicsCar3DMultitouchMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "SteerJoystickIdentifier", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateSteeringStick" + }, + "parameters": [ + "Object", + "PhysicsCar3D", + "SpriteMultitouchJoystick::StickForceX(ControllerIdentifier, \"Primary\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "SpeedJoystickIdentifier", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateAcceleratorStick" + }, + "parameters": [ + "Object", + "PhysicsCar3D", + "-SpriteMultitouchJoystick::StickForceY(ControllerIdentifier, \"Secondary\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsButtonPressed" + }, + "parameters": [ + "", + "ControllerIdentifier", + "HandBrakeButton", + "\"Down\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateHandBrakeKey" + }, + "parameters": [ + "Object", + "PhysicsCar3D" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::PhysicsCar3DMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D physics car", + "extraInformation": [ + "Physics3D::PhysicsCar3D" + ], + "choices": [], + "name": "PhysicsCar3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Steer joystick", + "group": "Controls", + "choices": [ + { + "label": "Primary", + "value": "Primary" + }, + { + "label": "Secondary", + "value": "Secondary" + } + ], + "name": "SteerJoystickIdentifier" + }, + { + "value": "Secondary", + "type": "Choice", + "label": "Speed joystick", + "group": "Controls", + "choices": [ + { + "label": "Primary", + "value": "Primary" + }, + { + "label": "Secondary", + "value": "Secondary" + } + ], + "name": "SpeedJoystickIdentifier" + }, + { + "value": "B", + "type": "String", + "label": "Hand brake button name", + "group": "Controls", + "name": "HandBrakeButton" + } + ], + "sharedPropertyDescriptors": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "ce651f5b-6053-4a4d-8e7d-60dee9918dd3", - "width": 0, - "x": 1344, - "y": 2432, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "description": "Control a top-down character with a multitouch controller.", + "fullName": "Top-down multitouch controller mapper", + "name": "TopDownMultitouchMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "StickMode", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "StickMode", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "sign(SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "StickMode", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "TopDownMovementBehavior::DiagonalsAllowed" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TopDownMovementBehavior::DiagonalsAllowed" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"UpLeft\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"UpRight\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"DownLeft\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"DownRight\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Top-down movement behavior", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" + ], + "choices": [], + "name": "TopDownMovement" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "choices": [ + { + "label": "Primary", + "value": "Primary" + }, + { + "label": "Secondary", + "value": "Secondary" + } + ], + "name": "JoystickIdentifier" + }, + { + "value": "Analog", + "type": "Choice", + "label": "Stick mode", + "group": "Controls", + "choices": [ + { + "label": "Analog", + "value": "Analog" + }, + { + "label": "360°", + "value": "360°" + }, + { + "label": "8 Directions", + "value": "8 Directions" + } + ], + "name": "StickMode" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [ { - "angle": -90, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadIntersectionPath", - "persistentUuid": "e89950f8-353b-4f24-969c-2c5b3c244db3", - "width": 0, - "x": 2304, - "y": 1792, - "zOrder": 44, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "areaMaxX": 64, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "defaultName": "Joystick", + "description": "Joystick for touchscreens.", + "fullName": "Multitouch Joystick", + "isUsingLegacyInstancesRenderer": true, + "name": "SpriteMultitouchJoystick", + "objects": [ + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Thumb", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Border", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "MultitouchJoystick", + "type": "SpriteMultitouchJoystick::MultitouchJoystick", + "ControllerIdentifier": 1, + "JoystickIdentifier": "Primary", + "FloatingEnabled": false, + "DeadZoneRadius": 0.4, + "JoystickAngle": 0, + "JoystickForce": 0, + "TouchId": 0, + "TouchIndex": 0 + } + ], + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Thumb" + }, + { + "objectName": "Border" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [], + "editionSettings": {}, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Border", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Thumb", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Border", + "=", + "1" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Thumb", + "=", + "2" + ] + }, + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Border", + "=", + "0", + "=", + "0" + ] + }, + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Thumb", + "=", + "0", + "=", + "0" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "SetIncludedInParentCollisionMask" + }, + "parameters": [ + "Thumb", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::IsInGameEdition" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreAutour" + }, + "parameters": [ + "Thumb", + "Border", + "Border.MultitouchJoystick::JoystickForce() * Border.Width() / 2", + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "ShouldBeHiddenWhenReleased", + "True", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Object", + "no", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "ShouldBeHiddenWhenReleased", + "False", + "" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Pass the object property values to the behavior.", + "fullName": "Update configuration", + "functionType": "Action", + "name": "UpdateConfiguration", + "private": true, + "sentence": "Update the configuration of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "ControllerIdentifier", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "JoystickIdentifier", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "DeadZoneRadius", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Show the joystick until it is released.", + "fullName": "Show and start pressing", + "functionType": "Action", + "name": "TeleportAndPress", + "sentence": "Show _PARAM0_ at the cursor position and start pressing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Object", + "=", + "Object.ParentTouchX(StartedTouchOrMouseId(0))", + "=", + "Object.ParentTouchY(StartedTouchOrMouseId(0))" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Object", + "yes", + "" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "ShouldBeHiddenWhenReleased", + "True", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::ForceStartPressing" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "StartedTouchOrMouseId(0)", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the X position of a specified touch", + "fullName": "Touch X position (on parent)", + "functionType": "Expression", + "name": "ParentTouchX", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const touchId = eventsFunctionContext.getArgument(\"TouchId\");", + "eventsFunctionContext.returnValue = gdjs.evtTools.input.getTouchX(object.getInstanceContainer(), touchId, object.getLayer());" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Touch identifier", + "name": "TouchId", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the X position of a specified touch", + "fullName": "Touch X position (on parent)", + "functionType": "Expression", + "name": "ParentTouchY", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const touchId = eventsFunctionContext.getArgument(\"TouchId\");", + "eventsFunctionContext.returnValue = gdjs.evtTools.input.getTouchY(object.getInstanceContainer(), touchId, object.getLayer());" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Touch identifier", + "name": "TouchId", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "De/activate control of the joystick.", + "fullName": "De/activate control", + "functionType": "Action", + "name": "ActivateControl", + "sentence": "Activate control of _PARAM0_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "ShouldActivate", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "ShouldActivate", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Activate", + "name": "ShouldActivate", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a stick is pressed.", + "fullName": "Stick pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Stick _PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsPressed" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "!=" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick force (from 0 to 1).", + "fullName": "Joystick force (deprecated)", + "functionType": "ExpressionAndCondition", + "name": "JoystickForce", + "private": true, + "sentence": "the joystick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickForce()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the strick force (from 0 to 1).", + "fullName": "Stick force", + "functionType": "ExpressionAndCondition", + "name": "StickForce", + "sentence": "the stick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickForce()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the stick force on X axis (from -1 at the left to 1 at the right).", + "fullName": "Stick X force", + "functionType": "ExpressionAndCondition", + "name": "StickForceX", + "sentence": "the stick X force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::StickForceX()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the stick force on Y axis (from -1 at the top to 1 at the bottom).", + "fullName": "Stick Y force", + "functionType": "ExpressionAndCondition", + "name": "StickForceY", + "sentence": "the stick Y force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::StickForceY()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the joystick is pointing towards (from -180 to 180).", + "fullName": "Joystick angle (deprecated)", + "functionType": "Expression", + "name": "JoystickAngle", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the stick is pointing towards (from -180 to 180).", + "fullName": "Stick angle", + "functionType": "Expression", + "name": "StickAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (4-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed4Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (8-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed8Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "the multitouch controller identifier (1, 2, 3, 4...).", + "fullName": "Multitouch controller identifier", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "ControllerIdentifier", + "sentence": "the multitouch controller identifier", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyControllerIdentifier()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ControllerIdentifier", + "name": "SetControllerIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick name of the object.", + "fullName": "Joystick name", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "JoystickIdentifier", + "sentence": "the joystick name", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyJoystickIdentifier()" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JoystickIdentifier", + "name": "SetJoystickIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the dead zone radius of the joystick (range: 0 to 1). The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", + "fullName": "Dead zone radius", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "DeadZoneRadius", + "sentence": "the dead zone radius", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyDeadZoneRadius()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DeadZoneRadius", + "name": "SetDeadZoneRadius", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "choices": [ + { + "label": "Primary", + "value": "Primary" + }, + { + "label": "Secondary", + "value": "Secondary" + } + ], + "name": "JoystickIdentifier" + }, + { + "value": "0.4", + "type": "Number", + "label": "Dead zone radius (range: 0 to 1)", + "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", + "name": "DeadZoneRadius" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "extraInformation": [ + "Thumb" + ], + "choices": [], + "hidden": true, + "name": "ThumbAnchorOrigin" + }, + { + "value": "Center-center", + "type": "Number", + "label": "", + "description": "Only used by the scene editor.", + "hidden": true, + "name": "ThumbAnchorTarget" + }, + { + "value": "true", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "extraInformation": [ + "Thumb" + ], + "choices": [], + "hidden": true, + "name": "ThumbIsScaledProportionally" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "hidden": true, + "name": "ParentOrigin" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "hidden": true, + "name": "ShouldBeHiddenWhenReleased" + } + ], + "variants": [] + } + ] + }, + { + "author": "", + "category": "Input", + "extensionNamespace": "", + "fullName": "3D car keyboard mapper", + "gdevelopVersion": ">=5.5.222", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggZD0iTTI5LDE0aC00LjJjMC4xLTAuMywwLjItMC42LDAuMi0xYzAtMS43LTEuMy0zLTMtM0g4Yy0wLjYsMC0xLTAuNC0xLTFzMC40LTEsMS0xaDZjMS43LDAsMy0xLjMsMy0zVjJjMC0wLjYtMC40LTEtMS0xDQoJcy0xLDAuNC0xLDF2M2MwLDAuNi0wLjQsMS0xLDFIOEM2LjMsNiw1LDcuMyw1LDlzMS4zLDMsMywzaDE0YzAuNiwwLDEsMC40LDEsMXMtMC40LDEtMSwxSDNjLTAuNiwwLTEsMC40LTEsMXYxNGMwLDAuNiwwLjQsMSwxLDENCgloMjZjMC42LDAsMS0wLjQsMS0xVjE1QzMwLDE0LjQsMjkuNiwxNCwyOSwxNHogTTcsMThoMmMwLjYsMCwxLDAuNCwxLDFjMC0wLjYsMC40LTEsMS0xaDJjMC42LDAsMSwwLjQsMSwxYzAtMC42LDAuNC0xLDEtMWgyDQoJYzAuNiwwLDEsMC40LDEsMWMwLTAuNiwwLjQtMSwxLTFoMmMwLjYsMCwxLDAuNCwxLDFjMC0wLjYsMC40LTEsMS0xaDJjMC42LDAsMSwwLjQsMSwxcy0wLjQsMS0xLDFoLTJjLTAuNiwwLTEtMC40LTEtMQ0KCWMwLDAuNi0wLjQsMS0xLDFoLTJjLTAuNiwwLTEtMC40LTEtMWMwLDAuNi0wLjQsMS0xLDFoLTJjLTAuNiwwLTEtMC40LTEtMWMwLDAuNi0wLjQsMS0xLDFoLTJjLTAuNiwwLTEtMC40LTEtMWMwLDAuNi0wLjQsMS0xLDFINw0KCWMtMC42LDAtMS0wLjQtMS0xUzYuNCwxOCw3LDE4eiBNMTksMjJjMCwwLjEsMCwwLjMtMC4xLDAuNHMtMC4xLDAuMi0wLjIsMC4zYzAsMC0wLjEsMC4xLTAuMiwwLjFjMCwwLTAuMSwwLjEtMC4yLDAuMQ0KCWMtMC4xLDAtMC4xLDAtMC4yLDAuMWMtMC4xLDAtMC4xLDAtMC4yLDBjLTAuMSwwLTAuMSwwLTAuMiwwYy0wLjEsMC0wLjEsMC0wLjItMC4xYy0wLjEsMC0wLjEtMC4xLTAuMi0wLjFjMCwwLTAuMS0wLjEtMC4xLTAuMQ0KCWMtMC4xLTAuMS0wLjItMC4yLTAuMi0wLjNDMTcsMjIuMywxNywyMi4xLDE3LDIyYzAtMC4xLDAtMC4zLDAuMS0wLjRjMC0wLjEsMC4xLTAuMiwwLjItMC4zYzAsMCwwLjEtMC4xLDAuMS0wLjENCgljMC4xLDAsMC4xLTAuMSwwLjItMC4xYzAuMSwwLDAuMSwwLDAuMi0wLjFjMC4xLDAsMC4zLDAsMC40LDBjMC4xLDAsMC4xLDAsMC4yLDAuMWMwLjEsMCwwLjEsMC4xLDAuMiwwLjFjMC4xLDAsMC4xLDAuMSwwLjIsMC4xDQoJYzAuMSwwLjEsMC4yLDAuMiwwLjIsMC4zQzE5LDIxLjcsMTksMjEuOSwxOSwyMnogTTE1LDIyYzAsMC4xLDAsMC4zLTAuMSwwLjRzLTAuMSwwLjItMC4yLDAuM2MwLDAtMC4xLDAuMS0wLjIsMC4xDQoJYzAsMC0wLjEsMC4xLTAuMiwwLjFjLTAuMSwwLTAuMSwwLTAuMiwwLjFjLTAuMSwwLTAuMSwwLTAuMiwwYy0wLjMsMC0wLjUtMC4xLTAuNy0wLjNjLTAuMS0wLjEtMC4yLTAuMi0wLjItMC4zDQoJQzEzLDIyLjMsMTMsMjIuMSwxMywyMmMwLTAuMSwwLTAuMSwwLTAuMmMwLTAuMSwwLTAuMSwwLjEtMC4yYzAtMC4xLDAtMC4xLDAuMS0wLjJjMC0wLjEsMC4xLTAuMSwwLjEtMC4xYzAuMi0wLjIsMC42LTAuMywwLjktMC4zDQoJYzAuMSwwLDAuMSwwLDAuMiwwLjFjMC4xLDAsMC4xLDAuMSwwLjIsMC4xYzAuMSwwLDAuMSwwLjEsMC4yLDAuMWMwLDAsMC4xLDAuMSwwLjEsMC4xYzAsMC4xLDAuMSwwLjEsMC4xLDAuMmMwLDAuMSwwLDAuMSwwLjEsMC4yDQoJQzE1LDIxLjksMTUsMjEuOSwxNSwyMnogTTUsMjJjMC0wLjEsMC0wLjMsMC4xLTAuNGMwLTAuMSwwLjEtMC4yLDAuMi0wLjNjMC4yLTAuMiwwLjYtMC4zLDAuOS0wLjNjMC4xLDAsMC4xLDAsMC4yLDAuMQ0KCWMwLjEsMCwwLjEsMC4xLDAuMiwwLjFjMCwwLDAuMSwwLjEsMC4yLDAuMWMwLjEsMC4xLDAuMiwwLjIsMC4yLDAuM0M3LDIxLjcsNywyMS45LDcsMjJjMCwwLjMtMC4xLDAuNS0wLjMsMC43YzAsMC0wLjEsMC4xLTAuMiwwLjENCgljLTAuMSwwLTAuMSwwLjEtMC4yLDAuMWMtMC4xLDAtMC4xLDAtMC4yLDAuMWMtMC4xLDAtMC4xLDAtMC4yLDBjLTAuMywwLTAuNS0wLjEtMC43LTAuM0M1LjEsMjIuNSw1LDIyLjMsNSwyMnogTTgsMjZINw0KCWMtMC42LDAtMS0wLjQtMS0xczAuNC0xLDEtMWgxYzAuNiwwLDEsMC40LDEsMVM4LjYsMjYsOCwyNnogTTEwLjksMjIuNGMwLDAuMSwwLDAuMS0wLjEsMC4yYzAsMC0wLjEsMC4xLTAuMSwwLjENCglDMTAuNSwyMi45LDEwLjMsMjMsMTAsMjNjLTAuMSwwLTAuMywwLTAuNC0wLjFjLTAuMS0wLjEtMC4yLTAuMS0wLjMtMC4yYzAtMC4xLTAuMS0wLjEtMC4xLTAuMWMwLTAuMS0wLjEtMC4xLTAuMS0wLjINCgljMC0wLjEsMC0wLjEtMC4xLTAuMmMwLTAuMSwwLTAuMSwwLTAuMmMwLTAuMywwLjEtMC41LDAuMy0wLjdjMC4xLTAuMSwwLjItMC4yLDAuMy0wLjJjMC40LTAuMiwwLjgtMC4xLDEuMSwwLjINCgljMC4yLDAuMiwwLjMsMC40LDAuMywwLjdjMCwwLjEsMCwwLjEsMCwwLjJDMTEsMjIuMywxMSwyMi4zLDEwLjksMjIuNHogTTIwLDI2aC04Yy0wLjYsMC0xLTAuNC0xLTFzMC40LTEsMS0xaDhjMC42LDAsMSwwLjQsMSwxDQoJUzIwLjYsMjYsMjAsMjZ6IE0yMi45LDIyLjRjMCwwLjEsMCwwLjEtMC4xLDAuMmMwLDAtMC4xLDAuMS0wLjEsMC4xYzAsMC0wLjEsMC4xLTAuMiwwLjFjMCwwLTAuMSwwLjEtMC4yLDAuMWMtMC4xLDAtMC4xLDAtMC4yLDAuMQ0KCWMtMC4xLDAtMC4xLDAtMC4yLDBjLTAuMSwwLTAuMSwwLTAuMiwwYy0wLjEsMC0wLjEsMC0wLjItMC4xYy0wLjEsMC0wLjEtMC4xLTAuMi0wLjFjMCwwLTAuMS0wLjEtMC4xLTAuMWMwLTAuMS0wLjEtMC4xLTAuMS0wLjENCgljMC0wLjEtMC4xLTAuMS0wLjEtMC4yYzAtMC4xLDAtMC4xLTAuMS0wLjJjMC0wLjEsMC0wLjEsMC0wLjJjMC0wLjMsMC4xLTAuNSwwLjMtMC43YzAsMCwwLjEtMC4xLDAuMS0wLjFjMC4xLDAsMC4xLTAuMSwwLjItMC4xDQoJYzAuMSwwLDAuMSwwLDAuMi0wLjFjMC4xLDAsMC4zLDAsMC40LDBjMC4xLDAsMC4xLDAsMC4yLDAuMWMwLjEsMCwwLjEsMC4xLDAuMiwwLjFjMC4xLDAsMC4xLDAuMSwwLjIsMC4xYzAuMiwwLjIsMC4zLDAuNCwwLjMsMC43DQoJYzAsMC4xLDAsMC4xLDAsMC4yQzIzLDIyLjMsMjMsMjIuMywyMi45LDIyLjR6IE0yNSwyNmgtMWMtMC42LDAtMS0wLjQtMS0xczAuNC0xLDEtMWgxYzAuNiwwLDEsMC40LDEsMVMyNS42LDI2LDI1LDI2eiBNMjYuNywyMi43DQoJQzI2LjUsMjIuOSwyNi4zLDIzLDI2LDIzYy0wLjEsMC0wLjEsMC0wLjIsMGMtMC4xLDAtMC4xLDAtMC4yLTAuMWMtMC4xLDAtMC4xLTAuMS0wLjItMC4xYy0wLjEsMC0wLjEtMC4xLTAuMi0wLjENCglDMjUuMSwyMi41LDI1LDIyLjMsMjUsMjJjMC0wLjEsMC0wLjMsMC4xLTAuNGMwLTAuMSwwLjEtMC4yLDAuMi0wLjNjMCwwLDAuMS0wLjEsMC4yLTAuMWMwLDAsMC4xLTAuMSwwLjItMC4xYzAuMSwwLDAuMSwwLDAuMi0wLjENCgljMC4zLTAuMSwwLjcsMCwwLjksMC4zYzAuMiwwLjIsMC4zLDAuNCwwLjMsMC43QzI3LDIyLjMsMjYuOSwyMi41LDI2LjcsMjIuN3oiLz4NCjwvc3ZnPg0K", + "name": "PhysicsCar3DKeyMapper", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Computers and Hardware/3e5871434a72821bf3ecb44a6857e62a438cf23dc8f95966f56ae97e95315468_Computers and Hardware_keyboard.svg", + "shortDescription": "3D car keyboard controls.", + "version": "1.0.1", + "description": "3D physics car keyboard controls.", + "origin": { + "identifier": "PhysicsCar3DKeyMapper", + "name": "gdevelop-extension-store" + }, + "tags": [ + "3d" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadIntersectionPath", - "persistentUuid": "262650d6-cf38-46b4-be2d-3fb4413ca479", - "width": 0, - "x": 0, - "y": 3456, - "zOrder": 44, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "description": "Control a 3D physics car with a keyboard.", + "fullName": "3D car keyboard mapper", + "name": "PhysicsCar3DKeyboardMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Down" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateBackwardKey" + }, + "parameters": [ + "Object", + "PhysicsCar3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Up" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateForwardKey" + }, + "parameters": [ + "Object", + "PhysicsCar3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Left" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateLeftKey" + }, + "parameters": [ + "Object", + "PhysicsCar3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Right" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateRightKey" + }, + "parameters": [ + "Object", + "PhysicsCar3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "HandBrake" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateHandBrakeKey" + }, + "parameters": [ + "Object", + "PhysicsCar3D" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PhysicsCar3DKeyMapper::PhysicsCar3DKeyboardMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D physics car", + "extraInformation": [ + "Physics3D::PhysicsCar3D" + ], + "choices": [], + "name": "PhysicsCar3D" + }, + { + "value": "Space", + "type": "KeyboardKey", + "label": "Hand brake key", + "name": "HandBrake" + }, + { + "value": "Up", + "type": "KeyboardKey", + "label": "Up key", + "name": "Up" + }, + { + "value": "Left", + "type": "KeyboardKey", + "label": "Left key", + "name": "Left" + }, + { + "value": "Down", + "type": "KeyboardKey", + "label": "Down key", + "name": "Down" + }, + { + "value": "Right", + "type": "KeyboardKey", + "label": "Right key", + "name": "Right" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Visual effect", + "extensionNamespace": "", + "fullName": "3D object shake", + "gdevelopVersion": ">=5.5.222", + "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.1.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": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Coin", - "persistentUuid": "c859da86-521b-4f27-b455-b513b6ea9fae", - "rotationY": 90, - "width": 0, - "x": -2560, - "y": -909, - "z": 21, - "zOrder": 27, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ShakeObject3D::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Coin", - "persistentUuid": "a73d55ae-1ec2-488b-b55c-6930f485974d", - "rotationY": 90, - "width": 0, - "x": -2656, - "y": -909, - "z": 21, - "zOrder": 27, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Define helper classes JavaScript code.", + "fullName": "Define helper classes", + "functionType": "Action", + "name": "DefineHelperClasses", + "private": true, + "sentence": "Define helper classes JavaScript code", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (gdjs._shakeObjectExtension) {", + " return;", + "}", + "", + "/** Noise generator manager. */", + "class NoiseManager {", + " /**", + " * Create the manager of noise generators.", + " */", + " constructor() {", + " this.seed = gdjs.randomInRange(1, Number.MAX_SAFE_INTEGER);", + " /** @type {Map} */", + " this.generators = new Map();", + " }", + "", + " /**", + " * @param name {string}", + " * @return {NoiseGenerator}", + " */", + " getGenerator(name) {", + " let generator = this.generators.get(name);", + " if (!generator) {", + " generator = new NoiseGenerator(name + this.seed);", + " this.generators.set(name, generator);", + " }", + " return generator;", + " }", + "", + " /**", + " * @param seed {number}", + " */", + " setSeed(seed) {", + " this.seed = seed;", + " this.generators.forEach(generator => generator.setSeed(name + this.seed));", + " }", + "", + " /**", + " * @param name {string}", + " */", + " deleteGenerator(name) {", + " this.generators.delete(name);", + " }", + "", + " /**", + " */", + " deleteAllGenerators() {", + " this.generators.clear();", + " }", + "}", + "", + "/** Noise generator with octaves. */", + "class NoiseGenerator {", + " /**", + " * Create a noise generator with a seed.", + " * @param seed {string}", + " */", + " constructor(seed) {", + " this.simplexNoise = new SimplexNoise(seed);", + " this.frequency = 1;", + " this.octaves = 1;", + " this.persistence = 0.5;", + " this.lacunarity = 2;", + " this.xLoopPeriod = 0;", + " this.yLoopPeriod = 0;", + " }", + "", + " /**", + " * @param seed {string}", + " */", + " setSeed(seed) {", + " this.simplexNoise = new SimplexNoise(seed);", + " }", + "", + " /**", + " * @param x {float}", + " * @param y {float}", + " * @param z {float} optionnal", + " * @param w {float} optionnal", + " * @return {float}", + " */", + " noise(x, y, z, w) {", + " if (this.xLoopPeriod && this.yLoopPeriod) {", + " const circleRatioX = 2 * Math.PI / this.xLoopPeriod;", + " const circleRatioY = 2 * Math.PI / this.yLoopPeriod;", + " const angleX = circleRatioX * x;", + " const angleY = circleRatioY * y;", + " x = Math.cos(angleX) / circleRatioX;", + " y = Math.sin(angleX) / circleRatioX;", + " z = Math.cos(angleY) / circleRatioY;", + " w = Math.sin(angleY) / circleRatioY;", + " }", + " else if (this.xLoopPeriod) {", + " const circleRatio = 2 * Math.PI / this.xLoopPeriod;", + " const angleX = circleRatio * x;", + " w = z;", + " z = y;", + " x = Math.cos(angleX) / circleRatio;", + " y = Math.sin(angleX) / circleRatio;", + " }", + " else if (this.yLoopPeriod) {", + " const circleRatio = 2 * Math.PI / this.xLoopPeriod;", + " const angleX = circleRatio * x;", + " w = z;", + " // Make the circle perimeter equals to the looping period", + " // to keep the same perceived frequency with or without looping.", + " y = Math.cos(angleX) / circleRatio;", + " z = Math.sin(angleX) / circleRatio;", + " }", + " let noiseFunction = this.simplexNoise.noise4D.bind(this.simplexNoise);", + " if (z === undefined) {", + " noiseFunction = this.simplexNoise.noise2D.bind(this.simplexNoise);", + " }", + " else if (w === undefined) {", + " noiseFunction = this.simplexNoise.noise3D.bind(this.simplexNoise);", + " }", + " let frequency = this.frequency;", + " let noiseSum = 0;", + " let amplitudeSum = 0;", + " let amplitude = 1;", + " for (let i = 0; i < this.octaves; i++) {", + " noiseSum += noiseFunction(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;", + " amplitudeSum += Math.abs(amplitude);", + " amplitude *= this.persistence;", + " frequency *= this.lacunarity;", + " }", + " return noiseSum / amplitudeSum;", + " }", + "}", + "", + "/*", + "A fast javascript implementation of simplex noise by Jonas Wagner", + "https://github.com/jwagner/simplex-noise.js", + "", + "Based on a speed-improved simplex noise algorithm for 2D, 3D and 4D in Java.", + "Which is based on example code by Stefan Gustavson (stegu@itn.liu.se).", + "With Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).", + "Better rank ordering method by Stefan Gustavson in 2012.", + "", + " Copyright (c) 2021 Jonas Wagner", + "", + " Permission is hereby granted, free of charge, to any person obtaining a copy", + " of this software and associated documentation files (the \"Software\"), to deal", + " in the Software without restriction, including without limitation the rights", + " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", + " copies of the Software, and to permit persons to whom the Software is", + " furnished to do so, subject to the following conditions:", + "", + " The above copyright notice and this permission notice shall be included in all", + " copies or substantial portions of the Software.", + "", + " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", + " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", + " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", + " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE", + " SOFTWARE.", + " */", + "", + "const F2 = 0.5 * (Math.sqrt(3.0) - 1.0);", + "const G2 = (3.0 - Math.sqrt(3.0)) / 6.0;", + "const F3 = 1.0 / 3.0;", + "const G3 = 1.0 / 6.0;", + "const F4 = (Math.sqrt(5.0) - 1.0) / 4.0;", + "const G4 = (5.0 - Math.sqrt(5.0)) / 20.0;", + "const grad3 = new Float32Array([1, 1, 0,", + " -1, 1, 0,", + " 1, -1, 0,", + " -1, -1, 0,", + " 1, 0, 1,", + " -1, 0, 1,", + " 1, 0, -1,", + " -1, 0, -1,", + " 0, 1, 1,", + " 0, -1, 1,", + " 0, 1, -1,", + " 0, -1, -1]);", + "const grad4 = new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,", + " 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,", + " 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,", + " -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,", + " 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,", + " -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,", + " 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,", + " -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]);", + "", + "", + "/**", + " * Builds a random permutation table.", + " * This is exported only for (internal) testing purposes.", + " * Do not rely on this export.", + " * @param {() => number} random", + " * @private", + " */", + "function buildPermutationTable(random) {", + " const p = new Uint8Array(256);", + " for (let i = 0; i < 256; i++) {", + " p[i] = i;", + " }", + " for (let i = 0; i < 255; i++) {", + " const r = i + ~~(random() * (256 - i));", + " const aux = p[i];", + " p[i] = p[r];", + " p[r] = aux;", + " }", + " return p;", + "}", + "", + "/*", + "The ALEA PRNG and masher code used by simplex-noise.js", + "is based on code by Johannes Baagøe, modified by Jonas Wagner.", + "See alea.md for the full license.", + "@param {string|number} seed", + "*/", + "function alea(seed) {", + " let s0 = 0;", + " let s1 = 0;", + " let s2 = 0;", + " let c = 1;", + " const mash = masher();", + " s0 = mash(' ');", + " s1 = mash(' ');", + " s2 = mash(' ');", + " s0 -= mash(seed);", + " if (s0 < 0) {", + " s0 += 1;", + " }", + " s1 -= mash(seed);", + " if (s1 < 0) {", + " s1 += 1;", + " }", + " s2 -= mash(seed);", + " if (s2 < 0) {", + " s2 += 1;", + " }", + " return function () {", + " const t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32", + " s0 = s1;", + " s1 = s2;", + " return s2 = t - (c = t | 0);", + " };", + "}", + "", + "function masher() {", + " let n = 0xefc8249d;", + " return function (data) {", + " data = data.toString();", + " for (let i = 0; i < data.length; i++) {", + " n += data.charCodeAt(i);", + " let h = 0.02519603282416938 * n;", + " n = h >>> 0;", + " h -= n;", + " h *= n;", + " n = h >>> 0;", + " h -= n;", + " n += h * 0x100000000; // 2^32", + " }", + " return (n >>> 0) * 2.3283064365386963e-10; // 2^-32", + " };", + "}", + "", + "/** Deterministic simplex noise generator suitable for 2D, 3D and 4D spaces. */", + "class SimplexNoise {", + " /**", + " * Creates a new `SimplexNoise` instance.", + " * This involves some setup. You can save a few cpu cycles by reusing the same instance.", + " * @param {(() => number)|string|number} randomOrSeed A random number generator or a seed (string|number).", + " * Defaults to Math.random (random irreproducible initialization).", + " */", + " constructor(randomOrSeed) {", + " if (randomOrSeed === void 0) { randomOrSeed = Math.random; }", + " const random = typeof randomOrSeed == 'function' ? randomOrSeed : alea(randomOrSeed);", + " this.p = buildPermutationTable(random);", + " this.perm = new Uint8Array(512);", + " this.permMod12 = new Uint8Array(512);", + " for (let i = 0; i < 512; i++) {", + " this.perm[i] = this.p[i & 255];", + " this.permMod12[i] = this.perm[i] % 12;", + " }", + " }", + "", + " /**", + " * Samples the noise field in 2 dimensions", + " * @param {number} x", + " * @param {number} y", + " * @returns a number in the interval [-1, 1]", + " */", + " noise2D(x, y) {", + " const permMod12 = this.permMod12;", + " const perm = this.perm;", + " let n0 = 0; // Noise contributions from the three corners", + " let n1 = 0;", + " let n2 = 0;", + " // Skew the input space to determine which simplex cell we're in", + " const s = (x + y) * F2; // Hairy factor for 2D", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const t = (i + j) * G2;", + " const X0 = i - t; // Unskew the cell origin back to (x,y) space", + " const Y0 = j - t;", + " const x0 = x - X0; // The x,y distances from the cell origin", + " const y0 = y - Y0;", + " // For the 2D case, the simplex shape is an equilateral triangle.", + " // Determine which simplex we are in.", + " let i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords", + " if (x0 > y0) {", + " i1 = 1;", + " j1 = 0;", + " } // lower triangle, XY order: (0,0)->(1,0)->(1,1)", + " else {", + " i1 = 0;", + " j1 = 1;", + " } // upper triangle, YX order: (0,0)->(0,1)->(1,1)", + " // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and", + " // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where", + " // c = (3-sqrt(3))/6", + " const x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords", + " const y1 = y0 - j1 + G2;", + " const x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords", + " const y2 = y0 - 1.0 + 2.0 * G2;", + " // Work out the hashed gradient indices of the three simplex corners", + " const ii = i & 255;", + " const jj = j & 255;", + " // Calculate the contribution from the three corners", + " let t0 = 0.5 - x0 * x0 - y0 * y0;", + " if (t0 >= 0) {", + " const gi0 = permMod12[ii + perm[jj]] * 3;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0); // (x,y) of grad3 used for 2D gradient", + " }", + " let t1 = 0.5 - x1 * x1 - y1 * y1;", + " if (t1 >= 0) {", + " const gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);", + " }", + " let t2 = 0.5 - x2 * x2 - y2 * y2;", + " if (t2 >= 0) {", + " const gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);", + " }", + " // Add contributions from each corner to get the final noise value.", + " // The result is scaled to return values in the interval [-1,1].", + " return 70.0 * (n0 + n1 + n2);", + " }", + "", + " /**", + " * Samples the noise field in 3 dimensions", + " * @param {number} x", + " * @param {number} y", + " * @param {number} z", + " * @returns a number in the interval [-1, 1]", + " */", + " noise3D(x, y, z) {", + " const permMod12 = this.permMod12;", + " const perm = this.perm;", + " let n0, n1, n2, n3; // Noise contributions from the four corners", + " // Skew the input space to determine which simplex cell we're in", + " const s = (x + y + z) * F3; // Very nice and simple skew factor for 3D", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const k = Math.floor(z + s);", + " const t = (i + j + k) * G3;", + " const X0 = i - t; // Unskew the cell origin back to (x,y,z) space", + " const Y0 = j - t;", + " const Z0 = k - t;", + " const x0 = x - X0; // The x,y,z distances from the cell origin", + " const y0 = y - Y0;", + " const z0 = z - Z0;", + " // For the 3D case, the simplex shape is a slightly irregular tetrahedron.", + " // Determine which simplex we are in.", + " let i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords", + " let i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords", + " if (x0 >= y0) {", + " if (y0 >= z0) {", + " i1 = 1;", + " j1 = 0;", + " k1 = 0;", + " i2 = 1;", + " j2 = 1;", + " k2 = 0;", + " } // X Y Z order", + " else if (x0 >= z0) {", + " i1 = 1;", + " j1 = 0;", + " k1 = 0;", + " i2 = 1;", + " j2 = 0;", + " k2 = 1;", + " } // X Z Y order", + " else {", + " i1 = 0;", + " j1 = 0;", + " k1 = 1;", + " i2 = 1;", + " j2 = 0;", + " k2 = 1;", + " } // Z X Y order", + " }", + " else { // x0 y0)", + " rankx++;", + " else", + " ranky++;", + " if (x0 > z0)", + " rankx++;", + " else", + " rankz++;", + " if (x0 > w0)", + " rankx++;", + " else", + " rankw++;", + " if (y0 > z0)", + " ranky++;", + " else", + " rankz++;", + " if (y0 > w0)", + " ranky++;", + " else", + " rankw++;", + " if (z0 > w0)", + " rankz++;", + " else", + " rankw++;", + " // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.", + " // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0;", + " const j1 = ranky >= 3 ? 1 : 0;", + " const k1 = rankz >= 3 ? 1 : 0;", + " const l1 = rankw >= 3 ? 1 : 0;", + " // The integer offsets for the third simplex corner", + " const i2 = rankx >= 2 ? 1 : 0;", + " const j2 = ranky >= 2 ? 1 : 0;", + " const k2 = rankz >= 2 ? 1 : 0;", + " const l2 = rankw >= 2 ? 1 : 0;", + " // The integer offsets for the fourth simplex corner", + " const i3 = rankx >= 1 ? 1 : 0;", + " const j3 = ranky >= 1 ? 1 : 0;", + " const k3 = rankz >= 1 ? 1 : 0;", + " const l3 = rankw >= 1 ? 1 : 0;", + " // The fifth corner has all coordinate offsets = 1, so no need to compute that.", + " const x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords", + " const y1 = y0 - j1 + G4;", + " const z1 = z0 - k1 + G4;", + " const w1 = w0 - l1 + G4;", + " const x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords", + " const y2 = y0 - j2 + 2.0 * G4;", + " const z2 = z0 - k2 + 2.0 * G4;", + " const w2 = w0 - l2 + 2.0 * G4;", + " const x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords", + " const y3 = y0 - j3 + 3.0 * G4;", + " const z3 = z0 - k3 + 3.0 * G4;", + " const w3 = w0 - l3 + 3.0 * G4;", + " const x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords", + " const y4 = y0 - 1.0 + 4.0 * G4;", + " const z4 = z0 - 1.0 + 4.0 * G4;", + " const w4 = w0 - 1.0 + 4.0 * G4;", + " // Work out the hashed gradient indices of the five simplex corners", + " const ii = i & 255;", + " const jj = j & 255;", + " const kk = k & 255;", + " const ll = l & 255;", + " // Calculate the contribution from the five corners", + " let t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;", + " if (t0 < 0)", + " n0 = 0.0;", + " else {", + " const gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);", + " }", + " let t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;", + " if (t1 < 0)", + " n1 = 0.0;", + " else {", + " const gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);", + " }", + " let t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;", + " if (t2 < 0)", + " n2 = 0.0;", + " else {", + " const gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);", + " }", + " let t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;", + " if (t3 < 0)", + " n3 = 0.0;", + " else {", + " const gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;", + " t3 *= t3;", + " n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);", + " }", + " let t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;", + " if (t4 < 0)", + " n4 = 0.0;", + " else {", + " const gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;", + " t4 *= t4;", + " n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);", + " }", + " // Sum up and scale the result to cover the range [-1,1]", + " return 27.0 * (n0 + n1 + n2 + n3 + n4);", + " };", + "}", + "", + "gdjs._shakeObjectExtension = {", + " noiseManager: new NoiseManager(),", + "};", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Coin", - "persistentUuid": "6c9e3364-2e91-4303-b317-5bce64b09119", - "rotationY": 90, - "width": 0, - "x": -2752, - "y": -909, - "z": 21, - "zOrder": 27, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Coin", - "persistentUuid": "bb8f1831-e855-41ad-bd31-30e614b65e25", - "rotationY": 90, - "width": 0, - "x": -2848, - "y": -909, - "z": 21, - "zOrder": 27, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Coin", - "persistentUuid": "b07ee07d-86f5-4e59-a7b0-b6c5171099af", - "rotationY": 90, - "width": 0, - "x": -1984, - "y": 640, - "z": 21, - "zOrder": 27, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Coin", - "persistentUuid": "b1bfa08d-a764-4321-9e9d-9c30b4519ce8", - "rotationY": 90, - "width": 0, - "x": -2176, - "y": 640, - "z": 21, - "zOrder": 27, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Coin", - "persistentUuid": "c46f85dc-d5ca-4c5b-8031-2a5a3f958d92", - "rotationY": 90, - "width": 0, - "x": -2080, - "y": 640, - "z": 21, - "zOrder": 27, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "SuvLuxury", - "persistentUuid": "3e4491d4-692c-4b61-a094-42cb08bc447e", - "width": 0, - "x": -2454, - "y": -838, - "z": 4, - "zOrder": 28, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "SuvLuxury", - "persistentUuid": "7b26b94b-35ec-42fa-b86f-82e32c55623d", - "width": 0, - "x": -2294, - "y": -838, - "z": 4, - "zOrder": 28, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Van", - "persistentUuid": "4353bab1-3f88-4232-96b2-99ca1f98b2a8", - "width": 0, - "x": -2040, - "y": -838, - "z": 4, - "zOrder": 38, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "Van", - "persistentUuid": "f305adba-bcf1-4248-9154-05d17d0cadc7", - "width": 0, - "x": -2582, - "y": -1085, - "z": 4, - "zOrder": 37, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "SuvLuxury", - "persistentUuid": "212ed022-9390-4cf7-a4f9-44bff1871667", - "width": 0, - "x": -2710, - "y": -1085, - "z": 4, - "zOrder": 39, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "Van", - "persistentUuid": "7902e61e-184e-4054-b623-832507695fb4", - "width": 0, - "x": -2262, - "y": 578, - "z": 4, - "zOrder": 37, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "SuvLuxury", - "persistentUuid": "d7618275-6fb6-4bee-a5a8-2a6f5d9cec01", - "width": 0, - "x": -2390, - "y": 578, - "z": 4, - "zOrder": 39, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 0, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "71dd5bd5-5081-4456-808f-07f6b36b3458", - "width": 1152, - "x": -3072, - "y": 512, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 0, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "589c0d9d-3def-4da2-9a78-9c27a3234ddc", - "width": 1152, - "x": -3072, - "y": -1152, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 90, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "1c38b5b1-b741-49f1-8e67-402ec9cea5ae", - "width": 1280, - "x": -3904, - "y": -320, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "5998a7f0-e369-4836-9ef5-5663a87fbb5f", - "width": 0, - "x": -2880, - "y": 384, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "d7aece1e-37c8-46e4-9102-64e16e39b2a6", - "width": 0, - "x": -2496, - "y": 448, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "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": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "bc10635b-5e4e-4947-aa41-1ffe1fdd46d0", - "width": 0, - "x": -2048, - "y": -320, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "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": [ { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "42a5d940-6fcf-4f93-bd2e-b649a3ef4d54", - "width": 0, - "x": -2992, - "y": -320, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "description": "Shake 3D objects with translation and rotation.", + "fullName": "3D shake", + "name": "ShakeModel3D", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsStartingAtCreation", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShakeObject3D::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::StartShaking" + }, + "parameters": [ + "Object", + "Behavior", + "0", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Step time counters." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "+", + "TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::IsShaking" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "NoiseTime", + "+", + "TimeDelta() * Frequency" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::SetSharedPropertyEasingFactor" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(Object.Behavior::StartEasingFactor(), Object.Behavior::StopEasingFactor())" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Shake the object.\nSave the object displacement to revert it in onScenePostEvents." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TranslationAmplitudeX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DeltaX", + "=", + "ShakeObject3D::Noise2d(\"\", NoiseTime, 1000) * TranslationAmplitudeX * EasingFactor" + ] + }, + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "+", + "DeltaX" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TranslationAmplitudeY", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DeltaY", + "=", + "ShakeObject3D::Noise2d(\"\", NoiseTime, 2000) * TranslationAmplitudeY * EasingFactor" + ] + }, + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "+", + "DeltaY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TranslationAmplitudeZ", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DeltaZ", + "=", + "ShakeObject3D::Noise2d(\"\", NoiseTime, 3000) * TranslationAmplitudeZ * EasingFactor" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "DeltaZ" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "RotationAmplitudeX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DeltaAngleX", + "=", + "ShakeObject3D::Noise2d(\"\", NoiseTime, 4000) * RotationAmplitudeX * EasingFactor" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "DeltaAngleX" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "RotationAmplitudeY", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DeltaAngleY", + "=", + "ShakeObject3D::Noise2d(\"\", NoiseTime, 5000) * RotationAmplitudeY * EasingFactor" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "DeltaAngleY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "RotationAmplitudeZ", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DeltaAngleZ", + "=", + "ShakeObject3D::Noise2d(\"\", NoiseTime, 6000) * RotationAmplitudeZ * EasingFactor" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "DeltaAngleZ" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Revert the shaking." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::IsShaking" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TranslationAmplitudeX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "-", + "DeltaX" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TranslationAmplitudeY", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "-", + "DeltaY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TranslationAmplitudeZ", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Object", + "Object3D", + "-", + "DeltaZ" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "RotationAmplitudeX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Object", + "Object3D", + "-", + "DeltaAngleX" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "RotationAmplitudeY", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "-", + "DeltaAngleY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "RotationAmplitudeZ", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "-", + "DeltaAngleZ" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Shake the object with a linear easing at the start and the end.", + "fullName": "Shake", + "functionType": "Action", + "name": "Shake", + "sentence": "Shake _PARAM0_ for _PARAM2_ seconds with _PARAM3_ seconds of easing to start and _PARAM4_ seconds to stop", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "NoiseTime", + "=", + "TimeFromStart() * Frequency" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "NewDuration" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StartEasingDuration", + "=", + "StartEaseDuration" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StopEasingDuration", + "=", + "StopEaseDuration" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "NewDuration", + "<", + "StartEaseDuration + StopEaseDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StartEasingDuration", + "=", + "StartEaseDuration * NewDuration / (StartEaseDuration + StopEaseDuration)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StopEasingDuration", + "=", + "StopEaseDuration * NewDuration / (StartEaseDuration + StopEaseDuration)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + }, + { + "description": "Duration (in seconds)", + "name": "NewDuration", + "type": "expression" + }, + { + "description": "Ease duration to start (in seconds)", + "name": "StartEaseDuration", + "type": "expression" + }, + { + "description": "Ease duration to stop (in seconds)", + "name": "StopEaseDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Shake the object with a linear easing at the start and keep shaking until the stop action is used.", + "fullName": "Start shaking", + "functionType": "Action", + "name": "StartShaking", + "sentence": "Start shaking _PARAM0_ with _PARAM2_ seconds of easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "NoiseTime", + "=", + "TimeFromStart() * Frequency" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "1234567890" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StartEasingDuration", + "=", + "EaseDuration" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + }, + { + "description": "Ease duration (in seconds)", + "name": "EaseDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Stop shaking the object with a linear easing.", + "fullName": "Stop shaking", + "functionType": "Action", + "name": "StopShaking", + "sentence": "Stop shaking _PARAM0_ with _PARAM2_ seconds of easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::IsShaking" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "EaseDuration" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StopEasingDuration", + "=", + "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": "NumberVariable" + }, + "parameters": [ + "Time", + "<", + "Duration" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Time", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is stopping to shake.", + "fullName": "Is stopping to shake", + "functionType": "Condition", + "name": "IsStopping", + "sentence": "_PARAM0_ is stopping to shake", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::IsShaking" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "ShakeObject3D::ShakeModel3D::StopEasingFactor" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "1", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the shaking frequency of the object.", + "fullName": "Shaking frequency", + "functionType": "ExpressionAndCondition", + "group": "ShakeObject3D configuration", + "name": "Frequency", + "sentence": "the shaking frequency", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Frequency" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Frequency", + "name": "SetFrequency", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Frequency", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the easing factor according to start properties.", + "fullName": "Start easing factor", + "functionType": "Expression", + "name": "StartEasingFactor", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "StartEasingDuration", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "StartEasingDuration", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "clamp(Time / StartEasingDuration, 0, 1)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the easing factor according to stop properties.", + "fullName": "Stop easing factor", + "functionType": "ExpressionAndCondition", + "name": "StopEasingFactor", + "private": true, + "sentence": "stop easing factor", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "StopEasingDuration", + "<=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Time", + "<", + "Duration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Time", + ">=", + "Duration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "0" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "StopEasingDuration", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "clamp((Duration - Time) / StopEasingDuration, 0, 1)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject3D::ShakeModel3D", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Translation amplitude on X axis", + "name": "TranslationAmplitudeX" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Translation amplitude on Y axis", + "name": "TranslationAmplitudeY" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Translation amplitude on Z axis", + "name": "TranslationAmplitudeZ" + }, + { + "value": "5", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation amplitude around X axis", + "name": "RotationAmplitudeX" + }, + { + "value": "5", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation amplitude around Y axis", + "name": "RotationAmplitudeY" + }, + { + "value": "5", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation amplitude around Z axis", + "name": "RotationAmplitudeZ" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "Time" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "Duration" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "StartEasingDuration" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "StopEasingDuration" + }, + { + "value": "", + "type": "Number", + "label": "Frequency", + "name": "Frequency" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "DeltaX" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "DeltaY" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "DeltaZ" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "DeltaAngleX" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "DeltaAngleY" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "DeltaAngleZ" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "NoiseTime" + }, + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "choices": [], + "name": "Object3D" + }, + { + "value": "", + "type": "Boolean", + "label": "Start to shake at the object creation", + "name": "IsStartingAtCreation" + } + ], + "sharedPropertyDescriptors": [ + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "EasingFactor" + } + ] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Camera", + "extensionNamespace": "", + "fullName": "Third person camera", + "gdevelopVersion": ">=5.5.222", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSI3LDEwIDEsMTMgNywxNiAxMywxMyAiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjEsMTMgMSwyMCA3LDIzIDEzLDIwIDEzLDEzICIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjciIHkxPSIxNiIgeDI9IjciIHkyPSIyMyIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjMxIiB5MT0iMTYiIHgyPSIyMSIgeTI9IjgiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyMSIgeTE9IjI0IiB4Mj0iMzEiIHkyPSIxNiIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTIyLjcsMjIuNkMyMCwyMS43LDE4LDE5LjEsMTgsMTZjMC0zLjEsMi01LjcsNC43LTYuNiIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTE5LjgsMTEuM2MxLjQsMS4xLDIuMiwyLjgsMi4yLDQuN2MwLDEuOS0wLjksMy42LTIuMiw0LjciLz4NCjwvc3ZnPg0K", + "name": "ThirdPersonCamera", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Virtual Reality/94e95d2c318e1f3dc7151a351024e13c574e1e44669c6696aa107d60230073f6_Virtual Reality_3d_vision_eye_vr.svg", + "shortDescription": "Move the camera to look at an object from a given distance.", + "version": "1.7.1", + "description": [ + "Move the camera to look at an object from a given distance with a rotation and an elevation angles.", + "", + "It can be useful for:", + "- 3D platformer games ([open the project online](https://editor.gdevelop.io/?project=example://3d-platformer))", + "- 3D racing games ([open the project online](https://editor.gdevelop.io/?project=example://3d-car-coin-hunt))", + "- Orbit camera controls ([open the project online](https://editor.gdevelop.io/?project=example://3d-tile-based-city-builder))", + "- Isometric-like point of view ([open the project online](https://editor.gdevelop.io/?project=example://3d-road-crosser))" + ], + "origin": { + "identifier": "ThirdPersonCamera", + "name": "gdevelop-extension-store" + }, + "tags": [ + "3d", + "camera" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "3114781d-439c-4092-97a5-9fea19bd3484", - "width": 0, - "x": -2880, - "y": -640, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Move the camera to look at a position from a distance.", + "fullName": "Look at a position from a distance (deprecated)", + "functionType": "Action", + "name": "LookFromDistanceAtPosition", + "private": true, + "sentence": "Move the camera of _PARAM6_ to look at _PARAM1_; _PARAM2_ from _PARAM3_ pixels with a rotation of _PARAM4_° and an elevation of _PARAM5_°", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "=", + "PositionX + Distance * cos(ToRad(RotationAngle + 90)) * cos(ToRad(ElevationAngle))", + "Layer", + "" + ] + }, + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "=", + "PositionY + Distance * sin(ToRad(RotationAngle + 90)) * cos(ToRad(ElevationAngle))", + "Layer", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraZ" + }, + "parameters": [ + "", + "=", + "Distance * sin(ToRad(ElevationAngle))", + "Layer", + "" + ] + }, + { + "type": { + "value": "Scene3D::TurnCameraTowardPosition" + }, + "parameters": [ + "", + "PositionX", + "PositionY", + "0", + "Layer", + "", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Position on X axis", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Position on Y axis", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Distance", + "name": "Distance", + "type": "expression" + }, + { + "description": "Rotation angle (around Z axis)", + "name": "RotationAngle", + "type": "expression" + }, + { + "description": "Elevation angle (around Y axis)", + "name": "ElevationAngle", + "type": "expression" + }, + { + "description": "Layer", + "name": "Layer", + "type": "layer" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "e705f10b-f9b2-448c-9d3a-1ea8d75c6090", - "width": 0, - "x": -2112, - "y": -640, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Move the camera to look at an object from a distance.", + "fullName": "Look at an object from a distance (deprecated)", + "functionType": "Action", + "name": "LookFromDistanceAtObject", + "private": true, + "sentence": "Move the camera of _PARAM5_ to look at _PARAM1_ from _PARAM2_ pixels with a rotation of _PARAM3_° and an elevation of _PARAM4_°", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::LookFromDistanceAtPosition" + }, + "parameters": [ + "", + "Object.CenterX()", + "Object.CenterY()", + "Distance", + "RotationAngle", + "ElevationAngle", + "Layer", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Distance", + "name": "Distance", + "type": "expression" + }, + { + "description": "Rotation angle (around Z axis)", + "name": "RotationAngle", + "type": "expression" + }, + { + "description": "Elevation angle (around Y axis)", + "name": "ElevationAngle", + "type": "expression" + }, + { + "description": "Layer", + "name": "Layer", + "type": "layer" + } + ], + "objectGroups": [] }, { - "angle": 180, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "e8525fb0-4377-4e96-8478-d818d10cf3a7", - "width": 0, - "x": -2496, - "y": -704, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Move the camera to look at a position from a distance.", + "fullName": "Look at a position from a distance", + "functionType": "Action", + "name": "LookFromDistanceAtPosition3D", + "sentence": "Move the camera of _PARAM7_ to look at _PARAM1_; _PARAM2_; _PARAM3_ from _PARAM4_ pixels with a rotation of _PARAM5_° and an elevation of _PARAM6_°", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "=", + "PositionX + Distance * cos(ToRad(RotationAngle + 90)) * cos(ToRad(ElevationAngle))", + "Layer", + "" + ] + }, + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "=", + "PositionY + Distance * sin(ToRad(RotationAngle + 90)) * cos(ToRad(ElevationAngle))", + "Layer", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraZ" + }, + "parameters": [ + "", + "=", + "PositionZ + Distance * sin(ToRad(ElevationAngle))", + "Layer", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraRotationX" + }, + "parameters": [ + "", + "=", + "90 - ElevationAngle", + "Layer", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraRotationY" + }, + "parameters": [ + "", + "=", + "0", + "Layer", + "" + ] + }, + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "=", + "RotationAngle", + "Layer", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Position on X axis", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Position on Y axis", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Position on Z axis", + "name": "PositionZ", + "type": "expression" + }, + { + "description": "Distance", + "name": "Distance", + "type": "expression" + }, + { + "description": "Rotation angle (around Z axis)", + "name": "RotationAngle", + "type": "expression" + }, + { + "description": "Elevation angle (around Y axis)", + "name": "ElevationAngle", + "type": "expression" + }, + { + "description": "Layer", + "name": "Layer", + "type": "layer" + } + ], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "d5d9b093-a2cc-4e24-b20d-97dc5c73c22f", - "width": 0, - "x": -2816, - "y": -320, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Move the camera to look at an object from a distance.", + "fullName": "Look at an object from a distance", + "functionType": "Action", + "group": "Layers and cameras", + "name": "LookFromDistanceAtObject3D", + "sentence": "Move the camera of _PARAM6_ to look at _PARAM1_ from _PARAM3_ pixels with a rotation of _PARAM4_° and an elevation of _PARAM5_°", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::LookFromDistanceAtPosition3D" + }, + "parameters": [ + "", + "Object.CenterX()", + "Object.CenterY()", + "Object.Object3D::CenterZ()", + "Distance", + "RotationAngle", + "ElevationAngle", + "Layer", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Distance", + "name": "Distance", + "type": "expression" + }, + { + "description": "Rotation angle (around Z axis)", + "name": "RotationAngle", + "type": "expression" + }, + { + "description": "Elevation angle (around Y axis)", + "name": "ElevationAngle", + "type": "expression" + }, + { + "description": "Layer", + "name": "Layer", + "type": "layer" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "066d761b-d1ad-418f-85b0-2092918d04ca", - "width": 0, - "x": -2496, - "y": -512, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "fullName": "", + "functionType": "Expression", + "name": "RotatedX", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Cos", + "=", + "cos(ToRad(RotationAngle))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Sin", + "=", + "sin(ToRad(RotationAngle))" + ] + }, + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Cos * X - Sin * Y" + ] + } + ], + "variables": [ + { + "folded": true, + "name": "Cos", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "Sin", + "type": "number", + "value": 0 + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Rotation angle", + "name": "RotationAngle", + "supplementaryInformation": "Tank::Tank", + "type": "expression" + }, + { + "description": "", + "name": "X", + "type": "expression" + }, + { + "description": "", + "name": "Y", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "7d99af49-c26d-4324-a85f-7bc7d79b3ee1", - "width": 0, - "x": -2240, - "y": 256, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "fullName": "", + "functionType": "Expression", + "name": "RotatedY", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Cos", + "=", + "cos(ToRad(RotationAngle))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Sin", + "=", + "sin(ToRad(RotationAngle))" + ] + }, + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Sin * X + Cos * Y" + ] + } + ], + "variables": [ + { + "folded": true, + "name": "Cos", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "Sin", + "type": "number", + "value": 0 + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Rotation angle", + "name": "RotationAngle", + "supplementaryInformation": "Tank::Tank", + "type": "expression" + }, + { + "description": "", + "name": "X", + "type": "expression" + }, + { + "description": "", + "name": "Y", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "7a6b3b71-1702-4d7f-bef0-19f17e813745", - "width": 0, - "x": -2816, - "y": 64, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Smoothly follow an object at a distance.", + "fullName": "Third person camera", + "name": "ThirdPersonCamera", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Update private properties through setters to check their values and initialize state." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "RotationHalfwayDuration", + "" + ] + }, + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetElevationHalfwayDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ElevationHalfwayDuration", + "" + ] + }, + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetTranslationZHalfwayDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "TranslationZHalfwayDuration", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "HasJustBeenCreated", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HasJustBeenCreated", + "False", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraZ", + "=", + "Object.Object3D::CenterZ()" + ] + }, + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::JumpToTargetedRotation" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "IsCalledManually", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::DoMoveCameraCloser" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera closer to the object. This action must be called after the object has moved for the frame.", + "fullName": "Move the camera closer", + "functionType": "Action", + "name": "MoveCameraCloser", + "sentence": "Move the camera closer to _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The camera following is called with an action, the call from doStepPreEvents must be disabled to avoid to do it twice." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BehaviorActivated" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsCalledManually", + "False", + "" + ] + }, + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::DoMoveCameraCloser" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera closer to the object.", + "fullName": "Do move the camera closer", + "functionType": "Action", + "name": "DoMoveCameraCloser", + "private": true, + "sentence": "Do move the camera closer _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "At each frame, the camera must catchup the target by a given ratio (speed)\ncameraX(t) - targetX = (cameraX(t - 1) - targetX) * (1 - speed)\n\nThe frame rate must not impact on the catch-up speed, we don't want a speed in ratio per frame but a speed ratio per second, like this:\ncameraX(t) - targetX = (cameraX(t - 1s) - targetX) * (1 - speed)\n\nOk, but we still need to process each frame, we can use a exponent for this:\ncameraX(t) - targetX = (cameraX(t - timeDelta) - targetX) * (1 - speed)^timeDelta\ncameraX(t) = targetX + (cameraX(t - timeDelta) - targetX) * exp(timeDelta * ln((1 - speed)))\n\npow is probably more efficient than precalculated log if the speed is changed continuously but this might be rare enough." + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Z translation", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraZ", + "<", + "Object.Behavior::FreeAreaZMin()" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraZ", + "=", + "Object.Behavior::FreeAreaZMin() + (CameraZ - Object.Behavior::FreeAreaZMin()) * exp(TimeDelta() * TranslationZLogSpeed)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraZ", + ">", + "Object.Behavior::FreeAreaZMax()" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraZ", + "=", + "Object.Behavior::FreeAreaZMax() + (CameraZ - Object.Behavior::FreeAreaZMax()) * exp(TimeDelta() * TranslationZLogSpeed)" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Z rotation", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsRotatingWithObject", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedRotationAngle", + "=", + "Object.Angle()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsElevatingWithObject", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedElevationAngle", + "=", + "Object.Object3D::RotationY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraRotationAngle", + "=", + "TargetedRotationAngle + 90 + RotationAngleOffset + AngleDifference(CameraAngle(Object.Layer()), TargetedRotationAngle + 90 + RotationAngleOffset) * exp(TimeDelta() * RotationLogSpeed)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraElevationAngle", + "=", + "TargetedElevationAngle + ElevationAngleOffset + AngleDifference(90 - Scene3D::CameraRotationX(Object.Layer()), TargetedElevationAngle + ElevationAngleOffset) * exp(TimeDelta() * ElevationLogSpeed)" + ] + }, + { + "type": { + "value": "ThirdPersonCamera::LookFromDistanceAtPosition3D" + }, + "parameters": [ + "", + "Object.CenterX() + ThirdPersonCamera::RotatedX(CameraRotationAngle, OffsetX, -OffsetY)", + "Object.CenterY() + ThirdPersonCamera::RotatedY(CameraRotationAngle, OffsetX, -OffsetY)", + "CameraZ + OffsetZ", + "Distance", + "CameraRotationAngle", + "CameraElevationAngle", + "", + "" + ] + } + ], + "variables": [ + { + "folded": true, + "name": "CameraRotationAngle", + "type": "number", + "value": 0 + }, + { + "name": "CameraElevationAngle", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Rotate the camera all the way to the targeted angle.", + "fullName": "Rotate the camera all the way", + "functionType": "Action", + "name": "JumpToTargetedRotation", + "sentence": "Rotate the camera all the way to the targeted angle of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsRotatingWithObject", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedRotationAngle", + "=", + "Object.Angle()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsElevatingWithObject", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedElevationAngle", + "=", + "Object.Object3D::RotationY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraAngle", + "=", + "TargetedRotationAngle + 90 + RotationAngleOffset" + ] + }, + { + "type": { + "value": "ThirdPersonCamera::LookFromDistanceAtPosition3D" + }, + "parameters": [ + "", + "Object.CenterX() + ThirdPersonCamera::RotatedX(CameraAngle, OffsetX, -OffsetY)", + "Object.CenterY() + ThirdPersonCamera::RotatedY(CameraAngle, OffsetX, -OffsetY)", + "CameraZ + OffsetZ", + "Distance", + "CameraAngle", + "Object.Object3D::RotationY() + ElevationAngleOffset", + "", + "" + ] + } + ], + "variables": [ + { + "folded": true, + "name": "CameraAngle", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the camera rotation.", + "fullName": "Camera rotation", + "functionType": "ExpressionAndCondition", + "name": "RotationAngle", + "private": true, + "sentence": "the camera rotation", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "CameraAngle(Object.Layer())" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Rotate the camera all the way to the targeted angle.", + "fullName": "Rotate the camera all the way", + "functionType": "ActionWithOperator", + "getterName": "RotationAngle", + "name": "SetCameraRotation", + "sentence": "Rotate the camera all the way to the targeted angle of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::LookFromDistanceAtPosition3D" + }, + "parameters": [ + "", + "Object.CenterX() + ThirdPersonCamera::RotatedX(Value, OffsetX, -OffsetY)", + "Object.CenterY() + ThirdPersonCamera::RotatedY(Value, OffsetX, -OffsetY)", + "CameraZ + OffsetZ", + "Distance", + "Value", + "Object.Object3D::RotationY() + ElevationAngleOffset", + "", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the halfway time for rotation of the object.", + "fullName": "Halfway time for rotation", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "RotationHalfwayDuration", + "sentence": "the halfway time for rotation", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "RotationHalfwayDuration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "RotationHalfwayDuration", + "name": "SetRotationHalfwayDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "ln((1 - speed)) = ln(1 / 2) / halfwatTime" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "RotationHalfwayDuration", + "=", + "Value" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "RotationLogSpeed", + "=", + "log(0.5) / Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the halfway time for elevation rotation of the object.", + "fullName": "Halfway time for elevation rotation", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "ElevationHalfwayDuration", + "sentence": "the halfway time for elevation rotation", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ElevationHalfwayDuration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ElevationHalfwayDuration", + "name": "SetElevationHalfwayDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "ln((1 - speed)) = ln(1 / 2) / halfwatTime" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ElevationHalfwayDuration", + "=", + "Value" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ElevationLogSpeed", + "=", + "log(0.5) / Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the halfway time on Z axis of the object.", + "fullName": "Halfway time on Z axis", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "TranslationZHalfwayDuration", + "sentence": "the halfway time on Z axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TranslationZHalfwayDuration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "TranslationZHalfwayDuration", + "name": "SetTranslationZHalfwayDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "ln((1 - speed)) = ln(1 / 2) / halfwatTime" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TranslationZHalfwayDuration", + "=", + "Value" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TranslationZLogSpeed", + "=", + "log(0.5) / Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return follow free area bottom border Z.", + "fullName": "Free area Z min", + "functionType": "Expression", + "group": "Private", + "name": "FreeAreaZMin", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Object3D::CenterZ() + OffsetZ - FollowFreeAreaZMin" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return follow free area top border Z.", + "fullName": "Free area Z max", + "functionType": "Expression", + "group": "Private", + "name": "FreeAreaZMax", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Object3D::CenterZ() + OffsetZ + FollowFreeAreaZMax" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the follow free area top border on Z axis of the object.", + "fullName": "Follow free area top border on Z axis", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "FollowFreeAreaZMax", + "sentence": "the follow free area top border on Z axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FollowFreeAreaZMax" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FollowFreeAreaZMax", + "name": "SetFollowFreeAreaZMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "FollowFreeAreaZMax", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the follow free area bottom border on Z axis of the object.", + "fullName": "Follow free area bottom border on Z axis", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "FollowFreeAreaZMin", + "sentence": "the follow free area bottom border on Z axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FollowFreeAreaZMin" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FollowFreeAreaZMin", + "name": "SetFollowFreeAreaZMin", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "FollowFreeAreaZMin", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the camera distance of the object.", + "fullName": "Camera distance", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "Distance", + "sentence": "the camera distance", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Distance" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Distance", + "name": "SetDistance", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Distance", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the lateral distance offset of the object.", + "fullName": "Lateral distance offset", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "OffsetX", + "sentence": "the lateral distance offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "OffsetX" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "OffsetX", + "name": "SetOffsetX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OffsetX", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the ahead distance offset of the object.", + "fullName": "Ahead distance offset", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "OffsetY", + "sentence": "the ahead distance offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "OffsetY" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "OffsetY", + "name": "SetOffsetY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OffsetY", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the z offset of the object.", + "fullName": "Z offset", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "OffsetZ", + "sentence": "the z offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "OffsetZ" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "OffsetZ", + "name": "SetOffsetZ", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OffsetZ", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the rotation angle offset of the object.", + "fullName": "Rotation angle offset", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "RotationAngleOffset", + "sentence": "the rotation angle offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "RotationAngleOffset" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "RotationAngleOffset", + "name": "SetRotationAngleOffset", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "RotationAngleOffset", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the elevation angle offset of the object.", + "fullName": "Elevation angle offset", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "ElevationAngleOffset", + "sentence": "the elevation angle offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ElevationAngleOffset" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ElevationAngleOffset", + "name": "SetElevationAngleOffset", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ElevationAngleOffset", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the targeted camera rotation angle of the object. When this angle is set, the camera follow this value instead of the object angle.", + "fullName": "Targeted rotation angle", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "TargetedRotationAngle", + "sentence": "the targeted camera rotation angle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TargetedRotationAngle" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "TargetedRotationAngle", + "name": "SetTargetedRotationAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedRotationAngle", + "=", + "Value" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsRotatingWithObject", + "False", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "choices": [], + "name": "Object3D" + }, + { + "value": "0.125", + "type": "Number", + "unit": "Second", + "label": "Halfway time for rotation", + "group": "Catch-up speed", + "quickCustomizationVisibility": "hidden", + "name": "RotationHalfwayDuration" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Halfway time for elevation rotation", + "group": "Catch-up speed", + "quickCustomizationVisibility": "hidden", + "name": "ElevationHalfwayDuration" + }, + { + "value": "0.125", + "type": "Number", + "unit": "Second", + "label": "Halfway time on Z axis", + "group": "Catch-up speed", + "quickCustomizationVisibility": "hidden", + "name": "TranslationZHalfwayDuration" + }, + { + "value": "500", + "type": "Number", + "unit": "Pixel", + "label": "Camera distance", + "group": "Position", + "name": "Distance" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Lateral distance offset", + "group": "Position", + "name": "OffsetX" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Ahead distance offset", + "group": "Position", + "name": "OffsetY" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z offset", + "group": "Position", + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation angle offset", + "group": "Position", + "name": "RotationAngleOffset" + }, + { + "value": "20", + "type": "Number", + "unit": "DegreeAngle", + "label": "Elevation angle offset", + "group": "Position", + "name": "ElevationAngleOffset" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area top border on Z axis", + "group": "Position", + "advanced": true, + "quickCustomizationVisibility": "hidden", + "name": "FollowFreeAreaZMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area bottom border on Z axis", + "group": "Position", + "advanced": true, + "quickCustomizationVisibility": "hidden", + "name": "FollowFreeAreaZMin" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "RotationLogSpeed" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "ElevationLogSpeed" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "TranslationZLogSpeed" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "hidden": true, + "name": "IsCalledManually" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "", + "hidden": true, + "name": "CameraZ" + }, + { + "value": "true", + "type": "Boolean", + "label": "", + "hidden": true, + "name": "HasJustBeenCreated" + }, + { + "value": "true", + "type": "Boolean", + "label": "Automatically rotate the camera with the object", + "quickCustomizationVisibility": "hidden", + "name": "IsRotatingWithObject" + }, + { + "value": "false", + "type": "Boolean", + "label": "Automatically rotate the camera with the object (elevation)", + "quickCustomizationVisibility": "hidden", + "name": "IsElevatingWithObject" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Targeted camera rotation angle", + "description": "When this angle is set, the camera follow this value instead of the object angle.", + "hidden": true, + "name": "TargetedRotationAngle" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Targeted camera rotation angle", + "description": "When this angle is set, the camera follow this value instead of the object angle.", + "hidden": true, + "name": "TargetedElevationAngle" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Visual effect", + "extensionNamespace": "", + "fullName": "3D particle emitter", + "gdevelopVersion": ">=5.5.222", + "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 in 3D to create visual effects in a 3D game.", + "version": "3.0.1", + "description": [ + "3D particle emitters let you create and display many small particles to simulate visual effects in your game — like fire, explosions, smoke, or dust.", + "", + "The parameters of the object can be configured in multiple different ways to create a specific desired effect. GDevelop will give a set of a pre-configured 3D particle emitters that you should try first.", + "", + "Use these 3D particle emitters in 3D games. For 2D games or particles that appear on a game's 2D user interface, use the 2D particle emitter object instead." + ], + "origin": { + "identifier": "ParticleEmitter3D", + "name": "gdevelop-extension-store" + }, + "tags": [ + "3d", + "particle", + "explosion", + "fire", + "smoke", + "splash", + "light" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "changelog": [ + { + "version": "3.0.0", + "breaking": "- the object rotates the other way around X axis." }, { - "angle": 270, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "a33e9c0f-a1d9-4677-81c3-4630f53f1555", - "width": 0, - "x": -1984, - "y": 64, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "version": "2.0.0", + "breaking": "- Object properties for position and rotation have been removed. They must be set with the instance editor or the action." + }, + { + "version": "1.0.0", + "breaking": "- Particles were 3 times too small." + } + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Define helper classes JavaScript code.", + "fullName": "Define helper classes", + "functionType": "Action", + "name": "DefineHelperClasses", + "private": true, + "sentence": "Define helper classes JavaScript code", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (gdjs.__particleEmmiter3DExtension) {", + " return;", + "}", + "", + "const game = runtimeScene.getGame();", + "", + "class ParticleEmitter3DRenderer extends gdjs.CustomRuntimeObject3DRenderer {", + " constructor(", + " object,", + " instanceContainer,", + " parent", + " ) {", + " super(object, instanceContainer, parent);", + " }", + "", + " _updateThreeGroup() {", + " const threeObject3D = this.get3DRendererObject();", + "", + " threeObject3D.rotation.set(", + " gdjs.toRad(this._object.getRotationX()),", + " gdjs.toRad(this._object.getRotationY()),", + " gdjs.toRad(this._object.angle)", + " );", + "", + " threeObject3D.position.set(", + " this._object.getX(),", + " this._object.getY(),", + " this._object.getZ()", + " );", + "", + " // Force the scale to 1 because the particle emitter doesn't really has a size.", + " threeObject3D.scale.set(", + " this._object.isFlippedX() ? -1 : 1,", + " this._object.isFlippedY() ? -1 : 1,", + " this._object.isFlippedZ() ? -1 : 1", + " );", + "", + " threeObject3D.visible = !this._object.hidden;", + "", + " this._isContainerDirty = true;", + " }", + "}", + "", + "const coneLength = 64;", + "", + "class ParticleEmitterHelper extends THREE.Object3D {", + " /** @type {gdjs.CustomRuntimeObject3D} */", + " object;", + " /** @type {THREE.LineSegments} */", + " cone;", + " /** @type {THREE.LineSegments} */", + " centerLine;", + " /** @type {THREE.Mesh} */", + " originBox;", + "", + "\t/**", + " * @param gdjs.CustomRuntimeObject3D object", + "\t */", + " constructor(object) {", + " super();", + " this.object = object;", + " this.type = 'ParticleEmitterHelper';", + "", + " const coneGeometry = new THREE.BufferGeometry();", + " const conePositions = [", + " 0, 0, 0, 0, 0, 1,", + " 0, 0, 0, 1, 0, 1,", + " 0, 0, 0, - 1, 0, 1,", + " 0, 0, 0, 0, 1, 1,", + " 0, 0, 0, 0, - 1, 1", + " ];", + " for (let i = 0, j = 1, l = 32; i < l; i++ , j++) {", + " const p1 = (i / l) * Math.PI * 2;", + " const p2 = (j / l) * Math.PI * 2;", + " conePositions.push(", + " Math.cos(p1), Math.sin(p1), 1,", + " Math.cos(p2), Math.sin(p2), 1", + " );", + " }", + " coneGeometry.setAttribute('position', new THREE.Float32BufferAttribute(conePositions, 3));", + " this.cone = new THREE.LineSegments(", + " coneGeometry,", + " new THREE.LineBasicMaterial({ fog: false, toneMapped: false })", + " );", + " this.add(this.cone);", + " const centerLineGeometry = new THREE.BufferGeometry();", + " centerLineGeometry.setAttribute('position', new THREE.Float32BufferAttribute([", + " 0, 0, 0, 0, 0, coneLength", + " ], 3));", + " this.centerLine = new THREE.LineSegments(", + " centerLineGeometry,", + " new THREE.LineBasicMaterial({ fog: false, toneMapped: false })", + " );", + " this.add(this.centerLine);", + "", + " this.originBox = new THREE.Mesh(", + " new THREE.BoxGeometry(16, 16, 16),", + " new THREE.MeshBasicMaterial({ fog: false, toneMapped: false })", + " );", + " this.add(this.originBox);", + " this.update();", + "", + " this.originBox.gdjsRuntimeObject = object;", + " }", + "", + " dispose() {", + " this.cone.geometry.dispose();", + " this.cone.material.dispose();", + " this.centerLine.geometry.dispose();", + " this.centerLine.material.dispose();", + " this.originBox.geometry.dispose();", + " this.originBox.material.dispose();", + " }", + "", + " update() {", + " const coneWidth = coneLength * Math.sin(gdjs.toRad(this.object._getSpayConeAngle()));", + " const coneHeight = coneLength * Math.cos(gdjs.toRad(this.object._getSpayConeAngle()));", + " this.cone.scale.set(coneWidth, coneWidth, coneHeight);", + " const startColor = gdjs.rgbOrHexStringToNumber(this.object._getStartColor())", + " const endColor = gdjs.rgbOrHexStringToNumber(this.object._getEndColor());", + " this.cone.material.color.set(endColor);", + " this.centerLine.material.color.set(startColor);", + " this.originBox.material.color.set(startColor);", + " }", + "}", + "", + "/**", + " * @param {string} colorString", + " * @param {THREE.Vector4} threeColor", + " */", + "const setThreeColor = (colorString, threeColor = new THREE.Vector4()) => {", + " const integerColor = gdjs.rgbOrHexToRGBColor(colorString);", + " threeColor.x = integerColor[0] / 255;", + " threeColor.y = integerColor[1] / 255;", + " threeColor.z = integerColor[2] / 255;", + "};", + "", + "/**", + " * @param {string} integerOpacity", + " * @param {THREE.Vector4} threeColor", + " */", + "const setThreeOpacity = (integerOpacity, threeColor = new THREE.Vector4()) => {", + " threeColor.w = integerOpacity / 255;", + "};", + "", + "class ParticleEmitterAdapter {", + " /**", + " * @param particleSystem {ParticleSystem}", + " * @param colorOverLife {ColorOverLife}", + " * @param sizeOverLife {SizeOverLife}", + " * @param applyForce {ApplyForce}", + " */", + " constructor(particleSystem, colorOverLife, sizeOverLife, applyForce) {", + " this.particleSystem = particleSystem;", + " this.colorOverLife = colorOverLife;", + " this.sizeOverLife = sizeOverLife;", + " this.applyForce = applyForce;", + " }", + "", + " /**", + " * @param startColor {string}", + " */", + " setStartColor(startColor) {", + " setThreeColor(startColor, this.colorOverLife.color.color.keys[0][0]);", + " }", + "", + " /**", + " * @param endColor {string}", + " */", + " setEndColor(endColor) {", + " setThreeColor(endColor, this.colorOverLife.color.color.keys[1][0]);", + " }", + "", + " /**", + " * @param startOpacity {number}", + " */", + " setStartOpacity(startOpacity) {", + " this.colorOverLife.color.alpha.keys[0][0] = startOpacity / 255;", + " }", + "", + " /**", + " * @param endOpacity {number}", + " */", + " setEndOpacity(endOpacity) {", + " this.colorOverLife.color.alpha.keys[1][0] = endOpacity / 255;", + " }", + "", + " /**", + " * @param flow {number}", + " */", + " setFlow(flow) {", + " this.particleSystem.emissionOverTime.value = flow;", + " }", + "", + " /**", + " * @param startMinSize {number}", + " */", + " setStartMinSize(startMinSize) {", + " this.particleSystem.startSize.a = startMinSize;", + " }", + "", + " /**", + " * @param startMaxSize {number}", + " */", + " setStartMaxSize(startMaxSize) {", + " this.particleSystem.startSize.b = startMaxSize;", + " }", + "", + " /**", + " * @param endScale {number}", + " */", + " setEndScale(endScale) {", + " /** @type Bezier */", + " const bezier = this.sizeOverLife.size.functions[0][0];", + " bezier.p[0] = 1;", + " bezier.p[1] = gdjs.evtTools.common.lerp(1, endScale, 1 / 3);", + " bezier.p[2] = gdjs.evtTools.common.lerp(1, endScale, 2 / 3);", + " bezier.p[3] = endScale;", + " }", + "", + " /**", + " * @param startSpeedMin {number}", + " */", + " setStartSpeedMin(startSpeedMin) {", + " this.particleSystem.startSpeed.a = startSpeedMin;", + " }", + "", + " /**", + " * @param startSpeedMax {number}", + " */", + " setStartSpeedMax(startSpeedMax) {", + " this.particleSystem.startSpeed.b = startSpeedMax;", + " }", + "", + " /**", + " * @param lifespanMin {number}", + " */", + " setLifespanMin(lifespanMin) {", + " this.particleSystem.startLife.a = lifespanMin;", + " }", + "", + " /**", + " * @param lifespanMax {number}", + " */", + " setLifespanMax(lifespanMax) {", + " this.particleSystem.startLife.b = lifespanMax;", + " }", + "", + " /**", + " * @param duration {number}", + " */", + " setDuration(duration) {", + " this.particleSystem.duration = duration || Number.POSITIVE_INFINITY;", + " }", + "", + " /**", + " * @param areParticlesRelative {boolean}", + " */", + " setParticlesRelative(areParticlesRelative) {", + " this.particleSystem.worldSpace = !areParticlesRelative;", + " }", + "", + " /**", + " * @param sprayConeAngle {number}", + " */", + " setSprayConeAngle(sprayConeAngle) {", + " if (0 < sprayConeAngle && sprayConeAngle <= 180) {", + " if (!this.particleSystem.emitterShape.angle) {", + " this.particleSystem.emitterShape = new ConeEmitter({ radius: 0.1, angle: Math.PI / 8 });", + " }", + " this.particleSystem.emitterShape.angle = sprayConeAngle * Math.PI / 180;", + " }", + " else {", + " if (this.particleSystem.emitterShape.angle) {", + " this.particleSystem.emitterShape = new PointEmitter();", + " }", + " }", + " }", + "", + " /**", + " * @param blending {string}", + " */", + " setBlending(blendingString) {", + " const blending =", + " blendingString === \"Additive\" ? THREE.AdditiveBlending :", + " blendingString === \"Normal\" ? THREE.NormalBlending :", + " blendingString === \"Subtractive\" ? THREE.SubtractiveBlending :", + " blendingString === \"Multiply\" ? THREE.MultiplyBlending :", + " blendingString === \"None\" ? THREE.NoBlending :", + " THREE.AdditiveBlending;", + " // TODO This doesn't work.", + " this.particleSystem.blending = blending;", + " }", + "", + " /**", + " * @param gravity {number}", + " */", + " setGravity(gravity) {", + " this.applyForce.magnitude.value = gravity;", + " }", + "", + " /**", + " * @param gravityTop {string}", + " */", + " setGravityTop(gravityTop) {", + " // TODO Make gravity absolute even when \"relative\" is enabled. ", + " switch (gravityTop) {", + " case \"Z+\":", + " this.applyForce.direction.set(0, 0, -1);", + " break;", + "", + " case \"Y-\":", + " this.applyForce.direction.set(0, 1, 0);", + " break;", + " }", + " }", + "", + " setImage(resourceName) {", + " const texture = game.getImageManager().getThreeTexture(resourceName);", + " this.particleSystem.texture = texture;", + " }", + "}", + "", + "", + "", + "/**", + " * three.quarks v0.11.2 build Mon Jan 22 2024", + " * https://github.com/Alchemist0823/three.quarks#readme", + " * Copyright 2024 Alchemist0823 , MIT", + " */", + "", + "// The migration to addUpdateRange was backported without updating the library", + "// because GDevelop still uses Three.js 0.160.0.", + "", + "class ParticleEmitter extends THREE.Object3D {", + " constructor(system) {", + " super();", + " this.type = 'ParticleEmitter';", + " this.system = system;", + " }", + " clone() {", + " const system = this.system.clone();", + " system.emitter.copy(this, true);", + " return system.emitter;", + " }", + " dispose() { }", + " extractFromCache(cache) {", + " const values = [];", + " for (const key in cache) {", + " const data = cache[key];", + " delete data.metadata;", + " values.push(data);", + " }", + " return values;", + " }", + " toJSON(meta, options = {}) {", + " const isRootObject = meta === undefined || typeof meta === 'string';", + " const output = {};", + " if (isRootObject) {", + " meta = {", + " geometries: {},", + " materials: {},", + " textures: {},", + " images: {},", + " shapes: {},", + " skeletons: {},", + " animations: {},", + " nodes: {},", + " };", + " output.metadata = {", + " version: 4.5,", + " type: 'Object',", + " generator: 'Object3D.toJSON',", + " };", + " }", + " const object = {};", + " object.uuid = this.uuid;", + " object.type = this.type;", + " if (this.name !== '')", + " object.name = this.name;", + " if (this.castShadow === true)", + " object.castShadow = true;", + " if (this.receiveShadow === true)", + " object.receiveShadow = true;", + " if (this.visible === false)", + " object.visible = false;", + " if (this.frustumCulled === false)", + " object.frustumCulled = false;", + " if (this.renderOrder !== 0)", + " object.renderOrder = this.renderOrder;", + " if (JSON.stringify(this.userData) !== '{}')", + " object.userData = this.userData;", + " object.layers = this.layers.mask;", + " object.matrix = this.matrix.toArray();", + " if (this.matrixAutoUpdate === false)", + " object.matrixAutoUpdate = false;", + " if (this.system !== null)", + " object.ps = this.system.toJSON(meta, options);", + " if (this.children.length > 0) {", + " object.children = [];", + " for (let i = 0; i < this.children.length; i++) {", + " if (this.children[i].type !== 'ParticleSystemPreview') {", + " object.children.push(this.children[i].toJSON(meta).object);", + " }", + " }", + " }", + " if (isRootObject) {", + " const geometries = this.extractFromCache(meta.geometries);", + " const materials = this.extractFromCache(meta.materials);", + " const textures = this.extractFromCache(meta.textures);", + " const images = this.extractFromCache(meta.images);", + " if (geometries.length > 0)", + " output.geometries = geometries;", + " if (materials.length > 0)", + " output.materials = materials;", + " if (textures.length > 0)", + " output.textures = textures;", + " if (images.length > 0)", + " output.images = images;", + " }", + " output.object = object;", + " return output;", + " }", + "}", + "", + "class LinkedListNode {", + " constructor(data) {", + " this.data = data;", + " this.next = null;", + " this.prev = null;", + " }", + " hasPrev() {", + " return this.prev !== null;", + " }", + " hasNext() {", + " return this.next !== null;", + " }", + "}", + "class LinkedList {", + " constructor() {", + " this.length = 0;", + " this.head = this.tail = null;", + " }", + " isEmpty() {", + " return this.head === null;", + " }", + " clear() {", + " this.length = 0;", + " this.head = this.tail = null;", + " }", + " front() {", + " if (this.head === null)", + " return null;", + " return this.head.data;", + " }", + " back() {", + " if (this.tail === null)", + " return null;", + " return this.tail.data;", + " }", + " dequeue() {", + " if (this.head) {", + " const value = this.head.data;", + " this.head = this.head.next;", + " if (!this.head) {", + " this.tail = null;", + " }", + " else {", + " this.head.prev = null;", + " }", + " this.length--;", + " return value;", + " }", + " return undefined;", + " }", + " pop() {", + " if (this.tail) {", + " const value = this.tail.data;", + " this.tail = this.tail.prev;", + " if (!this.tail) {", + " this.head = null;", + " }", + " else {", + " this.tail.next = null;", + " }", + " this.length--;", + " return value;", + " }", + " return undefined;", + " }", + " queue(data) {", + " const node = new LinkedListNode(data);", + " if (!this.tail) {", + " this.tail = node;", + " }", + " if (this.head) {", + " this.head.prev = node;", + " node.next = this.head;", + " }", + " this.head = node;", + " this.length++;", + " }", + " push(data) {", + " const node = new LinkedListNode(data);", + " if (!this.head) {", + " this.head = node;", + " }", + " if (this.tail) {", + " this.tail.next = node;", + " node.prev = this.tail;", + " }", + " this.tail = node;", + " this.length++;", + " }", + " insertBefore(node, data) {", + " const newNode = new LinkedListNode(data);", + " newNode.next = node;", + " newNode.prev = node.prev;", + " if (newNode.prev !== null) {", + " newNode.prev.next = newNode;", + " }", + " newNode.next.prev = newNode;", + " if (node == this.head) {", + " this.head = newNode;", + " }", + " this.length++;", + " }", + " remove(data) {", + " if (this.head === null || this.tail === null) {", + " return;", + " }", + " let tempNode = this.head;", + " if (data === this.head.data) {", + " this.head = this.head.next;", + " }", + " if (data === this.tail.data) {", + " this.tail = this.tail.prev;", + " }", + " while (tempNode.next !== null && tempNode.data !== data) {", + " tempNode = tempNode.next;", + " }", + " if (tempNode.data === data) {", + " if (tempNode.prev !== null)", + " tempNode.prev.next = tempNode.next;", + " if (tempNode.next !== null)", + " tempNode.next.prev = tempNode.prev;", + " this.length--;", + " }", + " }", + " *values() {", + " let current = this.head;", + " while (current !== null) {", + " yield current.data;", + " current = current.next;", + " }", + " }", + "}", + "", + "class NodeParticle {", + " constructor() {", + " this.position = new THREE.Vector3();", + " this.velocity = new THREE.Vector3();", + " this.age = 0;", + " this.life = 1;", + " this.size = 1;", + " this.rotation = 0;", + " this.color = new THREE.Vector4(1, 1, 1, 1);", + " this.uvTile = 0;", + " }", + " get died() {", + " return this.age >= this.life;", + " }", + " reset() {", + " this.position.set(0, 0, 0);", + " this.velocity.set(0, 0, 0);", + " this.age = 0;", + " this.life = 1;", + " this.size = 1;", + " this.rotation = 0;", + " this.color.set(1, 1, 1, 1);", + " this.uvTile = 0;", + " }", + "}", + "class SpriteParticle {", + " constructor() {", + " this.startSpeed = 0;", + " this.startColor = new THREE.Vector4();", + " this.startSize = 1;", + " this.position = new THREE.Vector3();", + " this.velocity = new THREE.Vector3();", + " this.age = 0;", + " this.life = 1;", + " this.size = 1;", + " this.speedModifier = 1;", + " this.rotation = 0;", + " this.color = new THREE.Vector4();", + " this.uvTile = 0;", + " }", + " get died() {", + " return this.age >= this.life;", + " }", + "}", + "class RecordState {", + " constructor(position, size, color) {", + " this.position = position;", + " this.size = size;", + " this.color = color;", + " }", + "}", + "class TrailParticle {", + " constructor() {", + " this.startSpeed = 0;", + " this.startColor = new THREE.Vector4();", + " this.startSize = 1;", + " this.position = new THREE.Vector3();", + " this.velocity = new THREE.Vector3();", + " this.age = 0;", + " this.life = 1;", + " this.size = 1;", + " this.length = 100;", + " this.speedModifier = 1;", + " this.color = new THREE.Vector4();", + " this.previous = new LinkedList();", + " this.uvTile = 0;", + " }", + " update() {", + " if (this.age <= this.life) {", + " this.previous.push(new RecordState(this.position.clone(), this.size, this.color.clone()));", + " }", + " else {", + " if (this.previous.length > 0) {", + " this.previous.dequeue();", + " }", + " }", + " while (this.previous.length > this.length) {", + " this.previous.dequeue();", + " }", + " }", + " get died() {", + " return this.age >= this.life;", + " }", + " reset() {", + " this.previous.clear();", + " }", + "}", + "", + "class Bezier {", + " constructor(p1, p2, p3, p4) {", + " this.p = [p1, p2, p3, p4];", + " }", + " genValue(t) {", + " const t2 = t * t;", + " const t3 = t * t * t;", + " const mt = 1 - t;", + " const mt2 = mt * mt;", + " const mt3 = mt2 * mt;", + " return this.p[0] * mt3 + this.p[1] * mt2 * t * 3 + this.p[2] * mt * t2 * 3 + this.p[3] * t3;", + " }", + " derivativeCoefficients(points) {", + " const dpoints = [];", + " for (let p = points, c = p.length - 1; c > 0; c--) {", + " const list = [];", + " for (let j = 0; j < c; j++) {", + " const dpt = c * (p[j + 1] - p[j]);", + " list.push(dpt);", + " }", + " dpoints.push(list);", + " p = list;", + " }", + " return dpoints;", + " }", + " getSlope(t) {", + " const p = this.derivativeCoefficients(this.p)[0];", + " const mt = 1 - t;", + " const a = mt * mt;", + " const b = mt * t * 2;", + " const c = t * t;", + " return a * p[0] + b * p[1] + c * p[2];", + " }", + " controlCurve(d0, d1) {", + " this.p[1] = d0 / 3 + this.p[0];", + " this.p[2] = this.p[3] - d1 / 3;", + " }", + " hull(t) {", + " let p = this.p;", + " let _p = [], pt, idx = 0, i = 0, l = 0;", + " const q = [];", + " q[idx++] = p[0];", + " q[idx++] = p[1];", + " q[idx++] = p[2];", + " q[idx++] = p[3];", + " while (p.length > 1) {", + " _p = [];", + " for (i = 0, l = p.length - 1; i < l; i++) {", + " pt = t * p[i] + (1 - t) * p[i + 1];", + " q[idx++] = pt;", + " _p.push(pt);", + " }", + " p = _p;", + " }", + " return q;", + " }", + " split(t) {", + " const q = this.hull(t);", + " const result = {", + " left: new Bezier(q[0], q[4], q[7], q[9]),", + " right: new Bezier(q[9], q[8], q[6], q[3]),", + " span: q", + " };", + " return result;", + " }", + " clone() {", + " return new Bezier(this.p[0], this.p[1], this.p[2], this.p[3]);", + " }", + " toJSON() {", + " return {", + " p0: this.p[0],", + " p1: this.p[1],", + " p2: this.p[2],", + " p3: this.p[3],", + " };", + " }", + " static fromJSON(json) {", + " return new Bezier(json.p0, json.p1, json.p2, json.p3);", + " }", + "}", + "", + "const ColorToJSON = (color) => {", + " return { r: color.x, g: color.y, b: color.z, a: color.w };", + "};", + "const JSONToColor = (json) => {", + " return new THREE.Vector4(json.r, json.g, json.b, json.a);", + "};", + "const JSONToValue = (json, type) => {", + " switch (type) {", + " case 'Vector3':", + " return new THREE.Vector3(json.x, json.y, json.z);", + " case 'Vector4':", + " return new THREE.Vector4(json.x, json.y, json.z, json.w);", + " case 'Color':", + " return new THREE.Vector3(json.r, json.g, json.b);", + " case 'Number':", + " return json;", + " default:", + " return json;", + " }", + "};", + "const ValueToJSON = (value, type) => {", + " switch (type) {", + " case 'Vector3':", + " return { x: value.x, y: value.y, z: value.z };", + " case 'Vector4':", + " return { x: value.x, y: value.y, z: value.z, w: value.w };", + " case 'Color':", + " return { r: value.x, g: value.y, b: value.z };", + " case 'Number':", + " return value;", + " default:", + " return value;", + " }", + "};", + "", + "class RandomColor {", + " constructor(a, b) {", + " this.a = a;", + " this.b = b;", + " this.type = \"value\";", + " }", + " genColor(color) {", + " const rand = Math.random();", + " return color.copy(this.a).lerp(this.b, rand);", + " }", + " toJSON() {", + " return {", + " type: \"RandomColor\",", + " a: ColorToJSON(this.a),", + " b: ColorToJSON(this.b),", + " };", + " }", + " static fromJSON(json) {", + " return new RandomColor(JSONToColor(json.a), JSONToColor(json.b));", + " }", + " clone() {", + " return new RandomColor(this.a.clone(), this.b.clone());", + " }", + "}", + "", + "class ColorRange {", + " constructor(a, b) {", + " this.a = a;", + " this.b = b;", + " this.type = 'value';", + " }", + " genColor(color, t) {", + " return color.copy(this.a).lerp(this.b, Math.random());", + " }", + " toJSON() {", + " return {", + " type: 'ColorRange',", + " a: ColorToJSON(this.a),", + " b: ColorToJSON(this.b),", + " };", + " }", + " static fromJSON(json) {", + " return new ColorRange(JSONToColor(json.a), JSONToColor(json.b));", + " }", + " clone() {", + " return new ColorRange(this.a.clone(), this.b.clone());", + " }", + "}", + "", + "class ContinuousLinearFunction {", + " constructor(keys, subType) {", + " this.subType = subType;", + " this.type = 'function';", + " this.keys = keys;", + " }", + " findKey(t) {", + " let mid = 0;", + " let left = 0, right = this.keys.length - 1;", + " while (left + 1 < right) {", + " mid = Math.floor((left + right) / 2);", + " if (t < this.getStartX(mid))", + " right = mid - 1;", + " else if (t > this.getEndX(mid))", + " left = mid + 1;", + " else", + " return mid;", + " }", + " for (let i = left; i <= right; i++) {", + " if (t >= this.getStartX(i) && t <= this.getEndX(i))", + " return i;", + " }", + " return -1;", + " }", + " getStartX(index) {", + " return this.keys[index][1];", + " }", + " getEndX(index) {", + " if (index + 1 < this.keys.length)", + " return this.keys[index + 1][1];", + " return 1;", + " }", + " genValue(value, t) {", + " const index = this.findKey(t);", + " if (this.subType === 'Number') {", + " if (index === -1) {", + " return this.keys[0][0];", + " }", + " else if (index + 1 >= this.keys.length) {", + " return this.keys[this.keys.length - 1][0];", + " }", + " return ((this.keys[index + 1][0] - this.keys[index][0]) *", + " ((t - this.getStartX(index)) / (this.getEndX(index) - this.getStartX(index))) +", + " this.keys[index][0]);", + " }", + " else {", + " if (index === -1) {", + " return value.copy(this.keys[0][0]);", + " }", + " if (index + 1 >= this.keys.length) {", + " return value.copy(this.keys[this.keys.length - 1][0]);", + " }", + " return value", + " .copy(this.keys[index][0])", + " .lerp(this.keys[index + 1][0], (t - this.getStartX(index)) / (this.getEndX(index) - this.getStartX(index)));", + " }", + " }", + " toJSON() {", + " this.keys[0][0].constructor.name;", + " return {", + " type: 'CLinearFunction',", + " subType: this.subType,", + " keys: this.keys.map(([color, pos]) => ({ value: ValueToJSON(color, this.subType), pos: pos })),", + " };", + " }", + " static fromJSON(json) {", + " return new ContinuousLinearFunction(json.keys.map((pair) => [JSONToValue(pair.value, json.subType), pair.pos]), json.subType);", + " }", + " clone() {", + " if (this.subType === 'Number') {", + " return new ContinuousLinearFunction(this.keys.map(([value, pos]) => [value, pos]), this.subType);", + " }", + " else {", + " return new ContinuousLinearFunction(this.keys.map(([value, pos]) => [value.clone(), pos]), this.subType);", + " }", + " }", + "}", + "", + "const tempVec3 = new THREE.Vector3();", + "class Gradient {", + " constructor(color = [", + " [new THREE.Vector3(0, 0, 0), 0],", + " [new THREE.Vector3(1, 1, 1), 0],", + " ], alpha = [", + " [1, 0],", + " [1, 1],", + " ]) {", + " this.type = 'function';", + " this.color = new ContinuousLinearFunction(color, 'Color');", + " this.alpha = new ContinuousLinearFunction(alpha, 'Number');", + " }", + " genColor(color, t) {", + " this.color.genValue(tempVec3, t);", + " return color.set(tempVec3.x, tempVec3.y, tempVec3.z, this.alpha.genValue(1, t));", + " }", + " toJSON() {", + " return {", + " type: 'Gradient',", + " color: this.color.toJSON(),", + " alpha: this.alpha.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " if (json.functions) {", + " const keys = json.functions.map((func) => [ColorRange.fromJSON(func.function).a, func.start]);", + " if (json.functions.length > 0) {", + " keys.push([ColorRange.fromJSON(json.functions[json.functions.length - 1].function).b, 1]);", + " }", + " return new Gradient(keys.map((key) => [new THREE.Vector3(key[0].x, key[0].y, key[0].z), key[1]]), keys.map((key) => [key[0].w, key[1]]));", + " }", + " else {", + " const gradient = new Gradient();", + " gradient.alpha = ContinuousLinearFunction.fromJSON(json.alpha);", + " gradient.color = ContinuousLinearFunction.fromJSON(json.color);", + " return gradient;", + " }", + " }", + " clone() {", + " const gradient = new Gradient();", + " gradient.alpha = this.alpha.clone();", + " gradient.color = this.color.clone();", + " return gradient;", + " }", + "}", + "", + "const tempColor = new THREE.Vector4();", + "class RandomColorBetweenGradient {", + " constructor(gradient1, gradient2) {", + " this.type = 'memorizedFunction';", + " this.gradient1 = gradient1;", + " this.gradient2 = gradient2;", + " }", + " startGen(memory) {", + " memory.rand = Math.random();", + " }", + " genColor(color, t, memory) {", + " this.gradient1.genColor(color, t);", + " this.gradient2.genColor(tempColor, t);", + " if (memory && memory.rand) {", + " color.lerp(tempColor, memory.rand);", + " }", + " else {", + " color.lerp(tempColor, Math.random());", + " }", + " return color;", + " }", + " toJSON() {", + " return {", + " type: 'RandomColorBetweenGradient',", + " gradient1: this.gradient1.toJSON(),", + " gradient2: this.gradient2.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new RandomColorBetweenGradient(Gradient.fromJSON(json.gradient1), Gradient.fromJSON(json.gradient2));", + " }", + " clone() {", + " return new RandomColorBetweenGradient(this.gradient1.clone(), this.gradient2.clone());", + " }", + "}", + "", + "class ConstantColor {", + " constructor(color) {", + " this.color = color;", + " this.type = 'value';", + " }", + " genColor(color) {", + " return color.copy(this.color);", + " }", + " toJSON() {", + " return {", + " type: 'ConstantColor',", + " color: ColorToJSON(this.color),", + " };", + " }", + " static fromJSON(json) {", + " return new ConstantColor(JSONToColor(json.color));", + " }", + " clone() {", + " return new ConstantColor(this.color.clone());", + " }", + "}", + "function ColorGeneratorFromJSON(json) {", + " switch (json.type) {", + " case 'ConstantColor':", + " return ConstantColor.fromJSON(json);", + " case 'ColorRange':", + " return ColorRange.fromJSON(json);", + " case 'RandomColor':", + " return RandomColor.fromJSON(json);", + " case 'Gradient':", + " return Gradient.fromJSON(json);", + " case 'RandomColorBetweenGradient':", + " return RandomColorBetweenGradient.fromJSON(json);", + " default:", + " return new ConstantColor(new THREE.Vector4(1, 1, 1, 1));", + " }", + "}", + "", + "class ConstantValue {", + " constructor(value) {", + " this.value = value;", + " this.type = 'value';", + " }", + " genValue() {", + " return this.value;", + " }", + " toJSON() {", + " return {", + " type: \"ConstantValue\",", + " value: this.value", + " };", + " }", + " static fromJSON(json) {", + " return new ConstantValue(json.value);", + " }", + " clone() {", + " return new ConstantValue(this.value);", + " }", + "}", + "", + "class IntervalValue {", + " constructor(a, b) {", + " this.a = a;", + " this.b = b;", + " this.type = 'value';", + " }", + " genValue() {", + " return THREE.MathUtils.lerp(this.a, this.b, Math.random());", + " }", + " toJSON() {", + " return {", + " type: 'IntervalValue',", + " a: this.a,", + " b: this.b,", + " };", + " }", + " static fromJSON(json) {", + " return new IntervalValue(json.a, json.b);", + " }", + " clone() {", + " return new IntervalValue(this.a, this.b);", + " }", + "}", + "", + "class PiecewiseFunction {", + " constructor() {", + " this.functions = new Array();", + " }", + " findFunction(t) {", + " let mid = 0;", + " let left = 0, right = this.functions.length - 1;", + " while (left + 1 < right) {", + " mid = Math.floor((left + right) / 2);", + " if (t < this.getStartX(mid))", + " right = mid - 1;", + " else if (t > this.getEndX(mid))", + " left = mid + 1;", + " else", + " return mid;", + " }", + " for (let i = left; i <= right; i++) {", + " if (t >= this.functions[i][1] && t <= this.getEndX(i))", + " return i;", + " }", + " return -1;", + " }", + " getStartX(index) {", + " return this.functions[index][1];", + " }", + " setStartX(index, x) {", + " if (index > 0)", + " this.functions[index][1] = x;", + " }", + " getEndX(index) {", + " if (index + 1 < this.functions.length)", + " return this.functions[index + 1][1];", + " return 1;", + " }", + " setEndX(index, x) {", + " if (index + 1 < this.functions.length)", + " this.functions[index + 1][1] = x;", + " }", + " insertFunction(t, func) {", + " const index = this.findFunction(t);", + " this.functions.splice(index + 1, 0, [func, t]);", + " }", + " removeFunction(index) {", + " return this.functions.splice(index, 1)[0][0];", + " }", + " getFunction(index) {", + " return this.functions[index][0];", + " }", + " setFunction(index, func) {", + " this.functions[index][0] = func;", + " }", + " get numOfFunctions() {", + " return this.functions.length;", + " }", + "}", + "", + "class PiecewiseBezier extends PiecewiseFunction {", + " constructor(curves = [[new Bezier(0, 1.0 / 3, 1.0 / 3 * 2, 1), 0]]) {", + " super();", + " this.type = \"function\";", + " this.functions = curves;", + " }", + " genValue(t = 0) {", + " const index = this.findFunction(t);", + " if (index === -1) {", + " return 0;", + " }", + " return this.functions[index][0].genValue((t - this.getStartX(index)) / (this.getEndX(index) - this.getStartX(index)));", + " }", + " toSVG(length, segments) {", + " if (segments < 1)", + " return \"\";", + " let result = [\"M\", 0, this.functions[0][0].p[0]].join(\" \");", + " for (let i = 1.0 / segments; i <= 1; i += 1.0 / segments) {", + " result = [result, \"L\", i * length, this.genValue(i)].join(\" \");", + " }", + " return result;", + " }", + " toJSON() {", + " return {", + " type: \"PiecewiseBezier\",", + " functions: this.functions.map(([bezier, start]) => ({ function: bezier.toJSON(), start: start })),", + " };", + " }", + " static fromJSON(json) {", + " return new PiecewiseBezier(json.functions.map((piecewiseFunction) => ([Bezier.fromJSON(piecewiseFunction.function), piecewiseFunction.start])));", + " }", + " clone() {", + " return new PiecewiseBezier(this.functions.map(([bezier, start]) => ([bezier.clone(), start])));", + " }", + "}", + "", + "function ValueGeneratorFromJSON(json) {", + " switch (json.type) {", + " case 'ConstantValue':", + " return ConstantValue.fromJSON(json);", + " case 'IntervalValue':", + " return IntervalValue.fromJSON(json);", + " case 'PiecewiseBezier':", + " return PiecewiseBezier.fromJSON(json);", + " default:", + " return new ConstantValue(0);", + " }", + "}", + "", + "class RandomQuatGenerator {", + " constructor() {", + " this.type = \"rotation\";", + " }", + " genValue(quat, t) {", + " let x, y, z, u, v, w;", + " do {", + " x = Math.random() * 2 - 1;", + " y = Math.random() * 2 - 1;", + " z = x * x + y * y;", + " } while (z > 1);", + " do {", + " u = Math.random() * 2 - 1;", + " v = Math.random() * 2 - 1;", + " w = u * u + v * v;", + " } while (w > 1);", + " const s = Math.sqrt((1 - z) / w);", + " quat.set(x, y, s * u, s * v);", + " return quat;", + " }", + " toJSON() {", + " return {", + " type: \"RandomQuat\"", + " };", + " }", + " static fromJSON(json) {", + " return new RandomQuatGenerator();", + " }", + " clone() {", + " return new RandomQuatGenerator();", + " }", + "}", + "", + "class AxisAngleGenerator {", + " constructor(axis, angle) {", + " this.axis = axis;", + " this.angle = angle;", + " this.type = 'rotation';", + " }", + " genValue(quat, t) {", + " return quat.setFromAxisAngle(this.axis, this.angle.genValue(t));", + " }", + " toJSON() {", + " return {", + " type: 'AxisAngle',", + " axis: { x: this.axis.x, y: this.axis.y, z: this.axis.z },", + " angle: this.angle.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new AxisAngleGenerator(new THREE.Vector3(json.axis.x, json.axis.y, json.axis.z), ValueGeneratorFromJSON(json.angle));", + " }", + " clone() {", + " return new AxisAngleGenerator(this.axis.clone(), this.angle.clone());", + " }", + "}", + "", + "class EulerGenerator {", + " constructor(angleX, angleY, angleZ, eulerOrder) {", + " this.angleX = angleX;", + " this.angleY = angleY;", + " this.angleZ = angleZ;", + " this.type = 'rotation';", + " this.eular = new THREE.Euler(0, 0, 0, eulerOrder);", + " }", + " genValue(quat, t) {", + " this.eular.set(this.angleX.genValue(t), this.angleY.genValue(t), this.angleZ.genValue(t));", + " return quat.setFromEuler(this.eular);", + " }", + " toJSON() {", + " return {", + " type: 'Euler',", + " angleX: this.angleX.toJSON(),", + " angleY: this.angleY.toJSON(),", + " angleZ: this.angleZ.toJSON(),", + " eulerOrder: this.eular.order,", + " };", + " }", + " static fromJSON(json) {", + " return new EulerGenerator(ValueGeneratorFromJSON(json.angleX), ValueGeneratorFromJSON(json.angleY), ValueGeneratorFromJSON(json.angleZ), json.eulerOrder);", + " }", + " clone() {", + " return new EulerGenerator(this.angleX, this.angleY, this.angleZ, this.eular.order);", + " }", + "}", + "", + "function RotationGeneratorFromJSON(json) {", + " switch (json.type) {", + " case 'AxisAngle':", + " return AxisAngleGenerator.fromJSON(json);", + " case 'Euler':", + " return EulerGenerator.fromJSON(json);", + " case 'RandomQuat':", + " return RandomQuatGenerator.fromJSON(json);", + " default:", + " return new RandomQuatGenerator();", + " }", + "}", + "", + "function GeneratorFromJSON(json) {", + " switch (json.type) {", + " case 'ConstantValue':", + " case 'IntervalValue':", + " case 'PiecewiseBezier':", + " return ValueGeneratorFromJSON(json);", + " case 'AxisAngle':", + " case 'RandomQuat':", + " case 'Euler':", + " return RotationGeneratorFromJSON(json);", + " default:", + " return new ConstantValue(0);", + " }", + "}", + "", + "class ColorOverLife {", + " constructor(color) {", + " this.color = color;", + " this.type = 'ColorOverLife';", + " }", + " initialize(particle) {", + " if (this.color.type === 'memorizedFunction') {", + " particle.colorOverLifeMemory = {};", + " this.color.startGen(particle.colorOverLifeMemory);", + " }", + " }", + " update(particle, delta) {", + " if (this.color.type === 'memorizedFunction') {", + " this.color.genColor(particle.color, particle.age / particle.life, particle.colorOverLifeMemory);", + " }", + " else {", + " this.color.genColor(particle.color, particle.age / particle.life);", + " }", + " particle.color.x *= particle.startColor.x;", + " particle.color.y *= particle.startColor.y;", + " particle.color.z *= particle.startColor.z;", + " particle.color.w *= particle.startColor.w;", + " }", + " frameUpdate(delta) { }", + " toJSON() {", + " return {", + " type: this.type,", + " color: this.color.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new ColorOverLife(ColorGeneratorFromJSON(json.color));", + " }", + " clone() {", + " return new ColorOverLife(this.color.clone());", + " }", + " reset() { }", + "}", + "", + "class RotationOverLife {", + " constructor(angularVelocity) {", + " this.angularVelocity = angularVelocity;", + " this.type = 'RotationOverLife';", + " this.dynamic = !(angularVelocity instanceof ConstantValue || angularVelocity instanceof IntervalValue);", + " }", + " initialize(particle) {", + " this.dynamic = !(this.angularVelocity instanceof ConstantValue || this.angularVelocity instanceof IntervalValue);", + " if (!this.dynamic && typeof particle.rotation === 'number') {", + " particle.angularVelocity = this.angularVelocity.genValue();", + " }", + " }", + " update(particle, delta) {", + " if (!this.dynamic) {", + " if (typeof particle.rotation === 'number') {", + " particle.rotation += delta * particle.angularVelocity;", + " }", + " }", + " else {", + " if (typeof particle.rotation === 'number') {", + " particle.rotation +=", + " delta * this.angularVelocity.genValue(particle.age / particle.life);", + " }", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " angularVelocity: this.angularVelocity.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new RotationOverLife(ValueGeneratorFromJSON(json.angularVelocity));", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new RotationOverLife(this.angularVelocity.clone());", + " }", + " reset() { }", + "}", + "", + "const IdentityQuaternion = new THREE.Quaternion();", + "class Rotation3DOverLife {", + " constructor(angularVelocity) {", + " this.angularVelocity = angularVelocity;", + " this.type = 'Rotation3DOverLife';", + " this.tempQuat = new THREE.Quaternion();", + " this.dynamic = !(angularVelocity instanceof RandomQuatGenerator);", + " }", + " initialize(particle) {", + " this.dynamic = !(this.angularVelocity instanceof RandomQuatGenerator);", + " if (particle.rotation instanceof THREE.Quaternion) {", + " particle.angularVelocity = new THREE.Quaternion();", + " this.angularVelocity.genValue(particle.angularVelocity);", + " }", + " }", + " update(particle, delta) {", + " if (particle.rotation instanceof THREE.Quaternion) {", + " if (!this.dynamic) {", + " this.tempQuat.slerpQuaternions(IdentityQuaternion, particle.angularVelocity, delta);", + " particle.rotation.multiply(this.tempQuat);", + " }", + " else {", + " this.angularVelocity.genValue(this.tempQuat, particle.age / particle.life);", + " this.tempQuat.slerpQuaternions(IdentityQuaternion, this.tempQuat, delta);", + " particle.rotation.multiply(this.tempQuat);", + " }", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " angularVelocity: this.angularVelocity.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new Rotation3DOverLife(RotationGeneratorFromJSON(json.angularVelocity));", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new Rotation3DOverLife(this.angularVelocity.clone());", + " }", + " reset() { }", + "}", + "", + "class ForceOverLife {", + " initialize(particle) { }", + " constructor(x, y, z) {", + " this.x = x;", + " this.y = y;", + " this.z = z;", + " this.type = 'ForceOverLife';", + " this._temp = new THREE.Vector3();", + " }", + " update(particle, delta) {", + " this._temp.set(this.x.genValue(particle.age / particle.life), this.y.genValue(particle.age / particle.life), this.z.genValue(particle.age / particle.life));", + " particle.velocity.addScaledVector(this._temp, delta);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " x: this.x.toJSON(),", + " y: this.y.toJSON(),", + " z: this.z.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new ForceOverLife(ValueGeneratorFromJSON(json.x), ValueGeneratorFromJSON(json.y), ValueGeneratorFromJSON(json.z));", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new ForceOverLife(this.x.clone(), this.y.clone(), this.z.clone());", + " }", + " reset() { }", + "}", + "", + "class SizeOverLife {", + " initialize(particle) {", + " }", + " constructor(size) {", + " this.size = size;", + " this.type = 'SizeOverLife';", + " }", + " update(particle) {", + " particle.size = particle.startSize * this.size.genValue(particle.age / particle.life);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " size: this.size.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new SizeOverLife(ValueGeneratorFromJSON(json.size));", + " }", + " frameUpdate(delta) {", + " }", + " clone() {", + " return new SizeOverLife(this.size.clone());", + " }", + " reset() {", + " }", + "}", + "", + "class SpeedOverLife {", + " initialize(particle) {", + " }", + " constructor(speed) {", + " this.speed = speed;", + " this.type = 'SpeedOverLife';", + " }", + " update(particle) {", + " particle.speedModifier = this.speed.genValue(particle.age / particle.life);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new SpeedOverLife(ValueGeneratorFromJSON(json.speed));", + " }", + " frameUpdate(delta) {", + " }", + " clone() {", + " return new SpeedOverLife(this.speed.clone());", + " }", + " reset() {", + " }", + "}", + "", + "class FrameOverLife {", + " constructor(frame) {", + " this.frame = frame;", + " this.type = 'FrameOverLife';", + " }", + " initialize(particle) {", + " if (!(this.frame instanceof PiecewiseBezier)) {", + " particle.uvTile = Math.floor(this.frame.genValue(0) + 0.001);", + " }", + " }", + " update(particle, delta) {", + " if (this.frame instanceof PiecewiseBezier) {", + " particle.uvTile = Math.floor(this.frame.genValue(particle.age / particle.life) + 0.001);", + " }", + " }", + " frameUpdate(delta) { }", + " toJSON() {", + " return {", + " type: this.type,", + " frame: this.frame.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new FrameOverLife(ValueGeneratorFromJSON(json.frame));", + " }", + " clone() {", + " return new FrameOverLife(this.frame.clone());", + " }", + " reset() { }", + "}", + "", + "new THREE.Vector3(0, 0, 1);", + "class OrbitOverLife {", + " constructor(orbitSpeed, axis = new THREE.Vector3(0, 1, 0)) {", + " this.orbitSpeed = orbitSpeed;", + " this.axis = axis;", + " this.type = 'OrbitOverLife';", + " this.temp = new THREE.Vector3();", + " this.rotation = new THREE.Quaternion();", + " this.line = new THREE.Line3();", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " this.line.set(new THREE.Vector3(0, 0, 0), this.axis);", + " this.line.closestPointToPoint(particle.position, false, this.temp);", + " this.rotation.setFromAxisAngle(this.axis, this.orbitSpeed.genValue(particle.age / particle.life) * delta);", + " particle.position.sub(this.temp);", + " particle.position.applyQuaternion(this.rotation);", + " particle.position.add(this.temp);", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " orbitSpeed: this.orbitSpeed.toJSON(),", + " axis: [this.axis.x, this.axis.y, this.axis.z],", + " };", + " }", + " static fromJSON(json) {", + " return new OrbitOverLife(ValueGeneratorFromJSON(json.orbitSpeed), json.axis ? new THREE.Vector3(json.axis[0], json.axis[1], json.axis[2]) : undefined);", + " }", + " clone() {", + " return new OrbitOverLife(this.orbitSpeed.clone());", + " }", + " reset() {", + " }", + "}", + "", + "class WidthOverLength {", + " initialize(particle) {", + " }", + " constructor(width) {", + " this.width = width;", + " this.type = 'WidthOverLength';", + " }", + " update(particle) {", + " if (particle instanceof TrailParticle) {", + " const iter = particle.previous.values();", + " for (let i = 0; i < particle.previous.length; i++) {", + " const cur = iter.next();", + " cur.value.size = this.width.genValue((particle.previous.length - i) / particle.length);", + " }", + " }", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " width: this.width.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new WidthOverLength(ValueGeneratorFromJSON(json.width));", + " }", + " clone() {", + " return new WidthOverLength(this.width.clone());", + " }", + " reset() {", + " }", + "}", + "", + "class ApplyForce {", + " constructor(direction, magnitude) {", + " this.direction = direction;", + " this.magnitude = magnitude;", + " this.type = 'ApplyForce';", + " this.magnitudeValue = this.magnitude.genValue();", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " particle.velocity.addScaledVector(this.direction, this.magnitudeValue * delta);", + " }", + " frameUpdate(delta) {", + " this.magnitudeValue = this.magnitude.genValue();", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " direction: [this.direction.x, this.direction.y, this.direction.z],", + " magnitude: this.magnitude.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " var _a;", + " return new ApplyForce(new THREE.Vector3(json.direction[0], json.direction[1], json.direction[2]), ValueGeneratorFromJSON((_a = json.magnitude) !== null && _a !== void 0 ? _a : json.force));", + " }", + " clone() {", + " return new ApplyForce(this.direction.clone(), this.magnitude.clone());", + " }", + " reset() {", + " }", + "}", + "", + "class GravityForce {", + " constructor(center, magnitude) {", + " this.center = center;", + " this.magnitude = magnitude;", + " this.type = 'GravityForce';", + " this.temp = new THREE.Vector3();", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " this.temp.copy(this.center).sub(particle.position).normalize();", + " particle.velocity.addScaledVector(this.temp, this.magnitude / particle.position.distanceToSquared(this.center) * delta);", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " center: [this.center.x, this.center.y, this.center.z],", + " magnitude: this.magnitude,", + " };", + " }", + " static fromJSON(json) {", + " return new GravityForce(new THREE.Vector3(json.center[0], json.center[1], json.center[2]), json.magnitude);", + " }", + " clone() {", + " return new GravityForce(this.center.clone(), this.magnitude);", + " }", + " reset() {", + " }", + "}", + "", + "new THREE.Vector3(0, 0, 1);", + "class ChangeEmitDirection {", + " constructor(angle) {", + " this.angle = angle;", + " this.type = 'ChangeEmitDirection';", + " this._temp = new THREE.Vector3();", + " this._q = new THREE.Quaternion();", + " }", + " initialize(particle) {", + " const len = particle.velocity.length();", + " if (len == 0)", + " return;", + " particle.velocity.normalize();", + " if (particle.velocity.x === 0 && particle.velocity.y === 0) {", + " this._temp.set(0, particle.velocity.z, 0);", + " }", + " else {", + " this._temp.set(-particle.velocity.y, particle.velocity.x, 0);", + " }", + " this._q.setFromAxisAngle(this._temp.normalize(), this.angle.genValue());", + " this._temp.copy(particle.velocity);", + " particle.velocity.applyQuaternion(this._q);", + " this._q.setFromAxisAngle(this._temp, Math.random() * Math.PI * 2);", + " particle.velocity.applyQuaternion(this._q);", + " particle.velocity.setLength(len);", + " }", + " update(particle, delta) {", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " angle: this.angle.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new ChangeEmitDirection(ValueGeneratorFromJSON(json.angle));", + " }", + " clone() {", + " return new ChangeEmitDirection(this.angle);", + " }", + " reset() {", + " }", + "}", + "", + "const VECTOR_ONE = new THREE.Vector3(1, 1, 1);", + "const VECTOR_Z = new THREE.Vector3(0, 0, 1);", + "let SubParticleEmitMode = void 0;", + "(function (SubParticleEmitMode) {", + " SubParticleEmitMode[SubParticleEmitMode[\"Death\"] = 0] = \"Death\";", + " SubParticleEmitMode[SubParticleEmitMode[\"Birth\"] = 1] = \"Birth\";", + " SubParticleEmitMode[SubParticleEmitMode[\"Frame\"] = 2] = \"Frame\";", + "})(SubParticleEmitMode || (SubParticleEmitMode = {}));", + "class EmitSubParticleSystem {", + " constructor(particleSystem, useVelocityAsBasis, subParticleSystem, mode = SubParticleEmitMode.Frame, emitProbability = 1) {", + " this.particleSystem = particleSystem;", + " this.useVelocityAsBasis = useVelocityAsBasis;", + " this.subParticleSystem = subParticleSystem;", + " this.mode = mode;", + " this.emitProbability = emitProbability;", + " this.type = 'EmitSubParticleSystem';", + " this.q_ = new THREE.Quaternion();", + " this.v_ = new THREE.Vector3();", + " this.v2_ = new THREE.Vector3();", + " this.subEmissions = new Array();", + " if (this.subParticleSystem && this.subParticleSystem.system) {", + " this.subParticleSystem.system.onlyUsedByOther = true;", + " }", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " if (this.mode === SubParticleEmitMode.Frame) {", + " this.emit(particle, delta);", + " }", + " else if (this.mode === SubParticleEmitMode.Birth && particle.age === 0) {", + " this.emit(particle, delta);", + " }", + " else if (this.mode === SubParticleEmitMode.Death && particle.age + delta >= particle.life) {", + " this.emit(particle, delta);", + " }", + " }", + " emit(particle, delta) {", + " if (!this.subParticleSystem)", + " return;", + " if (Math.random() > this.emitProbability) {", + " return;", + " }", + " const m = new THREE.Matrix4();", + " this.setMatrixFromParticle(m, particle);", + " this.subEmissions.push({", + " burstIndex: 0,", + " burstWaveIndex: 0,", + " time: 0,", + " waitEmiting: 0,", + " matrix: m,", + " travelDistance: 0,", + " particle: particle,", + " });", + " }", + " frameUpdate(delta) {", + " if (!this.subParticleSystem)", + " return;", + " for (let i = 0; i < this.subEmissions.length; i++) {", + " if (this.subEmissions[i].time >= this.subParticleSystem.system.duration) {", + " this.subEmissions[i] = this.subEmissions[this.subEmissions.length - 1];", + " this.subEmissions.length = this.subEmissions.length - 1;", + " i--;", + " }", + " else {", + " let subEmissionState = this.subEmissions[i];", + " if (subEmissionState.particle && subEmissionState.particle.age < subEmissionState.particle.life) {", + " this.setMatrixFromParticle(subEmissionState.matrix, subEmissionState.particle);", + " }", + " else {", + " subEmissionState.particle = undefined;", + " }", + " this.subParticleSystem.system.emit(delta, subEmissionState, subEmissionState.matrix);", + " }", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " subParticleSystem: this.subParticleSystem ? this.subParticleSystem.uuid : '',", + " useVelocityAsBasis: this.useVelocityAsBasis,", + " mode: this.mode,", + " emitProbability: this.emitProbability,", + " };", + " }", + " static fromJSON(json, particleSystem) {", + " return new EmitSubParticleSystem(particleSystem, json.useVelocityAsBasis, json.subParticleSystem, json.mode, json.emitProbability);", + " }", + " clone() {", + " return new EmitSubParticleSystem(this.particleSystem, this.useVelocityAsBasis, this.subParticleSystem, this.mode, this.emitProbability);", + " }", + " reset() { }", + " setMatrixFromParticle(m, particle) {", + " let rotation;", + " if (particle.rotation === undefined || this.useVelocityAsBasis) {", + " if (particle.velocity.x === 0 &&", + " particle.velocity.y === 0 &&", + " (particle.velocity.z === 1 || particle.velocity.z === 0)) {", + " m.set(1, 0, 0, particle.position.x, 0, 1, 0, particle.position.y, 0, 0, 1, particle.position.z, 0, 0, 0, 1);", + " }", + " else {", + " this.v_.copy(VECTOR_Z).cross(particle.velocity);", + " this.v2_.copy(particle.velocity).cross(this.v_);", + " const len = this.v_.length();", + " const len2 = this.v2_.length();", + " m.set(this.v_.x / len, this.v2_.x / len2, particle.velocity.x, particle.position.x, this.v_.y / len, this.v2_.y / len2, particle.velocity.y, particle.position.y, this.v_.z / len, this.v2_.z / len2, particle.velocity.z, particle.position.z, 0, 0, 0, 1);", + " }", + " }", + " else {", + " if (particle.rotation instanceof THREE.Quaternion) {", + " rotation = particle.rotation;", + " }", + " else {", + " this.q_.setFromAxisAngle(VECTOR_Z, particle.rotation);", + " rotation = this.q_;", + " }", + " m.compose(particle.position, rotation, VECTOR_ONE);", + " }", + " if (!this.particleSystem.worldSpace) {", + " m.multiplyMatrices(this.particleSystem.emitter.matrixWorld, m);", + " }", + " }", + "}", + "", + "const F2 = 0.5 * (Math.sqrt(3.0) - 1.0);", + "const G2 = (3.0 - Math.sqrt(3.0)) / 6.0;", + "const F3 = 1.0 / 3.0;", + "const G3 = 1.0 / 6.0;", + "const F4 = (Math.sqrt(5.0) - 1.0) / 4.0;", + "const G4 = (5.0 - Math.sqrt(5.0)) / 20.0;", + "const grad3 = new Float32Array([1, 1, 0,", + " -1, 1, 0,", + " 1, -1, 0,", + " -1, -1, 0,", + " 1, 0, 1,", + " -1, 0, 1,", + " 1, 0, -1,", + " -1, 0, -1,", + " 0, 1, 1,", + " 0, -1, 1,", + " 0, 1, -1,", + " 0, -1, -1]);", + "const grad4 = new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,", + " 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,", + " 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,", + " -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,", + " 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,", + " -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,", + " 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,", + " -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]);", + "class SimplexNoise {", + " constructor(randomOrSeed = Math.random) {", + " const random = typeof randomOrSeed == 'function' ? randomOrSeed : alea(randomOrSeed);", + " this.p = buildPermutationTable(random);", + " this.perm = new Uint8Array(512);", + " this.permMod12 = new Uint8Array(512);", + " for (let i = 0; i < 512; i++) {", + " this.perm[i] = this.p[i & 255];", + " this.permMod12[i] = this.perm[i] % 12;", + " }", + " }", + " noise2D(x, y) {", + " const permMod12 = this.permMod12;", + " const perm = this.perm;", + " let n0 = 0;", + " let n1 = 0;", + " let n2 = 0;", + " const s = (x + y) * F2;", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const t = (i + j) * G2;", + " const X0 = i - t;", + " const Y0 = j - t;", + " const x0 = x - X0;", + " const y0 = y - Y0;", + " let i1, j1;", + " if (x0 > y0) {", + " i1 = 1;", + " j1 = 0;", + " }", + " else {", + " i1 = 0;", + " j1 = 1;", + " }", + " const x1 = x0 - i1 + G2;", + " const y1 = y0 - j1 + G2;", + " const x2 = x0 - 1.0 + 2.0 * G2;", + " const y2 = y0 - 1.0 + 2.0 * G2;", + " const ii = i & 255;", + " const jj = j & 255;", + " let t0 = 0.5 - x0 * x0 - y0 * y0;", + " if (t0 >= 0) {", + " const gi0 = permMod12[ii + perm[jj]] * 3;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0);", + " }", + " let t1 = 0.5 - x1 * x1 - y1 * y1;", + " if (t1 >= 0) {", + " const gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);", + " }", + " let t2 = 0.5 - x2 * x2 - y2 * y2;", + " if (t2 >= 0) {", + " const gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);", + " }", + " return 70.0 * (n0 + n1 + n2);", + " }", + " noise3D(x, y, z) {", + " const permMod12 = this.permMod12;", + " const perm = this.perm;", + " let n0, n1, n2, n3;", + " const s = (x + y + z) * F3;", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const k = Math.floor(z + s);", + " const t = (i + j + k) * G3;", + " const X0 = i - t;", + " const Y0 = j - t;", + " const Z0 = k - t;", + " const x0 = x - X0;", + " const y0 = y - Y0;", + " const z0 = z - Z0;", + " let i1, j1, k1;", + " let i2, j2, k2;", + " if (x0 >= y0) {", + " if (y0 >= z0) {", + " i1 = 1;", + " j1 = 0;", + " k1 = 0;", + " i2 = 1;", + " j2 = 1;", + " k2 = 0;", + " }", + " else if (x0 >= z0) {", + " i1 = 1;", + " j1 = 0;", + " k1 = 0;", + " i2 = 1;", + " j2 = 0;", + " k2 = 1;", + " }", + " else {", + " i1 = 0;", + " j1 = 0;", + " k1 = 1;", + " i2 = 1;", + " j2 = 0;", + " k2 = 1;", + " }", + " }", + " else {", + " if (y0 < z0) {", + " i1 = 0;", + " j1 = 0;", + " k1 = 1;", + " i2 = 0;", + " j2 = 1;", + " k2 = 1;", + " }", + " else if (x0 < z0) {", + " i1 = 0;", + " j1 = 1;", + " k1 = 0;", + " i2 = 0;", + " j2 = 1;", + " k2 = 1;", + " }", + " else {", + " i1 = 0;", + " j1 = 1;", + " k1 = 0;", + " i2 = 1;", + " j2 = 1;", + " k2 = 0;", + " }", + " }", + " const x1 = x0 - i1 + G3;", + " const y1 = y0 - j1 + G3;", + " const z1 = z0 - k1 + G3;", + " const x2 = x0 - i2 + 2.0 * G3;", + " const y2 = y0 - j2 + 2.0 * G3;", + " const z2 = z0 - k2 + 2.0 * G3;", + " const x3 = x0 - 1.0 + 3.0 * G3;", + " const y3 = y0 - 1.0 + 3.0 * G3;", + " const z3 = z0 - 1.0 + 3.0 * G3;", + " const ii = i & 255;", + " const jj = j & 255;", + " const kk = k & 255;", + " let t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0;", + " if (t0 < 0)", + " n0 = 0.0;", + " else {", + " const gi0 = permMod12[ii + perm[jj + perm[kk]]] * 3;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0 + grad3[gi0 + 2] * z0);", + " }", + " let t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1;", + " if (t1 < 0)", + " n1 = 0.0;", + " else {", + " const gi1 = permMod12[ii + i1 + perm[jj + j1 + perm[kk + k1]]] * 3;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1 + grad3[gi1 + 2] * z1);", + " }", + " let t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2;", + " if (t2 < 0)", + " n2 = 0.0;", + " else {", + " const gi2 = permMod12[ii + i2 + perm[jj + j2 + perm[kk + k2]]] * 3;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2 + grad3[gi2 + 2] * z2);", + " }", + " let t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3;", + " if (t3 < 0)", + " n3 = 0.0;", + " else {", + " const gi3 = permMod12[ii + 1 + perm[jj + 1 + perm[kk + 1]]] * 3;", + " t3 *= t3;", + " n3 = t3 * t3 * (grad3[gi3] * x3 + grad3[gi3 + 1] * y3 + grad3[gi3 + 2] * z3);", + " }", + " return 32.0 * (n0 + n1 + n2 + n3);", + " }", + " noise4D(x, y, z, w) {", + " const perm = this.perm;", + " let n0, n1, n2, n3, n4;", + " const s = (x + y + z + w) * F4;", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const k = Math.floor(z + s);", + " const l = Math.floor(w + s);", + " const t = (i + j + k + l) * G4;", + " const X0 = i - t;", + " const Y0 = j - t;", + " const Z0 = k - t;", + " const W0 = l - t;", + " const x0 = x - X0;", + " const y0 = y - Y0;", + " const z0 = z - Z0;", + " const w0 = w - W0;", + " let rankx = 0;", + " let ranky = 0;", + " let rankz = 0;", + " let rankw = 0;", + " if (x0 > y0)", + " rankx++;", + " else", + " ranky++;", + " if (x0 > z0)", + " rankx++;", + " else", + " rankz++;", + " if (x0 > w0)", + " rankx++;", + " else", + " rankw++;", + " if (y0 > z0)", + " ranky++;", + " else", + " rankz++;", + " if (y0 > w0)", + " ranky++;", + " else", + " rankw++;", + " if (z0 > w0)", + " rankz++;", + " else", + " rankw++;", + " const i1 = rankx >= 3 ? 1 : 0;", + " const j1 = ranky >= 3 ? 1 : 0;", + " const k1 = rankz >= 3 ? 1 : 0;", + " const l1 = rankw >= 3 ? 1 : 0;", + " const i2 = rankx >= 2 ? 1 : 0;", + " const j2 = ranky >= 2 ? 1 : 0;", + " const k2 = rankz >= 2 ? 1 : 0;", + " const l2 = rankw >= 2 ? 1 : 0;", + " const i3 = rankx >= 1 ? 1 : 0;", + " const j3 = ranky >= 1 ? 1 : 0;", + " const k3 = rankz >= 1 ? 1 : 0;", + " const l3 = rankw >= 1 ? 1 : 0;", + " const x1 = x0 - i1 + G4;", + " const y1 = y0 - j1 + G4;", + " const z1 = z0 - k1 + G4;", + " const w1 = w0 - l1 + G4;", + " const x2 = x0 - i2 + 2.0 * G4;", + " const y2 = y0 - j2 + 2.0 * G4;", + " const z2 = z0 - k2 + 2.0 * G4;", + " const w2 = w0 - l2 + 2.0 * G4;", + " const x3 = x0 - i3 + 3.0 * G4;", + " const y3 = y0 - j3 + 3.0 * G4;", + " const z3 = z0 - k3 + 3.0 * G4;", + " const w3 = w0 - l3 + 3.0 * G4;", + " const x4 = x0 - 1.0 + 4.0 * G4;", + " const y4 = y0 - 1.0 + 4.0 * G4;", + " const z4 = z0 - 1.0 + 4.0 * G4;", + " const w4 = w0 - 1.0 + 4.0 * G4;", + " const ii = i & 255;", + " const jj = j & 255;", + " const kk = k & 255;", + " const ll = l & 255;", + " let t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;", + " if (t0 < 0)", + " n0 = 0.0;", + " else {", + " const gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);", + " }", + " let t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;", + " if (t1 < 0)", + " n1 = 0.0;", + " else {", + " const gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);", + " }", + " let t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;", + " if (t2 < 0)", + " n2 = 0.0;", + " else {", + " const gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);", + " }", + " let t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;", + " if (t3 < 0)", + " n3 = 0.0;", + " else {", + " const gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;", + " t3 *= t3;", + " n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);", + " }", + " let t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;", + " if (t4 < 0)", + " n4 = 0.0;", + " else {", + " const gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;", + " t4 *= t4;", + " n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);", + " }", + " return 27.0 * (n0 + n1 + n2 + n3 + n4);", + " }", + "}", + "function buildPermutationTable(random) {", + " const p = new Uint8Array(256);", + " for (let i = 0; i < 256; i++) {", + " p[i] = i;", + " }", + " for (let i = 0; i < 255; i++) {", + " const r = i + ~~(random() * (256 - i));", + " const aux = p[i];", + " p[i] = p[r];", + " p[r] = aux;", + " }", + " return p;", + "}", + "function alea(seed) {", + " let s0 = 0;", + " let s1 = 0;", + " let s2 = 0;", + " let c = 1;", + " const mash = masher();", + " s0 = mash(' ');", + " s1 = mash(' ');", + " s2 = mash(' ');", + " s0 -= mash(seed);", + " if (s0 < 0) {", + " s0 += 1;", + " }", + " s1 -= mash(seed);", + " if (s1 < 0) {", + " s1 += 1;", + " }", + " s2 -= mash(seed);", + " if (s2 < 0) {", + " s2 += 1;", + " }", + " return function () {", + " const t = 2091639 * s0 + c * 2.3283064365386963e-10;", + " s0 = s1;", + " s1 = s2;", + " return s2 = t - (c = t | 0);", + " };", + "}", + "function masher() {", + " let n = 0xefc8249d;", + " return function (data) {", + " data = data.toString();", + " for (let i = 0; i < data.length; i++) {", + " n += data.charCodeAt(i);", + " let h = 0.02519603282416938 * n;", + " n = h >>> 0;", + " h -= n;", + " h *= n;", + " n = h >>> 0;", + " h -= n;", + " n += h * 0x100000000;", + " }", + " return (n >>> 0) * 2.3283064365386963e-10;", + " };", + "}", + "", + "class TurbulenceField {", + " constructor(scale, octaves, velocityMultiplier, timeScale) {", + " this.scale = scale;", + " this.octaves = octaves;", + " this.velocityMultiplier = velocityMultiplier;", + " this.timeScale = timeScale;", + " this.type = 'TurbulenceField';", + " this.generator = new SimplexNoise();", + " this.timeOffset = new THREE.Vector3();", + " this.temp = new THREE.Vector3();", + " this.temp2 = new THREE.Vector3();", + " this.timeOffset.x = Math.random() / this.scale.x * this.timeScale.x;", + " this.timeOffset.y = Math.random() / this.scale.y * this.timeScale.y;", + " this.timeOffset.z = Math.random() / this.scale.z * this.timeScale.z;", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " const x = particle.position.x / this.scale.x;", + " const y = particle.position.y / this.scale.y;", + " const z = particle.position.z / this.scale.z;", + " this.temp.set(0, 0, 0);", + " let lvl = 1;", + " for (let i = 0; i < this.octaves; i++) {", + " this.temp2.set(this.generator.noise4D(x * lvl, y * lvl, z * lvl, this.timeOffset.x * lvl) / lvl, this.generator.noise4D(x * lvl, y * lvl, z * lvl, this.timeOffset.y * lvl) / lvl, this.generator.noise4D(x * lvl, y * lvl, z * lvl, this.timeOffset.z * lvl) / lvl);", + " this.temp.add(this.temp2);", + " lvl *= 2;", + " }", + " this.temp.multiply(this.velocityMultiplier);", + " particle.velocity.addScaledVector(this.temp, delta);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " scale: [this.scale.x, this.scale.y, this.scale.z],", + " octaves: this.octaves,", + " velocityMultiplier: [this.velocityMultiplier.x, this.velocityMultiplier.y, this.velocityMultiplier.z],", + " timeScale: [this.timeScale.x, this.timeScale.y, this.timeScale.z],", + " };", + " }", + " frameUpdate(delta) {", + " this.timeOffset.x += delta * this.timeScale.x;", + " this.timeOffset.y += delta * this.timeScale.y;", + " this.timeOffset.z += delta * this.timeScale.z;", + " }", + " static fromJSON(json) {", + " return new TurbulenceField(new THREE.Vector3(json.scale[0], json.scale[1], json.scale[2]), json.octaves, new THREE.Vector3(json.velocityMultiplier[0], json.velocityMultiplier[1], json.velocityMultiplier[2]), new THREE.Vector3(json.timeScale[0], json.timeScale[1], json.timeScale[2]));", + " }", + " clone() {", + " return new TurbulenceField(this.scale.clone(), this.octaves, this.velocityMultiplier.clone(), this.timeScale.clone());", + " }", + " reset() {", + " }", + "}", + "", + "function randomInt(a, b) {", + " return Math.floor(Math.random() * (b - a)) + a;", + "}", + "", + "const generators = [];", + "const tempV$2 = new THREE.Vector3();", + "const tempQ$2 = new THREE.Quaternion();", + "class Noise {", + " constructor(frequency, power, positionAmount = new ConstantValue(1), rotationAmount = new ConstantValue(0)) {", + " this.frequency = frequency;", + " this.power = power;", + " this.positionAmount = positionAmount;", + " this.rotationAmount = rotationAmount;", + " this.type = 'Noise';", + " this.duration = 0;", + " if (generators.length === 0) {", + " for (let i = 0; i < 100; i++) {", + " generators.push(new SimplexNoise());", + " }", + " }", + " }", + " initialize(particle) {", + " particle.lastPosNoise = new THREE.Vector3();", + " if (typeof particle.rotation === 'number') {", + " particle.lastRotNoise = 0;", + " }", + " else {", + " particle.lastRotNoise = new THREE.Quaternion();", + " }", + " particle.generatorIndex = [randomInt(0, 100), randomInt(0, 100), randomInt(0, 100), randomInt(0, 100)];", + " }", + " update(particle, _) {", + " let frequency = this.frequency.genValue(particle.age / particle.life);", + " let power = this.power.genValue(particle.age / particle.life);", + " let positionAmount = this.positionAmount.genValue(particle.age / particle.life);", + " let rotationAmount = this.rotationAmount.genValue(particle.age / particle.life);", + " if (positionAmount > 0 && particle.lastPosNoise !== undefined) {", + " particle.position.sub(particle.lastPosNoise);", + " tempV$2.set(generators[particle.generatorIndex[0]].noise2D(0, particle.age * frequency) *", + " power *", + " positionAmount, generators[particle.generatorIndex[1]].noise2D(0, particle.age * frequency) *", + " power *", + " positionAmount, generators[particle.generatorIndex[2]].noise2D(0, particle.age * frequency) *", + " power *", + " positionAmount);", + " particle.position.add(tempV$2);", + " particle.lastPosNoise.copy(tempV$2);", + " }", + " if (rotationAmount > 0 && particle.lastRotNoise !== undefined) {", + " if (typeof particle.rotation === 'number') {", + " particle.rotation -= particle.lastRotNoise;", + " particle.rotation +=", + " generators[particle.generatorIndex[3]].noise2D(0, particle.age * frequency) *", + " Math.PI *", + " power *", + " rotationAmount;", + " }", + " else {", + " particle.lastRotNoise.invert();", + " particle.rotation.multiply(particle.lastRotNoise);", + " tempQ$2", + " .set(generators[particle.generatorIndex[0]].noise2D(0, particle.age * frequency) *", + " power *", + " rotationAmount, generators[particle.generatorIndex[1]].noise2D(0, particle.age * frequency) *", + " power *", + " rotationAmount, generators[particle.generatorIndex[2]].noise2D(0, particle.age * frequency) *", + " power *", + " rotationAmount, generators[particle.generatorIndex[3]].noise2D(0, particle.age * frequency) *", + " power *", + " rotationAmount)", + " .normalize();", + " particle.rotation.multiply(tempQ$2);", + " particle.lastRotNoise.copy(tempQ$2);", + " }", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " frequency: this.frequency.toJSON(),", + " power: this.power.toJSON(),", + " positionAmount: this.positionAmount.toJSON(),", + " rotationAmount: this.rotationAmount.toJSON(),", + " };", + " }", + " frameUpdate(delta) {", + " this.duration += delta;", + " }", + " static fromJSON(json) {", + " return new Noise(ValueGeneratorFromJSON(json.frequency), ValueGeneratorFromJSON(json.power), ValueGeneratorFromJSON(json.positionAmount), ValueGeneratorFromJSON(json.rotationAmount));", + " }", + " clone() {", + " return new Noise(this.frequency.clone(), this.power.clone(), this.positionAmount.clone(), this.rotationAmount.clone());", + " }", + " reset() { }", + "}", + "", + "class TextureSequencer {", + " constructor(scaleX = 0, scaleY = 0, position = new THREE.Vector3()) {", + " this.scaleX = scaleX;", + " this.scaleY = scaleY;", + " this.position = position;", + " this.locations = [];", + " }", + " transform(position, index) {", + " position.x = this.locations[index % this.locations.length].x * this.scaleX + this.position.x;", + " position.y = this.locations[index % this.locations.length].y * this.scaleY + this.position.y;", + " position.z = this.position.z;", + " }", + " static fromJSON(json) {", + " const textureSequencer = new TextureSequencer(json.scaleX, json.scaleY, new THREE.Vector3(json.position[0], json.position[1], json.position[2]));", + " textureSequencer.locations = json.locations.map((loc) => new THREE.Vector2(loc.x, loc.y));", + " return textureSequencer;", + " }", + " clone() {", + " const textureSequencer = new TextureSequencer(this.scaleX, this.scaleY, this.position.clone());", + " textureSequencer.locations = this.locations.map(loc => loc.clone());", + " return textureSequencer;", + " }", + " toJSON() {", + " return {", + " scaleX: this.scaleX,", + " scaleY: this.scaleY,", + " position: this.position,", + " locations: this.locations.map(loc => ({", + " x: loc.x,", + " y: loc.y,", + " }))", + " };", + " }", + " fromImage(img, threshold) {", + " const canvas = document.createElement(\"canvas\");", + " canvas.width = img.width;", + " canvas.height = img.height;", + " const ctx = canvas.getContext(\"2d\");", + " if (!ctx) {", + " return;", + " }", + " ctx.drawImage(img, 0, 0);", + " const data = ctx.getImageData(0, 0, canvas.width, canvas.height, { colorSpace: \"srgb\" });", + " canvas.remove();", + " this.locations.length = 0;", + " for (let i = 0; i < data.height; i++) {", + " for (let j = 0; j < data.width; j++) {", + " if (data.data[(i * data.width + j) * 4 + 3] > threshold) {", + " this.locations.push(new THREE.Vector2(j, data.height - i));", + " }", + " }", + " }", + " }", + "}", + "", + "function SequencerFromJSON(json) {", + " switch (json.type) {", + " case 'TextureSequencer':", + " return TextureSequencer.fromJSON(json);", + " default:", + " return new TextureSequencer();", + " }", + "}", + "", + "class ApplySequences {", + " constructor(delayBetweenParticles) {", + " this.type = 'ApplySequences';", + " this.sequencers = [];", + " this.time = 0;", + " this.index = 0;", + " this.pCount = 0;", + " this.tempV = new THREE.Vector3();", + " this.delay = delayBetweenParticles;", + " }", + " initialize(particle) {", + " particle.id = this.pCount;", + " particle.dst = new THREE.Vector3();", + " particle.begin = new THREE.Vector3();", + " particle.inMotion = false;", + " this.pCount++;", + " }", + " reset() {", + " this.time = 0;", + " this.index = 0;", + " this.pCount = 0;", + " }", + " update(particle, delta) {", + " const sequencer = this.sequencers[this.index];", + " const delay = particle.id * this.delay;", + " if (this.time >= sequencer[0].a + delay && this.time <= sequencer[0].b + delay) {", + " if (!particle.inMotion) {", + " particle.inMotion = true;", + " particle.begin.copy(particle.position);", + " sequencer[1].transform(particle.dst, particle.id);", + " }", + " particle.position.lerpVectors(particle.begin, particle.dst, ApplySequences.BEZIER.genValue((this.time - sequencer[0].a - delay) / (sequencer[0].b - sequencer[0].a)));", + " }", + " else if (this.time > sequencer[0].b + delay) {", + " particle.inMotion = false;", + " }", + " }", + " frameUpdate(delta) {", + " while (this.index + 1 < this.sequencers.length && this.time >= this.sequencers[this.index + 1][0].a) {", + " this.index++;", + " }", + " this.time += delta;", + " }", + " appendSequencer(range, sequencer) {", + " this.sequencers.push([range, sequencer]);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " delay: this.delay,", + " sequencers: this.sequencers.map(([range, sequencer]) => ({", + " range: range.toJSON(),", + " sequencer: sequencer.toJSON(),", + " })),", + " };", + " }", + " static fromJSON(json) {", + " const seq = new ApplySequences(json.delay);", + " json.sequencers.forEach((sequencerJson) => {", + " seq.sequencers.push([ValueGeneratorFromJSON(sequencerJson.range), SequencerFromJSON(sequencerJson.sequencer)]);", + " });", + " return seq;", + " }", + " clone() {", + " const applySequences = new ApplySequences(this.delay);", + " applySequences.sequencers = this.sequencers.map(seq => [seq[0].clone(), seq[1].clone()]);", + " return applySequences;", + " }", + "}", + "ApplySequences.BEZIER = new Bezier(0, 0, 1, 1);", + "", + "let physicsResolver;", + "function setPhysicsResolver(resolver) {", + " physicsResolver = resolver;", + "}", + "function getPhysicsResolver() {", + " return physicsResolver;", + "}", + "class ApplyCollision {", + " constructor(resolver, bounce) {", + " this.resolver = resolver;", + " this.bounce = bounce;", + " this.type = 'ApplyCollision';", + " this.tempV = new THREE.Vector3();", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " if (this.resolver.resolve(particle.position, this.tempV)) {", + " particle.velocity.reflect(this.tempV).multiplyScalar(this.bounce);", + " }", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " bounce: this.bounce,", + " };", + " }", + " static fromJSON(json) {", + " return new ApplyCollision(getPhysicsResolver(), json.bounce);", + " }", + " clone() {", + " return new ApplyCollision(this.resolver, this.bounce);", + " }", + " reset() {", + " }", + "}", + "", + "class ColorBySpeed {", + " constructor(color, speedRange) {", + " this.color = color;", + " this.speedRange = speedRange;", + " this.type = 'ColorBySpeed';", + " }", + " initialize(particle) {", + " if (this.color.type === 'memorizedFunction') {", + " particle.colorOverLifeMemory = {};", + " this.color.startGen(particle.colorOverLifeMemory);", + " }", + " }", + " update(particle, delta) {", + " const t = (particle.startSpeed - this.speedRange.a) / (this.speedRange.b - this.speedRange.a);", + " if (this.color.type === 'memorizedFunction') {", + " this.color.genColor(particle.color, t, particle.colorOverLifeMemory);", + " }", + " else {", + " this.color.genColor(particle.color, t);", + " }", + " particle.color.x *= particle.startColor.x;", + " particle.color.y *= particle.startColor.y;", + " particle.color.z *= particle.startColor.z;", + " particle.color.w *= particle.startColor.w;", + " }", + " frameUpdate(delta) { }", + " toJSON() {", + " return {", + " type: this.type,", + " color: this.color.toJSON(),", + " speedRange: this.speedRange.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new ColorBySpeed(ColorGeneratorFromJSON(json.color), IntervalValue.fromJSON(json.speedRange));", + " }", + " clone() {", + " return new ColorBySpeed(this.color.clone(), this.speedRange.clone());", + " }", + " reset() { }", + "}", + "", + "class SizeBySpeed {", + " initialize(particle) { }", + " constructor(size, speedRange) {", + " this.size = size;", + " this.speedRange = speedRange;", + " this.type = 'SizeBySpeed';", + " }", + " update(particle) {", + " const t = (particle.startSpeed - this.speedRange.a) / (this.speedRange.b - this.speedRange.a);", + " particle.size = particle.startSize * this.size.genValue(t);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " size: this.size.toJSON(),", + " speedRange: this.speedRange.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new SizeBySpeed(ValueGeneratorFromJSON(json.size), IntervalValue.fromJSON(json.speedRange));", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new SizeBySpeed(this.size.clone(), this.speedRange.clone());", + " }", + " reset() { }", + "}", + "", + "class RotationBySpeed {", + " constructor(angularVelocity, speedRange) {", + " this.angularVelocity = angularVelocity;", + " this.speedRange = speedRange;", + " this.type = 'RotationBySpeed';", + " this.tempQuat = new THREE.Quaternion();", + " }", + " initialize(particle) { }", + " update(particle, delta) {", + " const t = (particle.startSpeed - this.speedRange.a) / (this.speedRange.b - this.speedRange.a);", + " particle.rotation += delta * this.angularVelocity.genValue(t);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " angularVelocity: this.angularVelocity.toJSON(),", + " speedRange: this.speedRange.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new RotationBySpeed(ValueGeneratorFromJSON(json.angularVelocity), IntervalValue.fromJSON(json.speedRange));", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new RotationBySpeed(this.angularVelocity.clone(), this.speedRange.clone());", + " }", + " reset() { }", + "}", + "", + "class LimitSpeedOverLife {", + " initialize(particle) { }", + " constructor(speed, dampen) {", + " this.speed = speed;", + " this.dampen = dampen;", + " this.type = 'LimitSpeedOverLife';", + " }", + " update(particle, delta) {", + " let speed = particle.velocity.length();", + " let limit = this.speed.genValue(particle.age / particle.life);", + " if (speed > limit) {", + " const percent = (speed - limit) / speed;", + " particle.velocity.multiplyScalar(1 - percent * this.dampen * delta * 20);", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " speed: this.speed.toJSON(),", + " dampen: this.dampen,", + " };", + " }", + " static fromJSON(json) {", + " return new LimitSpeedOverLife(ValueGeneratorFromJSON(json.speed), json.dampen);", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new LimitSpeedOverLife(this.speed.clone(), this.dampen);", + " }", + " reset() { }", + "}", + "", + "const BehaviorTypes = {", + " ApplyForce: {", + " type: 'ApplyForce',", + " constructor: ApplyForce,", + " params: [", + " ['direction', 'vec3'],", + " ['magnitude', 'value'],", + " ],", + " loadJSON: ApplyForce.fromJSON,", + " },", + " Noise: {", + " type: 'Noise',", + " constructor: Noise,", + " params: [", + " ['frequency', 'value'],", + " ['power', 'value'],", + " ['positionAmount', 'value'],", + " ['rotationAmount', 'value'],", + " ],", + " loadJSON: Noise.fromJSON,", + " },", + " TurbulenceField: {", + " type: 'TurbulenceField',", + " constructor: TurbulenceField,", + " params: [", + " ['scale', 'vec3'],", + " ['octaves', 'number'],", + " ['velocityMultiplier', 'vec3'],", + " ['timeScale', 'vec3'],", + " ],", + " loadJSON: TurbulenceField.fromJSON,", + " },", + " GravityForce: {", + " type: 'GravityForce',", + " constructor: GravityForce,", + " params: [", + " ['center', 'vec3'],", + " ['magnitude', 'number'],", + " ],", + " loadJSON: GravityForce.fromJSON,", + " },", + " ColorOverLife: {", + " type: 'ColorOverLife',", + " constructor: ColorOverLife,", + " params: [['color', 'colorFunc']],", + " loadJSON: ColorOverLife.fromJSON,", + " },", + " RotationOverLife: {", + " type: 'RotationOverLife',", + " constructor: RotationOverLife,", + " params: [['angularVelocity', 'valueFunc']],", + " loadJSON: RotationOverLife.fromJSON,", + " },", + " Rotation3DOverLife: {", + " type: 'Rotation3DOverLife',", + " constructor: Rotation3DOverLife,", + " params: [['angularVelocity', 'rotationFunc']],", + " loadJSON: Rotation3DOverLife.fromJSON,", + " },", + " SizeOverLife: {", + " type: 'SizeOverLife',", + " constructor: SizeOverLife,", + " params: [['size', 'valueFunc']],", + " loadJSON: SizeOverLife.fromJSON,", + " },", + " ColorBySpeed: {", + " type: 'ColorBySpeed',", + " constructor: ColorBySpeed,", + " params: [", + " ['color', 'colorFunc'],", + " ['speedRange', 'range'],", + " ],", + " loadJSON: ColorBySpeed.fromJSON,", + " },", + " RotationBySpeed: {", + " type: 'RotationBySpeed',", + " constructor: RotationBySpeed,", + " params: [", + " ['angularVelocity', 'valueFunc'],", + " ['speedRange', 'range'],", + " ],", + " loadJSON: RotationBySpeed.fromJSON,", + " },", + " SizeBySpeed: {", + " type: 'SizeBySpeed',", + " constructor: SizeBySpeed,", + " params: [", + " ['size', 'valueFunc'],", + " ['speedRange', 'range'],", + " ],", + " loadJSON: SizeBySpeed.fromJSON,", + " },", + " SpeedOverLife: {", + " type: 'SpeedOverLife',", + " constructor: SpeedOverLife,", + " params: [['speed', 'valueFunc']],", + " loadJSON: SpeedOverLife.fromJSON,", + " },", + " FrameOverLife: {", + " type: 'FrameOverLife',", + " constructor: FrameOverLife,", + " params: [['frame', 'valueFunc']],", + " loadJSON: FrameOverLife.fromJSON,", + " },", + " ForceOverLife: {", + " type: 'ForceOverLife',", + " constructor: ForceOverLife,", + " params: [", + " ['x', 'valueFunc'],", + " ['y', 'valueFunc'],", + " ['z', 'valueFunc'],", + " ],", + " loadJSON: ForceOverLife.fromJSON,", + " },", + " OrbitOverLife: {", + " type: 'OrbitOverLife',", + " constructor: OrbitOverLife,", + " params: [", + " ['orbitSpeed', 'valueFunc'],", + " ['axis', 'vec3'],", + " ],", + " loadJSON: OrbitOverLife.fromJSON,", + " },", + " WidthOverLength: {", + " type: 'WidthOverLength',", + " constructor: WidthOverLength,", + " params: [['width', 'valueFunc']],", + " loadJSON: WidthOverLength.fromJSON,", + " },", + " ChangeEmitDirection: {", + " type: 'ChangeEmitDirection',", + " constructor: ChangeEmitDirection,", + " params: [['angle', 'value']],", + " loadJSON: ChangeEmitDirection.fromJSON,", + " },", + " EmitSubParticleSystem: {", + " type: 'EmitSubParticleSystem',", + " constructor: EmitSubParticleSystem,", + " params: [", + " ['particleSystem', 'self'],", + " ['useVelocityAsBasis', 'boolean'],", + " ['subParticleSystem', 'particleSystem'],", + " ['mode', 'number'],", + " ['emitProbability', 'number'],", + " ],", + " loadJSON: EmitSubParticleSystem.fromJSON,", + " },", + " LimitSpeedOverLife: {", + " type: 'LimitSpeedOverLife',", + " constructor: LimitSpeedOverLife,", + " params: [", + " ['speed', 'valueFunc'],", + " ['dampen', 'number'],", + " ],", + " loadJSON: LimitSpeedOverLife.fromJSON,", + " },", + "};", + "function BehaviorFromJSON(json, particleSystem) {", + " return BehaviorTypes[json.type].loadJSON(json, particleSystem);", + "}", + "", + "let EmitterMode = void 0;", + "(function (EmitterMode) {", + " EmitterMode[EmitterMode[\"Random\"] = 0] = \"Random\";", + " EmitterMode[EmitterMode[\"Loop\"] = 1] = \"Loop\";", + " EmitterMode[EmitterMode[\"PingPong\"] = 2] = \"PingPong\";", + " EmitterMode[EmitterMode[\"Burst\"] = 3] = \"Burst\";", + "})(EmitterMode || (EmitterMode = {}));", + "function getValueFromEmitterMode(mode, currentValue, spread) {", + " let u;", + " if (EmitterMode.Random === mode) {", + " currentValue = Math.random();", + " }", + " if (spread > 0) {", + " u = Math.floor(currentValue / spread) * spread;", + " }", + " else {", + " u = currentValue;", + " }", + " switch (mode) {", + " case EmitterMode.Loop:", + " u = u % 1;", + " break;", + " case EmitterMode.PingPong:", + " u = Math.abs((u % 2) - 1);", + " break;", + " }", + " return u;", + "}", + "", + "class ConeEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d, _e, _f, _g;", + " this.type = 'cone';", + " this.currentValue = 0;", + " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", + " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", + " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", + " this.angle = (_d = parameters.angle) !== null && _d !== void 0 ? _d : Math.PI / 6;", + " this.mode = (_e = parameters.mode) !== null && _e !== void 0 ? _e : EmitterMode.Random;", + " this.spread = (_f = parameters.spread) !== null && _f !== void 0 ? _f : 0;", + " this.speed = (_g = parameters.speed) !== null && _g !== void 0 ? _g : new ConstantValue(1);", + " }", + " update(system, delta) {", + " if (EmitterMode.Random != this.mode) {", + " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", + " }", + " }", + " initialize(p) {", + " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", + " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", + " const theta = u * this.arc;", + " const r = Math.sqrt(rand);", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " p.position.x = r * cosTheta;", + " p.position.y = r * sinTheta;", + " p.position.z = 0;", + " const angle = this.angle * r;", + " p.velocity.set(0, 0, Math.cos(angle)).addScaledVector(p.position, Math.sin(angle)).multiplyScalar(p.startSpeed);", + " p.position.multiplyScalar(this.radius);", + " }", + " toJSON() {", + " return {", + " type: 'cone',", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " angle: this.angle,", + " mode: this.mode,", + " spread: this.spread,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new ConeEmitter({", + " radius: json.radius,", + " arc: json.arc,", + " thickness: json.thickness,", + " angle: json.angle,", + " mode: json.mode,", + " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", + " spread: json.spread,", + " });", + " }", + " clone() {", + " return new ConeEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " angle: this.angle,", + " mode: this.mode,", + " speed: this.speed.clone(),", + " spread: this.spread,", + " });", + " }", + "}", + "", + "class CircleEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d, _e, _f;", + " this.type = 'circle';", + " this.currentValue = 0;", + " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", + " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", + " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", + " this.mode = (_d = parameters.mode) !== null && _d !== void 0 ? _d : EmitterMode.Random;", + " this.spread = (_e = parameters.spread) !== null && _e !== void 0 ? _e : 0;", + " this.speed = (_f = parameters.speed) !== null && _f !== void 0 ? _f : new ConstantValue(1);", + " }", + " update(system, delta) {", + " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", + " }", + " initialize(p) {", + " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", + " const r = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", + " const theta = u * this.arc;", + " p.position.x = Math.cos(theta);", + " p.position.y = Math.sin(theta);", + " p.position.z = 0;", + " p.velocity.copy(p.position).multiplyScalar(p.startSpeed);", + " p.position.multiplyScalar(this.radius * r);", + " }", + " toJSON() {", + " return {", + " type: 'circle',", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " spread: this.spread,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new CircleEmitter({", + " radius: json.radius,", + " arc: json.arc,", + " thickness: json.thickness,", + " mode: json.mode,", + " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", + " spread: json.spread,", + " });", + " }", + " clone() {", + " return new CircleEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " speed: this.speed.clone(),", + " spread: this.spread,", + " });", + " }", + "}", + "", + "class DonutEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d, _e, _f, _g;", + " this.type = 'donut';", + " this.currentValue = 0;", + " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", + " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", + " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", + " this.donutRadius = (_d = parameters.donutRadius) !== null && _d !== void 0 ? _d : this.radius * 0.2;", + " this.mode = (_e = parameters.mode) !== null && _e !== void 0 ? _e : EmitterMode.Random;", + " this.spread = (_f = parameters.spread) !== null && _f !== void 0 ? _f : 0;", + " this.speed = (_g = parameters.speed) !== null && _g !== void 0 ? _g : new ConstantValue(1);", + " }", + " update(system, delta) {", + " if (EmitterMode.Random != this.mode) {", + " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", + " }", + " }", + " initialize(p) {", + " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", + " const v = Math.random();", + " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", + " const theta = u * this.arc;", + " const phi = v * Math.PI * 2;", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " p.position.x = this.radius * cosTheta;", + " p.position.y = this.radius * sinTheta;", + " p.position.z = 0;", + " p.velocity.z = this.donutRadius * rand * Math.sin(phi);", + " p.velocity.x = this.donutRadius * rand * Math.cos(phi) * cosTheta;", + " p.velocity.y = this.donutRadius * rand * Math.cos(phi) * sinTheta;", + " p.position.add(p.velocity);", + " p.velocity.normalize().multiplyScalar(p.startSpeed);", + " }", + " toJSON() {", + " return {", + " type: 'donut',", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " donutRadius: this.donutRadius,", + " mode: this.mode,", + " spread: this.spread,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new DonutEmitter({", + " radius: json.radius,", + " arc: json.arc,", + " thickness: json.thickness,", + " donutRadius: json.donutRadius,", + " mode: json.mode,", + " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", + " spread: json.spread,", + " });", + " }", + " clone() {", + " return new DonutEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " donutRadius: this.donutRadius,", + " mode: this.mode,", + " speed: this.speed.clone(),", + " spread: this.spread,", + " });", + " }", + "}", + "", + "class PointEmitter {", + " constructor() {", + " this.type = 'point';", + " }", + " update(system, delta) { }", + " initialize(p) {", + " const u = Math.random();", + " const v = Math.random();", + " const theta = u * Math.PI * 2;", + " const phi = Math.acos(2.0 * v - 1.0);", + " const r = Math.cbrt(Math.random());", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " const sinPhi = Math.sin(phi);", + " const cosPhi = Math.cos(phi);", + " p.velocity.x = r * sinPhi * cosTheta;", + " p.velocity.y = r * sinPhi * sinTheta;", + " p.velocity.z = r * cosPhi;", + " p.velocity.multiplyScalar(p.startSpeed);", + " p.position.setScalar(0);", + " }", + " toJSON() {", + " return {", + " type: 'point',", + " };", + " }", + " static fromJSON(json) {", + " return new PointEmitter();", + " }", + " clone() {", + " return new PointEmitter();", + " }", + "}", + "", + "class SphereEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d, _e, _f;", + " this.type = 'sphere';", + " this.currentValue = 0;", + " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", + " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", + " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", + " this.mode = (_d = parameters.mode) !== null && _d !== void 0 ? _d : EmitterMode.Random;", + " this.spread = (_e = parameters.spread) !== null && _e !== void 0 ? _e : 0;", + " this.speed = (_f = parameters.speed) !== null && _f !== void 0 ? _f : new ConstantValue(1);", + " }", + " update(system, delta) {", + " if (EmitterMode.Random != this.mode) {", + " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", + " }", + " }", + " initialize(p) {", + " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", + " const v = Math.random();", + " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", + " const theta = u * this.arc;", + " const phi = Math.acos(2.0 * v - 1.0);", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " const sinPhi = Math.sin(phi);", + " const cosPhi = Math.cos(phi);", + " p.position.x = sinPhi * cosTheta;", + " p.position.y = sinPhi * sinTheta;", + " p.position.z = cosPhi;", + " p.velocity.copy(p.position).multiplyScalar(p.startSpeed);", + " p.position.multiplyScalar(this.radius * rand);", + " }", + " toJSON() {", + " return {", + " type: 'sphere',", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " spread: this.spread,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new SphereEmitter({", + " radius: json.radius,", + " arc: json.arc,", + " thickness: json.thickness,", + " mode: json.mode,", + " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", + " spread: json.spread,", + " });", + " }", + " clone() {", + " return new SphereEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " speed: this.speed.clone(),", + " spread: this.spread,", + " });", + " }", + "}", + "", + "class HemisphereEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d, _e, _f;", + " this.type = 'sphere';", + " this.currentValue = 0;", + " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", + " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", + " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", + " this.mode = (_d = parameters.mode) !== null && _d !== void 0 ? _d : EmitterMode.Random;", + " this.spread = (_e = parameters.spread) !== null && _e !== void 0 ? _e : 0;", + " this.speed = (_f = parameters.speed) !== null && _f !== void 0 ? _f : new ConstantValue(1);", + " }", + " update(system, delta) {", + " if (EmitterMode.Random != this.mode) {", + " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", + " }", + " }", + " initialize(p) {", + " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", + " const v = Math.random();", + " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", + " const theta = u * this.arc;", + " const phi = Math.acos(v);", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " const sinPhi = Math.sin(phi);", + " const cosPhi = Math.cos(phi);", + " p.position.x = sinPhi * cosTheta;", + " p.position.y = sinPhi * sinTheta;", + " p.position.z = cosPhi;", + " p.velocity.copy(p.position).multiplyScalar(p.startSpeed);", + " p.position.multiplyScalar(this.radius * rand);", + " }", + " toJSON() {", + " return {", + " type: 'hemisphere',", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " spread: this.spread,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new HemisphereEmitter({", + " radius: json.radius,", + " arc: json.arc,", + " thickness: json.thickness,", + " mode: json.mode,", + " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", + " spread: json.spread,", + " });", + " }", + " clone() {", + " return new HemisphereEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " speed: this.speed.clone(),", + " spread: this.spread,", + " });", + " }", + "}", + "", + "class GridEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d;", + " this.type = 'grid';", + " this.width = (_a = parameters.width) !== null && _a !== void 0 ? _a : 1;", + " this.height = (_b = parameters.height) !== null && _b !== void 0 ? _b : 1;", + " this.column = (_c = parameters.column) !== null && _c !== void 0 ? _c : 10;", + " this.row = (_d = parameters.row) !== null && _d !== void 0 ? _d : 10;", + " }", + " initialize(p) {", + " const r = Math.floor(Math.random() * this.row);", + " const c = Math.floor(Math.random() * this.column);", + " p.position.x = (c * this.width) / this.column - this.width / 2;", + " p.position.y = (r * this.height) / this.row - this.height / 2;", + " p.position.z = 0;", + " p.velocity.set(0, 0, p.startSpeed);", + " }", + " toJSON() {", + " return {", + " type: 'grid',", + " width: this.width,", + " height: this.height,", + " column: this.column,", + " row: this.row,", + " };", + " }", + " static fromJSON(json) {", + " return new GridEmitter(json);", + " }", + " clone() {", + " return new GridEmitter({", + " width: this.width,", + " height: this.height,", + " column: this.column,", + " row: this.row,", + " });", + " }", + " update(system, delta) { }", + "}", + "", + "class MeshSurfaceEmitter {", + " get geometry() {", + " return this._geometry;", + " }", + " set geometry(geometry) {", + " this._geometry = geometry;", + " if (geometry === undefined) {", + " return;", + " }", + " if (typeof geometry === 'string') {", + " return;", + " }", + " const tri = new THREE.Triangle();", + " this._triangleIndexToArea.length = 0;", + " let area = 0;", + " if (!geometry.getIndex()) {", + " return;", + " }", + " const array = geometry.getIndex().array;", + " const triCount = array.length / 3;", + " this._triangleIndexToArea.push(0);", + " for (let i = 0; i < triCount; i++) {", + " tri.setFromAttributeAndIndices(geometry.getAttribute('position'), array[i * 3], array[i * 3 + 1], array[i * 3 + 2]);", + " area += tri.getArea();", + " this._triangleIndexToArea.push(area);", + " }", + " geometry.userData.triangleIndexToArea = this._triangleIndexToArea;", + " }", + " constructor(geometry) {", + " this.type = 'mesh_surface';", + " this._triangleIndexToArea = [];", + " this._tempA = new THREE.Vector3();", + " this._tempB = new THREE.Vector3();", + " this._tempC = new THREE.Vector3();", + " if (!geometry) {", + " return;", + " }", + " this.geometry = geometry;", + " }", + " initialize(p) {", + " const geometry = this._geometry;", + " if (!geometry || geometry.getIndex() === null) {", + " p.position.set(0, 0, 0);", + " p.velocity.set(0, 0, 1).multiplyScalar(p.startSpeed);", + " return;", + " }", + " const triCount = this._triangleIndexToArea.length - 1;", + " let left = 0, right = triCount;", + " const target = Math.random() * this._triangleIndexToArea[triCount];", + " while (left + 1 < right) {", + " const mid = Math.floor((left + right) / 2);", + " if (target < this._triangleIndexToArea[mid]) {", + " right = mid;", + " }", + " else {", + " left = mid;", + " }", + " }", + " let u1 = Math.random();", + " let u2 = Math.random();", + " if (u1 + u2 > 1) {", + " u1 = 1 - u1;", + " u2 = 1 - u2;", + " }", + " const index1 = geometry.getIndex().array[left * 3];", + " const index2 = geometry.getIndex().array[left * 3 + 1];", + " const index3 = geometry.getIndex().array[left * 3 + 2];", + " const positionBuffer = geometry.getAttribute('position');", + " this._tempA.fromBufferAttribute(positionBuffer, index1);", + " this._tempB.fromBufferAttribute(positionBuffer, index2);", + " this._tempC.fromBufferAttribute(positionBuffer, index3);", + " this._tempB.sub(this._tempA);", + " this._tempC.sub(this._tempA);", + " this._tempA.addScaledVector(this._tempB, u1).addScaledVector(this._tempC, u2);", + " p.position.copy(this._tempA);", + " this._tempA.copy(this._tempB).cross(this._tempC).normalize();", + " p.velocity.copy(this._tempA).normalize().multiplyScalar(p.startSpeed);", + " }", + " toJSON() {", + " return {", + " type: 'mesh_surface',", + " mesh: this._geometry ? this._geometry.uuid : '',", + " };", + " }", + " static fromJSON(json, meta) {", + " return new MeshSurfaceEmitter(meta.geometries[json.geometry]);", + " }", + " clone() {", + " return new MeshSurfaceEmitter(this._geometry);", + " }", + " update(system, delta) { }", + "}", + "", + "const EmitterShapes = {", + " circle: {", + " type: 'circle',", + " params: [", + " ['radius', 'number'],", + " ['arc', 'radian'],", + " ['thickness', 'number'],", + " ['mode', 'emitterMode'],", + " ['spread', 'number'],", + " ['speed', 'valueFunc'],", + " ],", + " constructor: CircleEmitter,", + " loadJSON: CircleEmitter.fromJSON,", + " },", + " cone: {", + " type: 'cone',", + " params: [", + " ['radius', 'number'],", + " ['arc', 'radian'],", + " ['thickness', 'number'],", + " ['angle', 'radian'],", + " ['mode', 'emitterMode'],", + " ['spread', 'number'],", + " ['speed', 'valueFunc'],", + " ],", + " constructor: ConeEmitter,", + " loadJSON: ConeEmitter.fromJSON,", + " },", + " donut: {", + " type: 'donut',", + " params: [", + " ['radius', 'number'],", + " ['arc', 'radian'],", + " ['thickness', 'number'],", + " ['donutRadius', 'number'],", + " ['mode', 'emitterMode'],", + " ['spread', 'number'],", + " ['speed', 'valueFunc'],", + " ],", + " constructor: DonutEmitter,", + " loadJSON: DonutEmitter.fromJSON,", + " },", + " point: { type: 'point', params: [], constructor: PointEmitter, loadJSON: PointEmitter.fromJSON },", + " sphere: {", + " type: 'sphere',", + " params: [", + " ['radius', 'number'],", + " ['arc', 'radian'],", + " ['thickness', 'number'],", + " ['angle', 'radian'],", + " ['mode', 'emitterMode'],", + " ['spread', 'number'],", + " ['speed', 'valueFunc'],", + " ],", + " constructor: SphereEmitter,", + " loadJSON: SphereEmitter.fromJSON,", + " },", + " hemisphere: {", + " type: 'hemisphere',", + " params: [", + " ['radius', 'number'],", + " ['arc', 'radian'],", + " ['thickness', 'number'],", + " ['angle', 'radian'],", + " ['mode', 'emitterMode'],", + " ['spread', 'number'],", + " ['speed', 'valueFunc'],", + " ],", + " constructor: HemisphereEmitter,", + " loadJSON: HemisphereEmitter.fromJSON,", + " },", + " grid: {", + " type: 'grid',", + " params: [", + " ['width', 'number'],", + " ['height', 'number'],", + " ['rows', 'number'],", + " ['column', 'number'],", + " ],", + " constructor: GridEmitter,", + " loadJSON: GridEmitter.fromJSON,", + " },", + " mesh_surface: {", + " type: 'mesh_surface',", + " params: [['geometry', 'geometry']],", + " constructor: MeshSurfaceEmitter,", + " loadJSON: MeshSurfaceEmitter.fromJSON,", + " },", + "};", + "function EmitterFromJSON(json, meta) {", + " return EmitterShapes[json.type].loadJSON(json, meta);", + "}", + "", + "let RenderMode = void 0;", + "(function (RenderMode) {", + " RenderMode[RenderMode[\"BillBoard\"] = 0] = \"BillBoard\";", + " RenderMode[RenderMode[\"StretchedBillBoard\"] = 1] = \"StretchedBillBoard\";", + " RenderMode[RenderMode[\"Mesh\"] = 2] = \"Mesh\";", + " RenderMode[RenderMode[\"Trail\"] = 3] = \"Trail\";", + " RenderMode[RenderMode[\"HorizontalBillBoard\"] = 4] = \"HorizontalBillBoard\";", + " RenderMode[RenderMode[\"VerticalBillBoard\"] = 5] = \"VerticalBillBoard\";", + "})(RenderMode || (RenderMode = {}));", + "class VFXBatch extends THREE.Mesh {", + " constructor(settings) {", + " super();", + " this.type = 'VFXBatch';", + " this.maxParticles = 1000;", + " this.systems = new Set();", + " const layers = new THREE.Layers();", + " layers.mask = settings.layers.mask;", + " const newMat = settings.material.clone();", + " newMat.defines = {};", + " Object.assign(newMat.defines, settings.material.defines);", + " this.settings = {", + " instancingGeometry: settings.instancingGeometry,", + " renderMode: settings.renderMode,", + " renderOrder: settings.renderOrder,", + " material: newMat,", + " uTileCount: settings.uTileCount,", + " vTileCount: settings.vTileCount,", + " layers: layers,", + " };", + " this.frustumCulled = false;", + " this.renderOrder = this.settings.renderOrder;", + " }", + " addSystem(system) {", + " this.systems.add(system);", + " }", + " removeSystem(system) {", + " this.systems.delete(system);", + " }", + "}", + "", + "const UP = new THREE.Vector3(0, 0, 1);", + "const tempQ$1 = new THREE.Quaternion();", + "const tempV$1 = new THREE.Vector3();", + "const tempV2$1 = new THREE.Vector3();", + "new THREE.Vector3();", + "const PREWARM_FPS$1 = 60;", + "const DEFAULT_GEOMETRY$1 = new THREE.PlaneGeometry(1, 1, 1, 1);", + "class ParticleSystem {", + " set time(time) {", + " this.emissionState.time = time;", + " }", + " get time() {", + " return this.emissionState.time;", + " }", + " get layers() {", + " return this.rendererSettings.layers;", + " }", + " get texture() {", + " return this.rendererSettings.material.map;", + " }", + " set texture(texture) {", + " this.rendererSettings.material.map = texture;", + " this.neededToUpdateRender = true;", + " }", + " get material() {", + " return this.rendererSettings.material;", + " }", + " set material(material) {", + " this.rendererSettings.material = material;", + " this.neededToUpdateRender = true;", + " }", + " get uTileCount() {", + " return this.rendererSettings.uTileCount;", + " }", + " set uTileCount(u) {", + " this.rendererSettings.uTileCount = u;", + " this.neededToUpdateRender = true;", + " }", + " get vTileCount() {", + " return this.rendererSettings.vTileCount;", + " }", + " set vTileCount(v) {", + " this.rendererSettings.vTileCount = v;", + " this.neededToUpdateRender = true;", + " }", + " get instancingGeometry() {", + " return this.rendererSettings.instancingGeometry;", + " }", + " set instancingGeometry(geometry) {", + " this.restart();", + " this.particles.length = 0;", + " this.rendererSettings.instancingGeometry = geometry;", + " this.neededToUpdateRender = true;", + " }", + " get renderMode() {", + " return this.rendererSettings.renderMode;", + " }", + " set renderMode(renderMode) {", + " if ((this.rendererSettings.renderMode != RenderMode.Trail && renderMode === RenderMode.Trail) ||", + " (this.rendererSettings.renderMode == RenderMode.Trail && renderMode !== RenderMode.Trail)) {", + " this.restart();", + " this.particles.length = 0;", + " }", + " if (this.rendererSettings.renderMode !== renderMode) {", + " switch (renderMode) {", + " case RenderMode.Trail:", + " this.rendererEmitterSettings = {", + " startLength: new ConstantValue(30),", + " followLocalOrigin: false,", + " };", + " break;", + " case RenderMode.Mesh:", + " this.rendererEmitterSettings = {", + " geometry: new THREE.PlaneGeometry(1, 1),", + " };", + " this.startRotation = new AxisAngleGenerator(new THREE.Vector3(0, 1, 0), new ConstantValue(0));", + " break;", + " case RenderMode.StretchedBillBoard:", + " this.rendererEmitterSettings = { speedFactor: 0, lengthFactor: 2 };", + " if (this.rendererSettings.renderMode === RenderMode.Mesh) {", + " this.startRotation = new ConstantValue(0);", + " }", + " break;", + " case RenderMode.BillBoard:", + " case RenderMode.VerticalBillBoard:", + " case RenderMode.HorizontalBillBoard:", + " this.rendererEmitterSettings = {};", + " if (this.rendererSettings.renderMode === RenderMode.Mesh) {", + " this.startRotation = new ConstantValue(0);", + " }", + " break;", + " }", + " }", + " this.rendererSettings.renderMode = renderMode;", + " this.neededToUpdateRender = true;", + " }", + " get renderOrder() {", + " return this.rendererSettings.renderOrder;", + " }", + " set renderOrder(renderOrder) {", + " this.rendererSettings.renderOrder = renderOrder;", + " this.neededToUpdateRender = true;", + " }", + " get blending() {", + " return this.rendererSettings.material.blending;", + " }", + " set blending(blending) {", + " this.rendererSettings.material.blending = blending;", + " this.neededToUpdateRender = true;", + " }", + " constructor(parameters) {", + " var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;", + " this.temp = new THREE.Vector3();", + " this.travelDistance = 0;", + " this.normalMatrix = new THREE.Matrix3();", + " this.firstTimeUpdate = true;", + " this.autoDestroy = parameters.autoDestroy === undefined ? false : parameters.autoDestroy;", + " this.duration = (_a = parameters.duration) !== null && _a !== void 0 ? _a : 1;", + " this.looping = parameters.looping === undefined ? true : parameters.looping;", + " this.prewarm = parameters.prewarm === undefined ? false : parameters.prewarm;", + " this.startLife = (_b = parameters.startLife) !== null && _b !== void 0 ? _b : new ConstantValue(5);", + " this.startSpeed = (_c = parameters.startSpeed) !== null && _c !== void 0 ? _c : new ConstantValue(0);", + " this.startRotation = (_d = parameters.startRotation) !== null && _d !== void 0 ? _d : new ConstantValue(0);", + " this.startSize = (_e = parameters.startSize) !== null && _e !== void 0 ? _e : new ConstantValue(1);", + " this.startColor = (_f = parameters.startColor) !== null && _f !== void 0 ? _f : new ConstantColor(new THREE.Vector4(1, 1, 1, 1));", + " this.emissionOverTime = (_g = parameters.emissionOverTime) !== null && _g !== void 0 ? _g : new ConstantValue(10);", + " this.emissionOverDistance = (_h = parameters.emissionOverDistance) !== null && _h !== void 0 ? _h : new ConstantValue(0);", + " this.emissionBursts = (_j = parameters.emissionBursts) !== null && _j !== void 0 ? _j : [];", + " this.onlyUsedByOther = (_k = parameters.onlyUsedByOther) !== null && _k !== void 0 ? _k : false;", + " this.emitterShape = (_l = parameters.shape) !== null && _l !== void 0 ? _l : new SphereEmitter();", + " this.behaviors = (_m = parameters.behaviors) !== null && _m !== void 0 ? _m : new Array();", + " this.worldSpace = (_o = parameters.worldSpace) !== null && _o !== void 0 ? _o : false;", + " this.rendererEmitterSettings = (_p = parameters.rendererEmitterSettings) !== null && _p !== void 0 ? _p : {};", + " if (parameters.renderMode === RenderMode.StretchedBillBoard) {", + " const stretchedBillboardSettings = this.rendererEmitterSettings;", + " if (parameters.speedFactor !== undefined) {", + " stretchedBillboardSettings.speedFactor = parameters.speedFactor;", + " }", + " stretchedBillboardSettings.speedFactor = (_q = stretchedBillboardSettings.speedFactor) !== null && _q !== void 0 ? _q : 0;", + " stretchedBillboardSettings.lengthFactor = (_r = stretchedBillboardSettings.lengthFactor) !== null && _r !== void 0 ? _r : 0;", + " }", + " this.rendererSettings = {", + " instancingGeometry: (_s = parameters.instancingGeometry) !== null && _s !== void 0 ? _s : DEFAULT_GEOMETRY$1,", + " renderMode: (_t = parameters.renderMode) !== null && _t !== void 0 ? _t : RenderMode.BillBoard,", + " renderOrder: (_u = parameters.renderOrder) !== null && _u !== void 0 ? _u : 0,", + " material: parameters.material,", + " uTileCount: (_v = parameters.uTileCount) !== null && _v !== void 0 ? _v : 1,", + " vTileCount: (_w = parameters.vTileCount) !== null && _w !== void 0 ? _w : 1,", + " layers: (_x = parameters.layers) !== null && _x !== void 0 ? _x : new THREE.Layers(),", + " };", + " this.neededToUpdateRender = true;", + " this.particles = new Array();", + " this.startTileIndex = parameters.startTileIndex || new ConstantValue(0);", + " this.emitter = new ParticleEmitter(this);", + " this.paused = false;", + " this.particleNum = 0;", + " this.emissionState = {", + " burstIndex: 0,", + " burstWaveIndex: 0,", + " time: 0,", + " waitEmiting: 0,", + " travelDistance: 0,", + " };", + " this.emitEnded = false;", + " this.markForDestroy = false;", + " this.prewarmed = false;", + " }", + " pause() {", + " this.paused = true;", + " }", + " play() {", + " this.paused = false;", + " }", + " spawn(count, emissionState, matrix) {", + " tempQ$1.setFromRotationMatrix(matrix);", + " const translation = tempV$1;", + " const quaternion = tempQ$1;", + " const scale = tempV2$1;", + " matrix.decompose(translation, quaternion, scale);", + " for (let i = 0; i < count; i++) {", + " this.particleNum++;", + " while (this.particles.length < this.particleNum) {", + " if (this.rendererSettings.renderMode === RenderMode.Trail) {", + " this.particles.push(new TrailParticle());", + " }", + " else {", + " this.particles.push(new SpriteParticle());", + " }", + " }", + " const particle = this.particles[this.particleNum - 1];", + " particle.speedModifier = 1;", + " this.startColor.genColor(particle.startColor, this.emissionState.time, {});", + " particle.color.copy(particle.startColor);", + " particle.startSpeed = this.startSpeed.genValue(emissionState.time / this.duration);", + " particle.life = this.startLife.genValue(emissionState.time / this.duration);", + " particle.age = 0;", + " particle.startSize = this.startSize.genValue(emissionState.time / this.duration);", + " particle.uvTile = Math.floor(this.startTileIndex.genValue() + 0.001);", + " particle.size = particle.startSize;", + " if (this.rendererSettings.renderMode === RenderMode.Mesh ||", + " this.rendererSettings.renderMode === RenderMode.BillBoard ||", + " this.rendererSettings.renderMode === RenderMode.VerticalBillBoard ||", + " this.rendererSettings.renderMode === RenderMode.HorizontalBillBoard ||", + " this.rendererSettings.renderMode === RenderMode.StretchedBillBoard) {", + " const sprite = particle;", + " if (this.rendererSettings.renderMode === RenderMode.Mesh) {", + " if (!(sprite.rotation instanceof THREE.Quaternion)) {", + " sprite.rotation = new THREE.Quaternion();", + " }", + " if (this.startRotation.type === 'rotation') {", + " this.startRotation.genValue(sprite.rotation, emissionState.time / this.duration);", + " }", + " else {", + " sprite.rotation.setFromAxisAngle(UP, this.startRotation.genValue((emissionState.time / this.duration)));", + " }", + " }", + " else {", + " if (this.startRotation.type === 'rotation') {", + " sprite.rotation = 0;", + " }", + " else {", + " sprite.rotation = this.startRotation.genValue(emissionState.time / this.duration);", + " }", + " }", + " }", + " else if (this.rendererSettings.renderMode === RenderMode.Trail) {", + " const trail = particle;", + " trail.length = this.rendererEmitterSettings.startLength.genValue(emissionState.time / this.duration);", + " }", + " this.emitterShape.initialize(particle);", + " if (this.rendererSettings.renderMode === RenderMode.Trail &&", + " this.rendererEmitterSettings.followLocalOrigin) {", + " const trail = particle;", + " trail.localPosition = new THREE.Vector3().copy(trail.position);", + " }", + " if (this.worldSpace) {", + " particle.position.applyMatrix4(matrix);", + " particle.startSize =", + " (particle.startSize * (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z))) / 3;", + " particle.size = particle.startSize;", + " particle.velocity.multiply(scale).applyMatrix3(this.normalMatrix);", + " if (particle.rotation && particle.rotation instanceof THREE.Quaternion) {", + " particle.rotation.multiplyQuaternions(tempQ$1, particle.rotation);", + " }", + " }", + " else {", + " if (this.onlyUsedByOther) {", + " particle.parentMatrix = matrix;", + " }", + " }", + " for (let j = 0; j < this.behaviors.length; j++) {", + " this.behaviors[j].initialize(particle);", + " }", + " }", + " }", + " endEmit() {", + " this.emitEnded = true;", + " if (this.autoDestroy) {", + " this.markForDestroy = true;", + " }", + " }", + " dispose() {", + " if (this._renderer)", + " this._renderer.deleteSystem(this);", + " this.emitter.dispose();", + " if (this.emitter.parent)", + " this.emitter.parent.remove(this.emitter);", + " }", + " restart() {", + " this.paused = false;", + " this.particleNum = 0;", + " this.emissionState.burstIndex = 0;", + " this.emissionState.burstWaveIndex = 0;", + " this.emissionState.time = 0;", + " this.emissionState.waitEmiting = 0;", + " this.behaviors.forEach((behavior) => {", + " behavior.reset();", + " });", + " this.emitEnded = false;", + " this.markForDestroy = false;", + " this.prewarmed = false;", + " }", + " update(delta) {", + " if (this.paused)", + " return;", + " let currentParent = this.emitter;", + " while (currentParent.parent) {", + " currentParent = currentParent.parent;", + " }", + " if (currentParent.type !== 'Scene') {", + " this.dispose();", + " return;", + " }", + " if (this.firstTimeUpdate) {", + " this.firstTimeUpdate = false;", + " this.emitter.updateWorldMatrix(true, false);", + " }", + " if (this.emitEnded && this.particleNum === 0) {", + " if (this.markForDestroy && this.emitter.parent)", + " this.dispose();", + " return;", + " }", + " if (this.looping && this.prewarm && !this.prewarmed) {", + " this.prewarmed = true;", + " for (let i = 0; i < this.duration * PREWARM_FPS$1; i++) {", + " this.update(1.0 / PREWARM_FPS$1);", + " }", + " }", + " if (delta > 0.1) {", + " delta = 0.1;", + " }", + " if (this.neededToUpdateRender) {", + " if (this._renderer)", + " this._renderer.updateSystem(this);", + " this.neededToUpdateRender = false;", + " }", + " if (!this.onlyUsedByOther) {", + " this.emit(delta, this.emissionState, this.emitter.matrixWorld);", + " }", + " this.emitterShape.update(this, delta);", + " for (let j = 0; j < this.behaviors.length; j++) {", + " for (let i = 0; i < this.particleNum; i++) {", + " if (!this.particles[i].died) {", + " this.behaviors[j].update(this.particles[i], delta);", + " }", + " }", + " this.behaviors[j].frameUpdate(delta);", + " }", + " for (let i = 0; i < this.particleNum; i++) {", + " if (this.rendererEmitterSettings.followLocalOrigin &&", + " this.particles[i].localPosition) {", + " this.particles[i].position.copy(this.particles[i].localPosition);", + " if (this.particles[i].parentMatrix) {", + " this.particles[i].position.applyMatrix4(this.particles[i].parentMatrix);", + " }", + " else {", + " this.particles[i].position.applyMatrix4(this.emitter.matrixWorld);", + " }", + " }", + " else {", + " this.particles[i].position.addScaledVector(this.particles[i].velocity, delta * this.particles[i].speedModifier);", + " }", + " this.particles[i].age += delta;", + " }", + " if (this.rendererSettings.renderMode === RenderMode.Trail) {", + " for (let i = 0; i < this.particleNum; i++) {", + " const particle = this.particles[i];", + " particle.update();", + " }", + " }", + " for (let i = 0; i < this.particleNum; i++) {", + " const particle = this.particles[i];", + " if (particle.died && (!(particle instanceof TrailParticle) || particle.previous.length === 0)) {", + " this.particles[i] = this.particles[this.particleNum - 1];", + " this.particles[this.particleNum - 1] = particle;", + " this.particleNum--;", + " i--;", + " }", + " }", + " }", + " emit(delta, emissionState, emitterMatrix) {", + " if (emissionState.time > this.duration) {", + " if (this.looping) {", + " emissionState.time -= this.duration;", + " emissionState.burstIndex = 0;", + " this.behaviors.forEach((behavior) => {", + " behavior.reset();", + " });", + " }", + " else {", + " if (!this.emitEnded && !this.onlyUsedByOther) {", + " this.endEmit();", + " }", + " }", + " }", + " this.normalMatrix.getNormalMatrix(emitterMatrix);", + " const totalSpawn = Math.ceil(emissionState.waitEmiting);", + " this.spawn(totalSpawn, emissionState, emitterMatrix);", + " emissionState.waitEmiting -= totalSpawn;", + " while (emissionState.burstIndex < this.emissionBursts.length &&", + " this.emissionBursts[emissionState.burstIndex].time <= emissionState.time) {", + " if (Math.random() < this.emissionBursts[emissionState.burstIndex].probability) {", + " const count = this.emissionBursts[emissionState.burstIndex].count.genValue(this.time);", + " this.spawn(count, emissionState, emitterMatrix);", + " }", + " emissionState.burstIndex++;", + " }", + " if (!this.emitEnded) {", + " emissionState.waitEmiting += delta * this.emissionOverTime.genValue(emissionState.time / this.duration);", + " if (emissionState.previousWorldPos != undefined) {", + " this.temp.set(emitterMatrix.elements[12], emitterMatrix.elements[13], emitterMatrix.elements[14]);", + " emissionState.travelDistance += emissionState.previousWorldPos.distanceTo(this.temp);", + " const emitPerMeter = this.emissionOverDistance.genValue(emissionState.time / this.duration);", + " if (emissionState.travelDistance * emitPerMeter > 0) {", + " const count = Math.floor(emissionState.travelDistance * emitPerMeter);", + " emissionState.travelDistance -= count / emitPerMeter;", + " emissionState.waitEmiting += count;", + " }", + " }", + " }", + " if (emissionState.previousWorldPos === undefined)", + " emissionState.previousWorldPos = new THREE.Vector3();", + " emissionState.previousWorldPos.set(emitterMatrix.elements[12], emitterMatrix.elements[13], emitterMatrix.elements[14]);", + " emissionState.time += delta;", + " }", + " toJSON(meta, options = {}) {", + " const isRootObject = meta === undefined || typeof meta === 'string';", + " if (isRootObject) {", + " meta = {", + " geometries: {},", + " materials: {},", + " textures: {},", + " images: {},", + " shapes: {},", + " skeletons: {},", + " animations: {},", + " nodes: {},", + " };", + " }", + " meta.materials[this.rendererSettings.material.uuid] = this.rendererSettings.material.toJSON(meta);", + " if (options.useUrlForImage) {", + " if (this.texture.source !== undefined) {", + " const image = this.texture.source;", + " meta.images[image.uuid] = {", + " uuid: image.uuid,", + " url: this.texture.image.url,", + " };", + " }", + " }", + " let rendererSettingsJSON;", + " if (this.renderMode === RenderMode.Trail) {", + " rendererSettingsJSON = {", + " startLength: this.rendererEmitterSettings.startLength.toJSON(),", + " followLocalOrigin: this.rendererEmitterSettings.followLocalOrigin,", + " };", + " }", + " else if (this.renderMode === RenderMode.Mesh) {", + " rendererSettingsJSON = {};", + " }", + " else if (this.renderMode === RenderMode.StretchedBillBoard) {", + " rendererSettingsJSON = {", + " speedFactor: this.rendererEmitterSettings.speedFactor,", + " lengthFactor: this.rendererEmitterSettings.lengthFactor,", + " };", + " }", + " else {", + " rendererSettingsJSON = {};", + " }", + " const geometry = this.rendererSettings.instancingGeometry;", + " if (meta.geometries && !meta.geometries[geometry.uuid]) {", + " meta.geometries[geometry.uuid] = geometry.toJSON();", + " }", + " return {", + " version: '2.0',", + " autoDestroy: this.autoDestroy,", + " looping: this.looping,", + " prewarm: this.prewarm,", + " duration: this.duration,", + " shape: this.emitterShape.toJSON(),", + " startLife: this.startLife.toJSON(),", + " startSpeed: this.startSpeed.toJSON(),", + " startRotation: this.startRotation.toJSON(),", + " startSize: this.startSize.toJSON(),", + " startColor: this.startColor.toJSON(),", + " emissionOverTime: this.emissionOverTime.toJSON(),", + " emissionOverDistance: this.emissionOverDistance.toJSON(),", + " emissionBursts: this.emissionBursts.map((burst) => ({", + " time: burst.time,", + " count: burst.count.toJSON(),", + " probability: burst.probability,", + " interval: burst.interval,", + " cycle: burst.cycle,", + " })),", + " onlyUsedByOther: this.onlyUsedByOther,", + " instancingGeometry: this.rendererSettings.instancingGeometry.uuid,", + " renderOrder: this.renderOrder,", + " renderMode: this.renderMode,", + " rendererEmitterSettings: rendererSettingsJSON,", + " material: this.rendererSettings.material.uuid,", + " layers: this.layers.mask,", + " startTileIndex: this.startTileIndex.toJSON(),", + " uTileCount: this.uTileCount,", + " vTileCount: this.vTileCount,", + " behaviors: this.behaviors.map((behavior) => behavior.toJSON()),", + " worldSpace: this.worldSpace,", + " };", + " }", + " static fromJSON(json, meta, dependencies) {", + " var _a, _b;", + " const shape = EmitterFromJSON(json.shape, meta);", + " let rendererEmitterSettings;", + " if (json.renderMode === RenderMode.Trail) {", + " let trailSettings = json.rendererEmitterSettings;", + " rendererEmitterSettings = {", + " startLength: trailSettings.startLength != undefined", + " ? ValueGeneratorFromJSON(trailSettings.startLength)", + " : new ConstantValue(30),", + " followLocalOrigin: trailSettings.followLocalOrigin,", + " };", + " }", + " else if (json.renderMode === RenderMode.Mesh) {", + " rendererEmitterSettings = {};", + " }", + " else if (json.renderMode === RenderMode.StretchedBillBoard) {", + " rendererEmitterSettings = json.rendererEmitterSettings;", + " if (json.speedFactor != undefined) {", + " rendererEmitterSettings.speedFactor = json.speedFactor;", + " }", + " }", + " else {", + " rendererEmitterSettings = {};", + " }", + " const layers = new THREE.Layers();", + " if (json.layers) {", + " layers.mask = json.layers;", + " }", + " const ps = new ParticleSystem({", + " autoDestroy: json.autoDestroy,", + " looping: json.looping,", + " prewarm: json.prewarm,", + " duration: json.duration,", + " shape: shape,", + " startLife: ValueGeneratorFromJSON(json.startLife),", + " startSpeed: ValueGeneratorFromJSON(json.startSpeed),", + " startRotation: GeneratorFromJSON(json.startRotation),", + " startSize: ValueGeneratorFromJSON(json.startSize),", + " startColor: ColorGeneratorFromJSON(json.startColor),", + " emissionOverTime: ValueGeneratorFromJSON(json.emissionOverTime),", + " emissionOverDistance: ValueGeneratorFromJSON(json.emissionOverDistance),", + " emissionBursts: (_a = json.emissionBursts) === null || _a === void 0 ? void 0 : _a.map((burst) => ({", + " time: burst.time,", + " count: typeof burst.count === 'number'", + " ? new ConstantValue(burst.count)", + " : ValueGeneratorFromJSON(burst.count),", + " probability: burst.probability,", + " interval: burst.interval,", + " cycle: burst.cycle,", + " })),", + " onlyUsedByOther: json.onlyUsedByOther,", + " instancingGeometry: meta.geometries[json.instancingGeometry],", + " renderMode: json.renderMode,", + " rendererEmitterSettings: rendererEmitterSettings,", + " renderOrder: json.renderOrder,", + " layers: layers,", + " material: json.material", + " ? meta.materials[json.material]", + " : json.texture", + " ? new THREE.MeshBasicMaterial({", + " map: meta.textures[json.texture],", + " transparent: (_b = json.transparent) !== null && _b !== void 0 ? _b : true,", + " blending: json.blending,", + " side: THREE.DoubleSide,", + " })", + " : new THREE.MeshBasicMaterial({", + " color: 0xffffff,", + " transparent: true,", + " blending: THREE.AdditiveBlending,", + " side: THREE.DoubleSide,", + " }),", + " startTileIndex: typeof json.startTileIndex === 'number'", + " ? new ConstantValue(json.startTileIndex)", + " : ValueGeneratorFromJSON(json.startTileIndex),", + " uTileCount: json.uTileCount,", + " vTileCount: json.vTileCount,", + " behaviors: [],", + " worldSpace: json.worldSpace,", + " });", + " ps.behaviors = json.behaviors.map((behaviorJson) => {", + " const behavior = BehaviorFromJSON(behaviorJson, ps);", + " if (behavior.type === 'EmitSubParticleSystem') {", + " dependencies[behaviorJson.subParticleSystem] = behavior;", + " }", + " return behavior;", + " });", + " return ps;", + " }", + " addBehavior(behavior) {", + " this.behaviors.push(behavior);", + " }", + " getRendererSettings() {", + " return this.rendererSettings;", + " }", + " clone() {", + " const newEmissionBursts = [];", + " for (const emissionBurst of this.emissionBursts) {", + " const newEmissionBurst = {};", + " Object.assign(newEmissionBurst, emissionBurst);", + " newEmissionBursts.push(newEmissionBurst);", + " }", + " const newBehaviors = [];", + " for (const behavior of this.behaviors) {", + " newBehaviors.push(behavior.clone());", + " }", + " let rendererEmitterSettings;", + " if (this.renderMode === RenderMode.Trail) {", + " rendererEmitterSettings = {", + " startLength: this.rendererEmitterSettings.startLength.clone(),", + " followLocalOrigin: this.rendererEmitterSettings.followLocalOrigin,", + " };", + " }", + " else {", + " rendererEmitterSettings = {};", + " }", + " const layers = new THREE.Layers();", + " layers.mask = this.layers.mask;", + " return new ParticleSystem({", + " autoDestroy: this.autoDestroy,", + " looping: this.looping,", + " duration: this.duration,", + " shape: this.emitterShape.clone(),", + " startLife: this.startLife.clone(),", + " startSpeed: this.startSpeed.clone(),", + " startRotation: this.startRotation.clone(),", + " startSize: this.startSize.clone(),", + " startColor: this.startColor.clone(),", + " emissionOverTime: this.emissionOverTime.clone(),", + " emissionOverDistance: this.emissionOverDistance.clone(),", + " emissionBursts: newEmissionBursts,", + " onlyUsedByOther: this.onlyUsedByOther,", + " instancingGeometry: this.rendererSettings.instancingGeometry,", + " renderMode: this.renderMode,", + " renderOrder: this.renderOrder,", + " rendererEmitterSettings: rendererEmitterSettings,", + " material: this.rendererSettings.material,", + " startTileIndex: this.startTileIndex,", + " uTileCount: this.uTileCount,", + " vTileCount: this.vTileCount,", + " behaviors: newBehaviors,", + " worldSpace: this.worldSpace,", + " layers: layers,", + " });", + " }", + "}", + "", + "var particle_frag = `", + "", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "void main() {", + "", + " #include ", + " ", + " vec3 outgoingLight = vec3( 0.0 );", + " vec4 diffuseColor = vColor;", + " ", + " #include ", + " ", + " #ifdef USE_MAP", + " diffuseColor *= texture2D( map, vMapUv);", + " #endif", + " ", + " #include ", + "", + " outgoingLight = diffuseColor.rgb;", + " ", + " #ifdef USE_COLOR_AS_ALPHA", + " gl_FragColor = vec4( outgoingLight, diffuseColor.r );", + " #else", + " gl_FragColor = vec4( outgoingLight, diffuseColor.a );", + " #endif", + " ", + " ", + " #include ", + "", + "}", + "`;", + "", + "var particle_physics_frag = `", + "#define STANDARD", + "#ifdef PHYSICAL", + "#define IOR", + "#define SPECULAR", + "#endif", + "uniform vec3 diffuse;", + "uniform vec3 emissive;", + "uniform float roughness;", + "uniform float metalness;", + "uniform float opacity;", + "#ifdef IOR", + "uniform float ior;", + "#endif", + "#ifdef SPECULAR", + "uniform float specularIntensity;", + "uniform vec3 specularColor;", + "#ifdef USE_SPECULARINTENSITYMAP", + "uniform sampler2D specularIntensityMap;", + "#endif", + "#ifdef USE_SPECULARCOLORMAP", + "uniform sampler2D specularColorMap;", + "#endif", + "#endif", + "#ifdef USE_CLEARCOAT", + "uniform float clearcoat;", + "uniform float clearcoatRoughness;", + "#endif", + "#ifdef USE_IRIDESCENCE", + "uniform float iridescence;", + "uniform float iridescenceIOR;", + "uniform float iridescenceThicknessMinimum;", + "uniform float iridescenceThicknessMaximum;", + "#endif", + "#ifdef USE_SHEEN", + "uniform vec3 sheenColor;", + "uniform float sheenRoughness;", + "#ifdef USE_SHEENCOLORMAP", + "uniform sampler2D sheenColorMap;", + "#endif", + "#ifdef USE_SHEENROUGHNESSMAP", + "uniform sampler2D sheenRoughnessMap;", + "#endif", + "#endif", + "", + "varying vec3 vViewPosition;", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "void main() {", + " #include ", + " vec4 diffuseColor = vec4( diffuse, opacity );", + " ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );", + " vec3 totalEmissiveRadiance = emissive;", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " // accumulation", + " #include ", + " #include ", + " #include ", + " #include ", + " // modulation", + " #include ", + " vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;", + " vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;", + " #include ", + " vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;", + " #ifdef USE_SHEEN", + " // Sheen energy compensation approximation calculation can be found at the end of", + " // https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing", + " float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );", + " outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;", + " #endif", + " #ifdef USE_CLEARCOAT", + " float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );", + " vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );", + " outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;", + " #endif", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + "}`;", + "", + "var uv_vertex_tile = `", + "", + " #ifdef UV_TILE", + " float col = mod(uvTile, tileCount.x);", + " float row = (tileCount.y - floor(uvTile / tileCount.x) - 1.0);", + " ", + " mat3 tileTransform = mat3(", + " 1.0 / tileCount.x, 0.0, 0.0,", + " 0.0, 1.0 / tileCount.y, 0.0, ", + " col / tileCount.x, row / tileCount.y, 1.0);", + " #else", + " mat3 tileTransform = mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);", + " #endif", + "", + "#if defined( USE_UV ) || defined( USE_ANISOTROPY )", + "", + "vUv = (tileTransform *vec3( uv, 1 )).xy;", + "", + "#endif", + "#ifdef USE_MAP", + "", + "vMapUv = ( tileTransform * (mapTransform * vec3( MAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_ALPHAMAP", + "", + "vAlphaMapUv = ( tileTransform * (alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_LIGHTMAP", + "", + "vLightMapUv = ( tileTransform * (lightMapTransform * vec3( LIGHTMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_AOMAP", + "", + "vAoMapUv = ( tileTransform * (aoMapTransform * vec3( AOMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_BUMPMAP", + "", + "vBumpMapUv = ( tileTransform * (bumpMapTransform * vec3( BUMPMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_NORMALMAP", + "", + "vNormalMapUv = ( tileTransform * (normalMapTransform * vec3( NORMALMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_DISPLACEMENTMAP", + "", + "vDisplacementMapUv = ( tileTransform * (displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_EMISSIVEMAP", + "", + "vEmissiveMapUv = ( tileTransform * (emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_METALNESSMAP", + "", + "vMetalnessMapUv = ( tileTransform * (metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_ROUGHNESSMAP", + "", + "vRoughnessMapUv = ( tileTransform * (roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_ANISOTROPYMAP", + "", + "vAnisotropyMapUv = ( tileTransform * (anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_CLEARCOATMAP", + "", + "vClearcoatMapUv = ( tileTransform * (clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_CLEARCOAT_NORMALMAP", + "", + "vClearcoatNormalMapUv = ( tileTransform * (clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_CLEARCOAT_ROUGHNESSMAP", + "", + "vClearcoatRoughnessMapUv = ( tileTransform * (clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_IRIDESCENCEMAP", + "", + "vIridescenceMapUv = ( tileTransform * (iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_IRIDESCENCE_THICKNESSMAP", + "", + "vIridescenceThicknessMapUv = ( tileTransform * (iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_SHEEN_COLORMAP", + "", + "vSheenColorMapUv = ( tileTransform * (sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_SHEEN_ROUGHNESSMAP", + "", + "vSheenRoughnessMapUv = ( tileTransform * (sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_SPECULARMAP", + "", + "vSpecularMapUv = ( tileTransform * (specularMapTransform * vec3( SPECULARMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_SPECULAR_COLORMAP", + "", + "vSpecularColorMapUv = ( tileTransform * (specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_SPECULAR_INTENSITYMAP", + "", + "vSpecularIntensityMapUv = ( tileTransform * (specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_TRANSMISSIONMAP", + "", + "vTransmissionMapUv = ( tileTransform * transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_THICKNESSMAP", + "", + "vThicknessMapUv = ( tileTransform * thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "`;", + "", + "var particle_vert = `", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "attribute vec3 offset;", + "attribute float rotation;", + "attribute float size;", + "attribute float uvTile;", + "", + "#ifdef UV_TILE", + "uniform vec2 tileCount;", + "#endif", + "", + "void main() {", + "", + " ${uv_vertex_tile}", + "\t", + " vec2 alignedPosition = ( position.xy ) * size;", + " ", + " vec2 rotatedPosition;", + " rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", + " rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", + "#ifdef HORIZONTAL", + " vec4 mvPosition = modelMatrix * vec4( offset, 1.0 );", + " mvPosition.x += rotatedPosition.x;", + " mvPosition.z -= rotatedPosition.y;", + " mvPosition = viewMatrix * mvPosition;", + "#elif defined(VERTICAL)", + " vec4 mvPosition = modelMatrix * vec4( offset, 1.0 );", + " mvPosition.y += rotatedPosition.y;", + " mvPosition = viewMatrix * mvPosition;", + " mvPosition.x += rotatedPosition.x;", + "#else", + " vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );", + " mvPosition.xy += rotatedPosition;", + "#endif", + "", + "\tvColor = color;", + "", + "\tgl_Position = projectionMatrix * mvPosition;", + "", + "\t#include ", + "\t#include ", + "", + "}", + "`;", + "", + "var local_particle_vert = `", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "attribute vec3 offset;", + "attribute vec4 rotation;", + "attribute float size;", + "// attribute vec4 color;", + "attribute float uvTile;", + "", + "#ifdef UV_TILE", + "uniform vec2 tileCount;", + "#endif", + "", + "void main() {", + "", + " ${uv_vertex_tile}", + " ", + " float x2 = rotation.x + rotation.x, y2 = rotation.y + rotation.y, z2 = rotation.z + rotation.z;", + " float xx = rotation.x * x2, xy = rotation.x * y2, xz = rotation.x * z2;", + " float yy = rotation.y * y2, yz = rotation.y * z2, zz = rotation.z * z2;", + " float wx = rotation.w * x2, wy = rotation.w * y2, wz = rotation.w * z2;", + " float sx = size, sy = size, sz = size;", + " ", + " mat4 matrix = mat4(( 1.0 - ( yy + zz ) ) * sx, ( xy + wz ) * sx, ( xz - wy ) * sx, 0.0, // 1. column", + " ( xy - wz ) * sy, ( 1.0 - ( xx + zz ) ) * sy, ( yz + wx ) * sy, 0.0, // 2. column", + " ( xz + wy ) * sz, ( yz - wx ) * sz, ( 1.0 - ( xx + yy ) ) * sz, 0.0, // 3. column", + " offset.x, offset.y, offset.z, 1.0);", + " ", + " vec4 mvPosition = modelViewMatrix * (matrix * vec4( position, 1.0 ));", + "", + "\tvColor = color;", + "", + "\tgl_Position = projectionMatrix * mvPosition;", + "", + "\t#include ", + "\t#include ", + "", + "}", + "`;", + "", + "var local_particle_physics_vert = `", + "#define STANDARD", + "varying vec3 vViewPosition;", + "#ifdef USE_TRANSMISSION", + "\tvarying vec3 vWorldPosition;", + "#endif", + "#include ", + "#include ", + "", + "attribute vec3 offset;", + "attribute vec4 rotation;", + "attribute float size;", + "attribute float uvTile;", + "", + "#ifdef UV_TILE", + "uniform vec2 tileCount;", + "#endif", + "", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "void main() {", + " ${uv_vertex_tile}", + "", + " float x2 = rotation.x + rotation.x, y2 = rotation.y + rotation.y, z2 = rotation.z + rotation.z;", + " float xx = rotation.x * x2, xy = rotation.x * y2, xz = rotation.x * z2;", + " float yy = rotation.y * y2, yz = rotation.y * z2, zz = rotation.z * z2;", + " float wx = rotation.w * x2, wy = rotation.w * y2, wz = rotation.w * z2;", + " float sx = size, sy = size, sz = size;", + "", + " mat4 particleMatrix = mat4(( 1.0 - ( yy + zz ) ) * sx, ( xy + wz ) * sx, ( xz - wy ) * sx, 0.0, // 1. column", + " ( xy - wz ) * sy, ( 1.0 - ( xx + zz ) ) * sy, ( yz + wx ) * sy, 0.0, // 2. column", + " ( xz + wy ) * sz, ( yz - wx ) * sz, ( 1.0 - ( xx + yy ) ) * sz, 0.0, // 3. column", + " offset.x, offset.y, offset.z, 1.0);", + "", + "\t#include ", + "\t#include ", + "\t#include ", + "\t#include ", + "\t#include ", + "\t#include ", + "", + "\t// replace defaultnormal_vertex", + "\tvec3 transformedNormal = objectNormal;", + " mat3 m = mat3( particleMatrix );", + " transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );", + " transformedNormal = m * transformedNormal;", + " transformedNormal = normalMatrix * transformedNormal;", + " #ifdef FLIP_SIDED", + " transformedNormal = - transformedNormal;", + " #endif", + " #ifdef USE_TANGENT", + " vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;", + " #ifdef FLIP_SIDED", + " transformedTangent = - transformedTangent;", + " #endif", + " #endif", + "", + "\t#include ", + "\t#include ", + "\t#include ", + "\t#include ", + "\t#include ", + "", + "\t// replace include ", + " vec4 mvPosition = vec4( transformed, 1.0 );", + " mvPosition = modelViewMatrix * (particleMatrix * mvPosition);", + "\tgl_Position = projectionMatrix * mvPosition;", + "", + "\t#include ", + "\t#include ", + "\t", + "\tvViewPosition = - mvPosition.xyz;", + "\t", + "\t#include ", + "\t#include ", + "\t#include ", + "#ifdef USE_TRANSMISSION", + "\tvWorldPosition = worldPosition.xyz;", + "#endif", + "}", + "`;", + "", + "var stretched_bb_particle_vert = `", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "attribute vec3 offset;", + "attribute float rotation;", + "attribute float size;", + "attribute vec4 velocity;", + "attribute float uvTile;", + "", + "#ifdef UV_TILE", + "uniform vec2 tileCount;", + "#endif", + "", + "uniform float speedFactor;", + "", + "void main() {", + "", + " ${uv_vertex_tile}", + " ", + " float lengthFactor = velocity.w;", + "#ifdef USE_SKEW", + " vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );", + " vec3 viewVelocity = normalMatrix * velocity.xyz;", + "", + " vec3 scaledPos = vec3(position.xy * size, position.z);", + " float vlength = length(viewVelocity);", + " vec3 projVelocity = dot(scaledPos, viewVelocity) * viewVelocity / vlength;", + " mvPosition.xyz += scaledPos + projVelocity * (speedFactor / size + lengthFactor / vlength);", + "#else", + " vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );", + " vec3 viewVelocity = normalMatrix * velocity.xyz;", + " float vlength = length(viewVelocity); ", + " mvPosition.xyz += position.y * normalize(cross(mvPosition.xyz, viewVelocity)) * size; // switch the cross to match unity implementation", + " mvPosition.xyz -= (position.x + 0.5) * viewVelocity * (1.0 + lengthFactor / vlength) * size; // minus position.x to match unity implementation", + "#endif", + "\tvColor = color;", + "\tgl_Position = projectionMatrix * mvPosition;", + "\t#include ", + "\t#include ", + "}", + "`;", + "", + "function getMaterialUVChannelName(value) {", + " if (value === 0)", + " return 'uv';", + " return `uv${value}`;", + "}", + "", + "new THREE.Vector3(0, 0, 1);", + "class SpriteBatch extends VFXBatch {", + " constructor(settings) {", + " super(settings);", + " this.vector_ = new THREE.Vector3();", + " this.vector2_ = new THREE.Vector3();", + " this.vector3_ = new THREE.Vector3();", + " this.quaternion_ = new THREE.Quaternion();", + " this.quaternion2_ = new THREE.Quaternion();", + " this.quaternion3_ = new THREE.Quaternion();", + " this.rotationMat_ = new THREE.Matrix3();", + " this.rotationMat2_ = new THREE.Matrix3();", + " this.maxParticles = 1000;", + " this.setupBuffers();", + " this.rebuildMaterial();", + " }", + " buildExpandableBuffers() {", + " this.offsetBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 3), 3);", + " this.offsetBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('offset', this.offsetBuffer);", + " this.colorBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 4), 4);", + " this.colorBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('color', this.colorBuffer);", + " if (this.settings.renderMode === RenderMode.Mesh) {", + " this.rotationBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 4), 4);", + " this.rotationBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('rotation', this.rotationBuffer);", + " }", + " else if (this.settings.renderMode === RenderMode.BillBoard ||", + " this.settings.renderMode === RenderMode.HorizontalBillBoard ||", + " this.settings.renderMode === RenderMode.VerticalBillBoard ||", + " this.settings.renderMode === RenderMode.StretchedBillBoard) {", + " this.rotationBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles), 1);", + " this.rotationBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('rotation', this.rotationBuffer);", + " }", + " this.sizeBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles), 1);", + " this.sizeBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('size', this.sizeBuffer);", + " this.uvTileBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles), 1);", + " this.uvTileBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('uvTile', this.uvTileBuffer);", + " if (this.settings.renderMode === RenderMode.StretchedBillBoard) {", + " this.velocityBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 4), 4);", + " this.velocityBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('velocity', this.velocityBuffer);", + " }", + " }", + " setupBuffers() {", + " if (this.geometry)", + " this.geometry.dispose();", + " this.geometry = new THREE.InstancedBufferGeometry();", + " this.geometry.setIndex(this.settings.instancingGeometry.getIndex());", + " if (this.settings.instancingGeometry.hasAttribute('normal')) {", + " this.geometry.setAttribute('normal', this.settings.instancingGeometry.getAttribute('normal'));", + " }", + " this.geometry.setAttribute('position', this.settings.instancingGeometry.getAttribute('position'));", + " this.geometry.setAttribute('uv', this.settings.instancingGeometry.getAttribute('uv'));", + " this.buildExpandableBuffers();", + " }", + " expandBuffers(target) {", + " while (target >= this.maxParticles) {", + " this.maxParticles *= 2;", + " }", + " this.setupBuffers();", + " }", + " rebuildMaterial() {", + " this.layers.mask = this.settings.layers.mask;", + " let uniforms;", + " const defines = {};", + " if (this.settings.material.type === 'MeshStandardMaterial' ||", + " this.settings.material.type === 'MeshPhysicalMaterial') {", + " const mat = this.settings.material;", + " uniforms = THREE.UniformsUtils.merge([", + " THREE.UniformsLib.common,", + " THREE.UniformsLib.envmap,", + " THREE.UniformsLib.aomap,", + " THREE.UniformsLib.lightmap,", + " THREE.UniformsLib.emissivemap,", + " THREE.UniformsLib.bumpmap,", + " THREE.UniformsLib.normalmap,", + " THREE.UniformsLib.displacementmap,", + " THREE.UniformsLib.roughnessmap,", + " THREE.UniformsLib.metalnessmap,", + " THREE.UniformsLib.fog,", + " THREE.UniformsLib.lights,", + " {", + " emissive: { value: new THREE.Color(0x000000) },", + " roughness: { value: 1.0 },", + " metalness: { value: 0.0 },", + " envMapIntensity: { value: 1 },", + " },", + " ]);", + " uniforms['diffuse'].value = mat.color;", + " uniforms['opacity'].value = mat.opacity;", + " uniforms['emissive'].value = mat.emissive;", + " uniforms['roughness'].value = mat.roughness;", + " uniforms['metalness'].value = mat.metalness;", + " if (mat.envMap) {", + " uniforms['envMap'].value = mat.envMap;", + " uniforms['envMapIntensity'].value = mat.envMapIntensity;", + " }", + " if (mat.normalMap) {", + " uniforms['normalMap'].value = mat.normalMap;", + " uniforms['normalScale'].value = mat.normalScale;", + " }", + " if (mat.roughnessMap) {", + " uniforms['roughnessMap'].value = mat.roughnessMap;", + " }", + " if (mat.metalnessMap) {", + " uniforms['metalnessMap'].value = mat.metalnessMap;", + " }", + " if (mat.map) {", + " uniforms['map'] = new THREE.Uniform(mat.map);", + " }", + " }", + " else {", + " uniforms = {};", + " uniforms['map'] = new THREE.Uniform(this.settings.material.map);", + " }", + " if (this.settings.material.alphaTest) {", + " defines['USE_ALPHATEST'] = '';", + " uniforms['alphaTest'] = new THREE.Uniform(this.settings.material.alphaTest);", + " }", + " defines['USE_UV'] = '';", + " const uTileCount = this.settings.uTileCount;", + " const vTileCount = this.settings.vTileCount;", + " if (uTileCount > 1 || vTileCount > 1) {", + " defines['UV_TILE'] = '';", + " uniforms['tileCount'] = new THREE.Uniform(new THREE.Vector2(uTileCount, vTileCount));", + " }", + " if (this.settings.material.defines &&", + " this.settings.material.defines['USE_COLOR_AS_ALPHA'] !== undefined) {", + " defines['USE_COLOR_AS_ALPHA'] = '';", + " }", + " if (this.settings.material.normalMap) {", + " defines['USE_NORMALMAP'] = '';", + " defines['NORMALMAP_UV'] = getMaterialUVChannelName(this.settings.material.normalMap.channel);", + " uniforms['normalMapTransform'] = new THREE.Uniform(new THREE.Matrix3().copy(this.settings.material.normalMap.matrix));", + " }", + " if (this.settings.material.map) {", + " defines['USE_MAP'] = '';", + " defines['MAP_UV'] = getMaterialUVChannelName(this.settings.material.map.channel);", + " uniforms['mapTransform'] = new THREE.Uniform(new THREE.Matrix3().copy(this.settings.material.map.matrix));", + " }", + " defines['USE_COLOR_ALPHA'] = '';", + " let needLights = false;", + " if (this.settings.renderMode === RenderMode.BillBoard ||", + " this.settings.renderMode === RenderMode.VerticalBillBoard ||", + " this.settings.renderMode === RenderMode.HorizontalBillBoard ||", + " this.settings.renderMode === RenderMode.Mesh) {", + " let vertexShader;", + " let fragmentShader;", + " if (this.settings.renderMode === RenderMode.Mesh) {", + " if (this.settings.material.type === 'MeshStandardMaterial' ||", + " this.settings.material.type === 'MeshPhysicalMaterial') {", + " defines['USE_COLOR'] = '';", + " vertexShader = local_particle_physics_vert;", + " fragmentShader = particle_physics_frag;", + " needLights = true;", + " }", + " else {", + " vertexShader = local_particle_vert;", + " fragmentShader = particle_frag;", + " }", + " }", + " else {", + " vertexShader = particle_vert;", + " fragmentShader = particle_frag;", + " }", + " if (this.settings.renderMode === RenderMode.VerticalBillBoard) {", + " defines['VERTICAL'] = '';", + " }", + " else if (this.settings.renderMode === RenderMode.HorizontalBillBoard) {", + " defines['HORIZONTAL'] = '';", + " }", + " this.material = new THREE.ShaderMaterial({", + " uniforms: uniforms,", + " defines: defines,", + " vertexShader: vertexShader,", + " fragmentShader: fragmentShader,", + " transparent: this.settings.material.transparent,", + " depthWrite: !this.settings.material.transparent,", + " blending: this.settings.material.blending,", + " side: this.settings.material.side,", + " alphaTest: this.settings.material.alphaTest,", + " lights: needLights,", + " });", + " }", + " else if (this.settings.renderMode === RenderMode.StretchedBillBoard) {", + " uniforms['speedFactor'] = new THREE.Uniform(1.0);", + " this.material = new THREE.ShaderMaterial({", + " uniforms: uniforms,", + " defines: defines,", + " vertexShader: stretched_bb_particle_vert,", + " fragmentShader: particle_frag,", + " transparent: this.settings.material.transparent,", + " depthWrite: !this.settings.material.transparent,", + " blending: this.settings.material.blending,", + " side: this.settings.material.side,", + " alphaTest: this.settings.material.alphaTest,", + " });", + " }", + " else {", + " throw new Error('render mode unavailable');", + " }", + " }", + " update() {", + " let index = 0;", + " let particleCount = 0;", + " this.systems.forEach((system) => {", + " particleCount += system.particleNum;", + " });", + " if (particleCount > this.maxParticles) {", + " this.expandBuffers(particleCount);", + " }", + " this.systems.forEach((system) => {", + " const particles = system.particles;", + " const particleNum = system.particleNum;", + " const rotation = this.quaternion2_;", + " const translation = this.vector2_;", + " const scale = this.vector3_;", + " system.emitter.matrixWorld.decompose(translation, rotation, scale);", + " this.rotationMat_.setFromMatrix4(system.emitter.matrixWorld);", + " for (let j = 0; j < particleNum; j++ , index++) {", + " const particle = particles[j];", + " if (this.settings.renderMode === RenderMode.Mesh) {", + " let q;", + " if (system.worldSpace) {", + " q = particle.rotation;", + " }", + " else {", + " let parentQ;", + " if (particle.parentMatrix) {", + " parentQ = this.quaternion3_.setFromRotationMatrix(particle.parentMatrix);", + " }", + " else {", + " parentQ = rotation;", + " }", + " q = this.quaternion_;", + " q.copy(particle.rotation).multiply(parentQ);", + " }", + " this.rotationBuffer.setXYZW(index, q.x, q.y, q.z, q.w);", + " }", + " else if (this.settings.renderMode === RenderMode.StretchedBillBoard ||", + " this.settings.renderMode === RenderMode.VerticalBillBoard ||", + " this.settings.renderMode === RenderMode.HorizontalBillBoard ||", + " this.settings.renderMode === RenderMode.BillBoard) {", + " this.rotationBuffer.setX(index, particle.rotation);", + " }", + " let vec;", + " if (system.worldSpace) {", + " vec = particle.position;", + " }", + " else {", + " vec = this.vector_;", + " if (particle.parentMatrix) {", + " vec.copy(particle.position).applyMatrix4(particle.parentMatrix);", + " }", + " else {", + " vec.copy(particle.position).applyMatrix4(system.emitter.matrixWorld);", + " }", + " }", + " this.offsetBuffer.setXYZ(index, vec.x, vec.y, vec.z);", + " this.colorBuffer.setXYZW(index, particle.color.x, particle.color.y, particle.color.z, particle.color.w);", + " if (system.worldSpace) {", + " this.sizeBuffer.setX(index, particle.size);", + " }", + " else {", + " if (particle.parentMatrix) {", + " this.sizeBuffer.setX(index, particle.size);", + " }", + " else {", + " this.sizeBuffer.setX(index, (particle.size * (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z))) / 3);", + " }", + " }", + " this.uvTileBuffer.setX(index, particle.uvTile);", + " if (this.settings.renderMode === RenderMode.StretchedBillBoard && this.velocityBuffer) {", + " let speedFactor = system.rendererEmitterSettings.speedFactor;", + " if (speedFactor === 0)", + " speedFactor = 0.001;", + " const lengthFactor = system.rendererEmitterSettings.lengthFactor;", + " let vec;", + " if (system.worldSpace) {", + " vec = particle.velocity;", + " }", + " else {", + " vec = this.vector_;", + " if (particle.parentMatrix) {", + " this.rotationMat2_.setFromMatrix4(particle.parentMatrix);", + " vec.copy(particle.velocity).applyMatrix3(this.rotationMat2_);", + " }", + " else {", + " vec.copy(particle.velocity).applyMatrix3(this.rotationMat_);", + " }", + " }", + " this.velocityBuffer.setXYZW(index, vec.x * speedFactor, vec.y * speedFactor, vec.z * speedFactor, lengthFactor);", + " }", + " }", + " });", + " this.geometry.instanceCount = index;", + " if (index > 0) {", + " this.offsetBuffer.clearUpdateRanges();", + " this.offsetBuffer.addUpdateRange(0, index * 3);", + " this.offsetBuffer.needsUpdate = true;", + " this.sizeBuffer.clearUpdateRanges();", + " this.sizeBuffer.addUpdateRange(0, index);", + " this.sizeBuffer.needsUpdate = true;", + " this.colorBuffer.clearUpdateRanges();", + " this.colorBuffer.addUpdateRange(0, index * 4);", + " this.colorBuffer.needsUpdate = true;", + " this.uvTileBuffer.clearUpdateRanges();", + " this.uvTileBuffer.addUpdateRange(0, index);", + " this.uvTileBuffer.needsUpdate = true;", + " if (this.settings.renderMode === RenderMode.StretchedBillBoard && this.velocityBuffer) {", + " this.velocityBuffer.clearUpdateRanges();", + " this.velocityBuffer.addUpdateRange(0, index * 4);", + " this.velocityBuffer.needsUpdate = true;", + " }", + " if (this.settings.renderMode === RenderMode.Mesh) {", + " this.rotationBuffer.clearUpdateRanges();", + " this.rotationBuffer.addUpdateRange(0, index * 4);", + " this.rotationBuffer.needsUpdate = true;", + " }", + " else if (this.settings.renderMode === RenderMode.StretchedBillBoard ||", + " this.settings.renderMode === RenderMode.HorizontalBillBoard ||", + " this.settings.renderMode === RenderMode.VerticalBillBoard ||", + " this.settings.renderMode === RenderMode.BillBoard) {", + " this.rotationBuffer.clearUpdateRanges();", + " this.rotationBuffer.addUpdateRange(0, index);", + " this.rotationBuffer.needsUpdate = true;", + " }", + " }", + " }", + " dispose() {", + " this.geometry.dispose();", + " }", + "}", + "", + "var trail_frag = `", + "", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "uniform sampler2D alphaMap;", + "uniform float useAlphaMap;", + "uniform float visibility;", + "uniform float alphaTest;", + "uniform vec2 repeat;", + "", + "varying vec4 vColor;", + " ", + "void main() {", + " #include ", + " #include ", + "", + " vec4 c = vColor;", + " ", + " #ifdef USE_MAP", + " #ifdef USE_COLOR_AS_ALPHA", + " vec4 tex = texture2D( map, vUv * repeat );", + " c *= vec4(tex.rgb, tex.r);", + " #else", + " c *= texture2D( map, vUv * repeat );", + " #endif", + " #endif", + " if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUv * repeat ).a;", + " if( c.a < alphaTest ) discard;", + " gl_FragColor = c;", + "", + " #include ", + " #include ", + "}`;", + "", + "var trail_vert = `", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "attribute vec3 previous;", + "attribute vec3 next;", + "attribute float side;", + "attribute float width;", + "", + "uniform vec2 resolution;", + "uniform float lineWidth;", + "uniform float sizeAttenuation;", + " ", + "vec2 fix(vec4 i, float aspect) {", + " vec2 res = i.xy / i.w;", + " res.x *= aspect;", + " return res;", + "}", + " ", + "void main() {", + "", + " ${uv_vertex_tile}", + " ", + " float aspect = resolution.x / resolution.y;", + "", + " vColor = color;", + "", + " mat4 m = projectionMatrix * modelViewMatrix;", + " vec4 finalPosition = m * vec4( position, 1.0 );", + " vec4 prevPos = m * vec4( previous, 1.0 );", + " vec4 nextPos = m * vec4( next, 1.0 );", + "", + " vec2 currentP = fix( finalPosition, aspect );", + " vec2 prevP = fix( prevPos, aspect );", + " vec2 nextP = fix( nextPos, aspect );", + "", + " float w = lineWidth * width;", + "", + " vec2 dir;", + " if( nextP == currentP ) dir = normalize( currentP - prevP );", + " else if( prevP == currentP ) dir = normalize( nextP - currentP );", + " else {", + " vec2 dir1 = normalize( currentP - prevP );", + " vec2 dir2 = normalize( nextP - currentP );", + " dir = normalize( dir1 + dir2 );", + "", + " vec2 perp = vec2( -dir1.y, dir1.x );", + " vec2 miter = vec2( -dir.y, dir.x );", + " //w = clamp( w / dot( miter, perp ), 0., 4., * lineWidth * width );", + "", + " }", + "", + " //vec2 normal = ( cross( vec3( dir, 0. ) vec3( 0., 0., 1. ) ) ).xy;", + " vec4 normal = vec4( -dir.y, dir.x, 0., 1. );", + " normal.xy *= .5 * w;", + " normal *= projectionMatrix;", + " if( sizeAttenuation == 0. ) {", + " normal.xy *= finalPosition.w;", + " normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;", + " }", + "", + " finalPosition.xy += normal.xy * side;", + "", + " gl_Position = finalPosition;", + "", + "\t#include ", + "\t#include ", + "\t", + " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", + " ", + "\t#include ", + "}`;", + "", + "new THREE.Vector3(0, 0, 1);", + "class TrailBatch extends VFXBatch {", + " constructor(settings) {", + " super(settings);", + " this.vector_ = new THREE.Vector3();", + " this.vector2_ = new THREE.Vector3();", + " this.vector3_ = new THREE.Vector3();", + " this.quaternion_ = new THREE.Quaternion();", + " this.maxParticles = 10000;", + " this.setupBuffers();", + " this.rebuildMaterial();", + " }", + " setupBuffers() {", + " if (this.geometry)", + " this.geometry.dispose();", + " this.geometry = new THREE.BufferGeometry();", + " this.indexBuffer = new THREE.BufferAttribute(new Uint32Array(this.maxParticles * 6), 1);", + " this.indexBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setIndex(this.indexBuffer);", + " this.positionBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 6), 3);", + " this.positionBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('position', this.positionBuffer);", + " this.previousBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 6), 3);", + " this.previousBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('previous', this.previousBuffer);", + " this.nextBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 6), 3);", + " this.nextBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('next', this.nextBuffer);", + " this.widthBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 2), 1);", + " this.widthBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('width', this.widthBuffer);", + " this.sideBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 2), 1);", + " this.sideBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('side', this.sideBuffer);", + " this.uvBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 4), 2);", + " this.uvBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('uv', this.uvBuffer);", + " this.colorBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 8), 4);", + " this.colorBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('color', this.colorBuffer);", + " }", + " expandBuffers(target) {", + " while (target >= this.maxParticles) {", + " this.maxParticles *= 2;", + " }", + " this.setupBuffers();", + " }", + " rebuildMaterial() {", + " this.layers.mask = this.settings.layers.mask;", + " const uniforms = {", + " lineWidth: { value: 1 },", + " map: { value: null },", + " useMap: { value: 0 },", + " alphaMap: { value: null },", + " useAlphaMap: { value: 0 },", + " resolution: { value: new THREE.Vector2(1, 1) },", + " sizeAttenuation: { value: 1 },", + " visibility: { value: 1 },", + " alphaTest: { value: 0 },", + " repeat: { value: new THREE.Vector2(1, 1) },", + " };", + " const defines = {};", + " defines['USE_UV'] = '';", + " defines['USE_COLOR_ALPHA'] = '';", + " if (this.settings.material.map) {", + " defines['USE_MAP'] = '';", + " defines['MAP_UV'] = getMaterialUVChannelName(this.settings.material.map.channel);", + " uniforms['map'] = new THREE.Uniform(this.settings.material.map);", + " uniforms['mapTransform'] = new THREE.Uniform(new THREE.Matrix3().copy(this.settings.material.map.matrix));", + " }", + " if (this.settings.material.defines &&", + " this.settings.material.defines['USE_COLOR_AS_ALPHA'] !== undefined) {", + " defines['USE_COLOR_AS_ALPHA'] = '';", + " }", + " if (this.settings.renderMode === RenderMode.Trail) {", + " this.material = new THREE.ShaderMaterial({", + " uniforms: uniforms,", + " defines: defines,", + " vertexShader: trail_vert,", + " fragmentShader: trail_frag,", + " transparent: this.settings.material.transparent,", + " depthWrite: !this.settings.material.transparent,", + " side: this.settings.material.side,", + " blending: this.settings.material.blending || THREE.AdditiveBlending,", + " });", + " }", + " else {", + " throw new Error('render mode unavailable');", + " }", + " }", + " update() {", + " let index = 0;", + " let triangles = 0;", + " let particleCount = 0;", + " this.systems.forEach((system) => {", + " for (let j = 0; j < system.particleNum; j++) {", + " particleCount += system.particles[j].previous.length * 2;", + " }", + " });", + " if (particleCount > this.maxParticles) {", + " this.expandBuffers(particleCount);", + " }", + " this.systems.forEach((system) => {", + " const rotation = this.quaternion_;", + " const translation = this.vector2_;", + " const scale = this.vector3_;", + " system.emitter.matrixWorld.decompose(translation, rotation, scale);", + " const particles = system.particles;", + " const particleNum = system.particleNum;", + " const uTileCount = this.settings.uTileCount;", + " const vTileCount = this.settings.vTileCount;", + " const tileWidth = 1 / uTileCount;", + " const tileHeight = 1 / vTileCount;", + " for (let j = 0; j < particleNum; j++) {", + " const particle = particles[j];", + " const col = particle.uvTile % vTileCount;", + " const row = Math.floor(particle.uvTile / vTileCount + 0.001);", + " const iter = particle.previous.values();", + " let curIter = iter.next();", + " let previous = curIter.value;", + " let current = previous;", + " if (!curIter.done)", + " curIter = iter.next();", + " let next;", + " if (curIter.value !== undefined) {", + " next = curIter.value;", + " }", + " else {", + " next = current;", + " }", + " for (let i = 0; i < particle.previous.length; i++ , index += 2) {", + " this.positionBuffer.setXYZ(index, current.position.x, current.position.y, current.position.z);", + " this.positionBuffer.setXYZ(index + 1, current.position.x, current.position.y, current.position.z);", + " if (system.worldSpace) {", + " this.positionBuffer.setXYZ(index, current.position.x, current.position.y, current.position.z);", + " this.positionBuffer.setXYZ(index + 1, current.position.x, current.position.y, current.position.z);", + " }", + " else {", + " if (particle.parentMatrix) {", + " this.vector_.copy(current.position).applyMatrix4(particle.parentMatrix);", + " }", + " else {", + " this.vector_.copy(current.position).applyMatrix4(system.emitter.matrixWorld);", + " }", + " this.positionBuffer.setXYZ(index, this.vector_.x, this.vector_.y, this.vector_.z);", + " this.positionBuffer.setXYZ(index + 1, this.vector_.x, this.vector_.y, this.vector_.z);", + " }", + " if (system.worldSpace) {", + " this.previousBuffer.setXYZ(index, previous.position.x, previous.position.y, previous.position.z);", + " this.previousBuffer.setXYZ(index + 1, previous.position.x, previous.position.y, previous.position.z);", + " }", + " else {", + " if (particle.parentMatrix) {", + " this.vector_.copy(previous.position).applyMatrix4(particle.parentMatrix);", + " }", + " else {", + " this.vector_.copy(previous.position).applyMatrix4(system.emitter.matrixWorld);", + " }", + " this.previousBuffer.setXYZ(index, this.vector_.x, this.vector_.y, this.vector_.z);", + " this.previousBuffer.setXYZ(index + 1, this.vector_.x, this.vector_.y, this.vector_.z);", + " }", + " if (system.worldSpace) {", + " this.nextBuffer.setXYZ(index, next.position.x, next.position.y, next.position.z);", + " this.nextBuffer.setXYZ(index + 1, next.position.x, next.position.y, next.position.z);", + " }", + " else {", + " if (particle.parentMatrix) {", + " this.vector_.copy(next.position).applyMatrix4(particle.parentMatrix);", + " }", + " else {", + " this.vector_.copy(next.position).applyMatrix4(system.emitter.matrixWorld);", + " }", + " this.nextBuffer.setXYZ(index, this.vector_.x, this.vector_.y, this.vector_.z);", + " this.nextBuffer.setXYZ(index + 1, this.vector_.x, this.vector_.y, this.vector_.z);", + " }", + " this.sideBuffer.setX(index, -1);", + " this.sideBuffer.setX(index + 1, 1);", + " if (system.worldSpace) {", + " this.widthBuffer.setX(index, current.size);", + " this.widthBuffer.setX(index + 1, current.size);", + " }", + " else {", + " if (particle.parentMatrix) {", + " this.widthBuffer.setX(index, current.size);", + " this.widthBuffer.setX(index + 1, current.size);", + " }", + " else {", + " const objectScale = (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z)) / 3;", + " this.widthBuffer.setX(index, current.size * objectScale);", + " this.widthBuffer.setX(index + 1, current.size * objectScale);", + " }", + " }", + " this.uvBuffer.setXY(index, (i / particle.previous.length + col) * tileWidth, (vTileCount - row - 1) * tileHeight);", + " this.uvBuffer.setXY(index + 1, (i / particle.previous.length + col) * tileWidth, (vTileCount - row) * tileHeight);", + " this.colorBuffer.setXYZW(index, current.color.x, current.color.y, current.color.z, current.color.w);", + " this.colorBuffer.setXYZW(index + 1, current.color.x, current.color.y, current.color.z, current.color.w);", + " if (i + 1 < particle.previous.length) {", + " this.indexBuffer.setX(triangles * 3, index);", + " this.indexBuffer.setX(triangles * 3 + 1, index + 1);", + " this.indexBuffer.setX(triangles * 3 + 2, index + 2);", + " triangles++;", + " this.indexBuffer.setX(triangles * 3, index + 2);", + " this.indexBuffer.setX(triangles * 3 + 1, index + 1);", + " this.indexBuffer.setX(triangles * 3 + 2, index + 3);", + " triangles++;", + " }", + " previous = current;", + " current = next;", + " if (!curIter.done) {", + " curIter = iter.next();", + " if (curIter.value !== undefined) {", + " next = curIter.value;", + " }", + " }", + " }", + " }", + " });", + " this.positionBuffer.clearUpdateRanges();", + " this.positionBuffer.addUpdateRange(0, index * 3);", + " this.positionBuffer.needsUpdate = true;", + " this.previousBuffer.clearUpdateRanges();", + " this.previousBuffer.addUpdateRange(0, index * 3);", + " this.previousBuffer.needsUpdate = true;", + " this.nextBuffer.clearUpdateRanges();", + " this.nextBuffer.addUpdateRange(0, index * 3);", + " this.nextBuffer.needsUpdate = true;", + " this.sideBuffer.clearUpdateRanges();", + " this.sideBuffer.addUpdateRange(0, index);", + " this.sideBuffer.needsUpdate = true;", + " this.widthBuffer.clearUpdateRanges();", + " this.widthBuffer.addUpdateRange(0, index);", + " this.widthBuffer.needsUpdate = true;", + " this.uvBuffer.clearUpdateRanges();", + " this.uvBuffer.addUpdateRange(0, index * 2);", + " this.uvBuffer.needsUpdate = true;", + " this.colorBuffer.clearUpdateRanges();", + " this.colorBuffer.addUpdateRange(0, index * 4);", + " this.colorBuffer.needsUpdate = true;", + " this.indexBuffer.clearUpdateRanges();", + " this.indexBuffer.addUpdateRange(0, triangles * 3);", + " this.indexBuffer.needsUpdate = true;", + " this.geometry.setDrawRange(0, triangles * 3);", + " }", + " dispose() {", + " this.geometry.dispose();", + " }", + "}", + "", + "class BatchedRenderer extends THREE.Object3D {", + " constructor() {", + " super();", + " this.batches = [];", + " this.systemToBatchIndex = new Map();", + " this.type = 'BatchedRenderer';", + " }", + " static equals(a, b) {", + " return (a.material.side === b.material.side &&", + " a.material.blending === b.material.blending &&", + " a.material.transparent === b.material.transparent &&", + " a.material.type === b.material.type &&", + " a.material.alphaTest === b.material.alphaTest &&", + " a.material.map === b.material.map &&", + " a.renderMode === b.renderMode &&", + " a.uTileCount === b.uTileCount &&", + " a.vTileCount === b.vTileCount &&", + " a.instancingGeometry === b.instancingGeometry &&", + " a.renderOrder === b.renderOrder &&", + " a.layers.mask === b.layers.mask);", + " }", + " addSystem(system) {", + " system._renderer = this;", + " const settings = system.getRendererSettings();", + " for (let i = 0; i < this.batches.length; i++) {", + " if (BatchedRenderer.equals(this.batches[i].settings, settings)) {", + " this.batches[i].addSystem(system);", + " this.systemToBatchIndex.set(system, i);", + " return;", + " }", + " }", + " let batch;", + " switch (settings.renderMode) {", + " case RenderMode.Trail:", + " batch = new TrailBatch(settings);", + " break;", + " case RenderMode.Mesh:", + " case RenderMode.BillBoard:", + " case RenderMode.VerticalBillBoard:", + " case RenderMode.HorizontalBillBoard:", + " case RenderMode.StretchedBillBoard:", + " batch = new SpriteBatch(settings);", + " break;", + " }", + " batch.addSystem(system);", + " this.batches.push(batch);", + " this.systemToBatchIndex.set(system, this.batches.length - 1);", + " this.add(batch);", + " }", + " deleteSystem(system) {", + " const batchIndex = this.systemToBatchIndex.get(system);", + " if (batchIndex != undefined) {", + " this.batches[batchIndex].removeSystem(system);", + " this.systemToBatchIndex.delete(system);", + " }", + " }", + " updateSystem(system) {", + " this.deleteSystem(system);", + " this.addSystem(system);", + " }", + " update(delta) {", + " this.systemToBatchIndex.forEach((value, ps) => {", + " ps.update(delta);", + " });", + " for (let i = 0; i < this.batches.length; i++) {", + " this.batches[i].update();", + " }", + " }", + "}", + "", + "const BatchedParticleRenderer = BatchedRenderer;", + "", + "class QuarksLoader extends THREE.ObjectLoader {", + " constructor(manager) {", + " super(manager);", + " }", + " linkReference(object) {", + " const objectsMap = {};", + " object.traverse(function (child) {", + " objectsMap[child.uuid] = child;", + " });", + " object.traverse(function (child) {", + " if (child.type === 'ParticleEmitter') {", + " const system = child.system;", + " system.emitterShape;", + " for (let i = 0; i < system.behaviors.length; i++) {", + " if (system.behaviors[i] instanceof EmitSubParticleSystem) {", + " system.behaviors[i].subParticleSystem = objectsMap[system.behaviors[i].subParticleSystem];", + " }", + " }", + " }", + " });", + " }", + " parse(json, onLoad) {", + " const object = super.parse(json, onLoad);", + " this.linkReference(object);", + " return object;", + " }", + " parseObject(data, geometries, materials, textures, animations) {", + " let object;", + " function getGeometry(name) {", + " if (geometries[name] === undefined) {", + " console.warn('THREE.ObjectLoader: Undefined geometry', name);", + " }", + " return geometries[name];", + " }", + " function getMaterial(name) {", + " if (name === undefined)", + " return undefined;", + " if (Array.isArray(name)) {", + " const array = [];", + " for (let i = 0, l = name.length; i < l; i++) {", + " const uuid = name[i];", + " if (materials[uuid] === undefined) {", + " console.warn('THREE.ObjectLoader: Undefined material', uuid);", + " }", + " array.push(materials[uuid]);", + " }", + " return array;", + " }", + " if (materials[name] === undefined) {", + " console.warn('THREE.ObjectLoader: Undefined material', name);", + " }", + " return materials[name];", + " }", + " function getTexture(uuid) {", + " if (textures[uuid] === undefined) {", + " console.warn('THREE.ObjectLoader: Undefined texture', uuid);", + " }", + " return textures[uuid];", + " }", + " let geometry, material;", + " const meta = {", + " textures: textures,", + " geometries: geometries,", + " materials: materials,", + " };", + " const dependencies = {};", + " switch (data.type) {", + " case 'ParticleEmitter':", + " object = ParticleSystem.fromJSON(data.ps, meta, dependencies).emitter;", + " break;", + " case 'Scene':", + " object = new THREE.Scene();", + " if (data.background !== undefined) {", + " if (Number.isInteger(data.background)) {", + " object.background = new THREE.Color(data.background);", + " }", + " else {", + " object.background = getTexture(data.background);", + " }", + " }", + " if (data.environment !== undefined) {", + " object.environment = getTexture(data.environment);", + " }", + " if (data.fog !== undefined) {", + " if (data.fog.type === 'Fog') {", + " object.fog = new THREE.Fog(data.fog.color, data.fog.near, data.fog.far);", + " }", + " else if (data.fog.type === 'FogExp2') {", + " object.fog = new THREE.FogExp2(data.fog.color, data.fog.density);", + " }", + " }", + " if (data.backgroundBlurriness !== undefined)", + " object.backgroundBlurriness = data.backgroundBlurriness;", + " break;", + " case 'PerspectiveCamera':", + " object = new THREE.PerspectiveCamera(data.fov, data.aspect, data.near, data.far);", + " if (data.focus !== undefined)", + " object.focus = data.focus;", + " if (data.zoom !== undefined)", + " object.zoom = data.zoom;", + " if (data.filmGauge !== undefined)", + " object.filmGauge = data.filmGauge;", + " if (data.filmOffset !== undefined)", + " object.filmOffset = data.filmOffset;", + " if (data.view !== undefined)", + " object.view = Object.assign({}, data.view);", + " break;", + " case 'OrthographicCamera':", + " object = new THREE.OrthographicCamera(data.left, data.right, data.top, data.bottom, data.near, data.far);", + " if (data.zoom !== undefined)", + " object.zoom = data.zoom;", + " if (data.view !== undefined)", + " object.view = Object.assign({}, data.view);", + " break;", + " case 'AmbientLight':", + " object = new THREE.AmbientLight(data.color, data.intensity);", + " break;", + " case 'DirectionalLight':", + " object = new THREE.DirectionalLight(data.color, data.intensity);", + " break;", + " case 'PointLight':", + " object = new THREE.PointLight(data.color, data.intensity, data.distance, data.decay);", + " break;", + " case 'RectAreaLight':", + " object = new THREE.RectAreaLight(data.color, data.intensity, data.width, data.height);", + " break;", + " case 'SpotLight':", + " object = new THREE.SpotLight(data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay);", + " break;", + " case 'HemisphereLight':", + " object = new THREE.HemisphereLight(data.color, data.groundColor, data.intensity);", + " break;", + " case 'LightProbe':", + " object = new THREE.LightProbe().fromJSON(data);", + " break;", + " case 'SkinnedMesh':", + " geometry = getGeometry(data.geometry);", + " material = getMaterial(data.material);", + " object = new THREE.SkinnedMesh(geometry, material);", + " if (data.bindMode !== undefined)", + " object.bindMode = data.bindMode;", + " if (data.bindMatrix !== undefined)", + " object.bindMatrix.fromArray(data.bindMatrix);", + " if (data.skeleton !== undefined)", + " object.skeleton = data.skeleton;", + " break;", + " case 'Mesh':", + " geometry = getGeometry(data.geometry);", + " material = getMaterial(data.material);", + " object = new THREE.Mesh(geometry, material);", + " break;", + " case 'InstancedMesh': {", + " geometry = getGeometry(data.geometry);", + " material = getMaterial(data.material);", + " const count = data.count;", + " const instanceMatrix = data.instanceMatrix;", + " const instanceColor = data.instanceColor;", + " object = new THREE.InstancedMesh(geometry, material, count);", + " object.instanceMatrix = new THREE.InstancedBufferAttribute(new Float32Array(instanceMatrix.array), 16);", + " if (instanceColor !== undefined)", + " object.instanceColor = new THREE.InstancedBufferAttribute(new Float32Array(instanceColor.array), instanceColor.itemSize);", + " break;", + " }", + " case 'LOD':", + " object = new THREE.LOD();", + " break;", + " case 'Line':", + " object = new THREE.Line(getGeometry(data.geometry), getMaterial(data.material));", + " break;", + " case 'LineLoop':", + " object = new THREE.LineLoop(getGeometry(data.geometry), getMaterial(data.material));", + " break;", + " case 'LineSegments':", + " object = new THREE.LineSegments(getGeometry(data.geometry), getMaterial(data.material));", + " break;", + " case 'PointCloud':", + " case 'Points':", + " object = new THREE.Points(getGeometry(data.geometry), getMaterial(data.material));", + " break;", + " case 'Sprite':", + " object = new THREE.Sprite(getMaterial(data.material));", + " break;", + " case 'Group':", + " object = new THREE.Group();", + " break;", + " case 'Bone':", + " object = new THREE.Bone();", + " break;", + " default:", + " object = new THREE.Object3D();", + " }", + " object.uuid = data.uuid;", + " if (data.name !== undefined)", + " object.name = data.name;", + " if (data.matrix !== undefined) {", + " object.matrix.fromArray(data.matrix);", + " if (data.matrixAutoUpdate !== undefined)", + " object.matrixAutoUpdate = data.matrixAutoUpdate;", + " if (object.matrixAutoUpdate)", + " object.matrix.decompose(object.position, object.quaternion, object.scale);", + " }", + " else {", + " if (data.position !== undefined)", + " object.position.fromArray(data.position);", + " if (data.rotation !== undefined)", + " object.rotation.fromArray(data.rotation);", + " if (data.quaternion !== undefined)", + " object.quaternion.fromArray(data.quaternion);", + " if (data.scale !== undefined)", + " object.scale.fromArray(data.scale);", + " }", + " if (data.castShadow !== undefined)", + " object.castShadow = data.castShadow;", + " if (data.receiveShadow !== undefined)", + " object.receiveShadow = data.receiveShadow;", + " if (data.shadow) {", + " if (data.shadow.bias !== undefined)", + " object.shadow.bias = data.shadow.bias;", + " if (data.shadow.normalBias !== undefined)", + " object.normalBias = data.shadow.normalBias;", + " if (data.shadow.radius !== undefined)", + " object.radius = data.shadow.radius;", + " if (data.shadow.mapSize !== undefined)", + " object.mapSize.fromArray(data.shadow.mapSize);", + " if (data.shadow.camera !== undefined) {", + " object.camera = this.parseObject(data.shadow.camera);", + " }", + " }", + " if (data.visible !== undefined)", + " object.visible = data.visible;", + " if (data.frustumCulled !== undefined)", + " object.frustumCulled = data.frustumCulled;", + " if (data.renderOrder !== undefined)", + " object.renderOrder = data.renderOrder;", + " if (data.userData !== undefined)", + " object.userData = data.userData;", + " if (data.layers !== undefined)", + " object.layers.mask = data.layers;", + " if (data.children !== undefined) {", + " const children = data.children;", + " for (let i = 0; i < children.length; i++) {", + " object.add(this.parseObject(children[i], geometries, materials, textures, animations));", + " }", + " }", + " if (data.animations !== undefined) {", + " const objectAnimations = data.animations;", + " for (let i = 0; i < objectAnimations.length; i++) {", + " const uuid = objectAnimations[i];", + " object.animations.push(animations[uuid]);", + " }", + " }", + " if (data.type === 'LOD') {", + " if (data.autoUpdate !== undefined)", + " object.autoUpdate = data.autoUpdate;", + " const levels = data.levels;", + " for (let l = 0; l < levels.length; l++) {", + " const level = levels[l];", + " const child = object.getObjectByProperty('uuid', level.object);", + " if (child !== undefined) {", + " object.addLevel(child, level.distance);", + " }", + " }", + " }", + " return object;", + " }", + "}", + "", + "const Plugins = [];", + "function loadPlugin(plugin) {", + " const existing = Plugins.find((item) => item.id === plugin.id);", + " if (!existing) {", + " plugin.initialize();", + " for (const emitterShape of plugin.emitterShapes) {", + " if (!EmitterShapes[emitterShape.type]) {", + " EmitterShapes[emitterShape.type] = emitterShape;", + " }", + " }", + " for (const behavior of plugin.behaviors) {", + " if (!BehaviorTypes[behavior.type]) {", + " BehaviorTypes[behavior.type] = behavior;", + " }", + " }", + " }", + "}", + "function unloadPlugin(pluginId) {", + " const plugin = Plugins.find((item) => item.id === pluginId);", + " if (plugin) {", + " for (const emitterShape of plugin.emitterShapes) {", + " if (EmitterShapes[emitterShape.type]) {", + " delete EmitterShapes[emitterShape.type];", + " }", + " }", + " for (const behavior of plugin.behaviors) {", + " if (BehaviorTypes[behavior.type]) {", + " delete BehaviorTypes[behavior.type];", + " }", + " }", + " }", + "}", + "", + "let NodeValueType = void 0;", + "(function (NodeValueType) {", + " NodeValueType[NodeValueType[\"Number\"] = 0] = \"Number\";", + " NodeValueType[NodeValueType[\"Vec2\"] = 1] = \"Vec2\";", + " NodeValueType[NodeValueType[\"Vec3\"] = 2] = \"Vec3\";", + " NodeValueType[NodeValueType[\"Vec4\"] = 3] = \"Vec4\";", + " NodeValueType[NodeValueType[\"Boolean\"] = 4] = \"Boolean\";", + " NodeValueType[NodeValueType[\"AnyType\"] = 5] = \"AnyType\";", + " NodeValueType[NodeValueType[\"NullableAnyType\"] = 6] = \"NullableAnyType\";", + " NodeValueType[NodeValueType[\"EventStream\"] = 7] = \"EventStream\";", + "})(NodeValueType || (NodeValueType = {}));", + "const genDefaultForNodeValueType = (type) => {", + " switch (type) {", + " case NodeValueType.Boolean:", + " return false;", + " case NodeValueType.Number:", + " return 0;", + " case NodeValueType.Vec2:", + " return new THREE.Vector2();", + " case NodeValueType.Vec3:", + " return new THREE.Vector3();", + " case NodeValueType.Vec4:", + " return new THREE.Vector4();", + " case NodeValueType.AnyType:", + " return 0;", + " case NodeValueType.NullableAnyType:", + " return undefined;", + " }", + "};", + "", + "class Node {", + " constructor(type, signatureIndex = -1, data = {}) {", + " this.inputs = [];", + " this.outputs = [];", + " this.signatureIndex = -1;", + " this.position = new THREE.Vector2();", + " this.outputValues = [];", + " this.id = '' + Math.round(Math.random() * 100000);", + " this.type = type;", + " this.signatureIndex = signatureIndex;", + " this.data = data;", + " const realIndex = signatureIndex === -1 ? 0 : signatureIndex;", + " for (let i = 0; i < type.nodeTypeSignatures[realIndex].inputTypes.length; i++) {", + " this.inputs.push(undefined);", + " }", + " for (let i = 0; i < type.nodeTypeSignatures[realIndex].outputTypes.length; i++) {", + " this.outputs.push([]);", + " this.outputValues.push(genDefaultForNodeValueType(type.nodeTypeSignatures[realIndex].outputTypes[i]));", + " }", + " }", + " get inputTypes() {", + " const signatureIndex = this.signatureIndex === -1 ? 0 : this.signatureIndex;", + " return this.type.nodeTypeSignatures[signatureIndex].inputTypes;", + " }", + " get outputTypes() {", + " const signatureIndex = this.signatureIndex === -1 ? 0 : this.signatureIndex;", + " return this.type.nodeTypeSignatures[signatureIndex].outputTypes;", + " }", + " func(context, inputs, outputs) {", + " const signatureIndex = this.signatureIndex === -1 ? 0 : this.signatureIndex;", + " this.type.nodeTypeSignatures[signatureIndex].func(context, this.data, inputs, outputs);", + " }", + "}", + "class Wire {", + " constructor(input, inputIndex, output, outputIndex) {", + " this.input = input;", + " this.inputIndex = inputIndex;", + " this.input.outputs[inputIndex].push(this);", + " this.output = output;", + " this.outputIndex = outputIndex;", + " this.output.inputs[outputIndex] = this;", + " }", + "}", + "", + "class BaseCompiler {", + " constructor() {", + " this.visited = new Set();", + " BaseCompiler.Instance = this;", + " }", + " buildExecutionOrder(graph, context) {", + " graph.nodesInOrder.length = 0;", + " this.visited.clear();", + " for (let i = 0; i < graph.outputNodes.length; i++) {", + " const node = graph.outputNodes[i];", + " if (node.inputs[0] !== undefined) {", + " this._traverse(node, graph, context);", + " }", + " }", + " graph.compiled = true;", + " }", + " _traverse(node, graph, context) {", + " this.visited.add(node.id);", + " for (let i = 0; i < node.inputs.length; i++) {", + " if (node.inputs[i] instanceof Wire) {", + " const inputNode = node.inputs[i].input;", + " if (!this.visited.has(inputNode.id)) {", + " this._traverse(inputNode, graph, context);", + " }", + " }", + " else if (node.inputs[i] !== undefined);", + " else;", + " }", + " graph.nodesInOrder.push(node);", + " }", + "}", + "", + "class Interpreter extends BaseCompiler {", + " constructor() {", + " super();", + " }", + " executeCompiledGraph(graph, context) {", + " const nodes = graph.nodesInOrder;", + " for (let i = 0; i < nodes.length; i++) {", + " const inputValues = [];", + " const node = nodes[i];", + " for (let j = 0; j < node.inputs.length; j++) {", + " if (node.inputs[j] instanceof Wire) {", + " inputValues.push(node.inputs[j].input.outputValues[node.inputs[j].inputIndex]);", + " }", + " else if (node.inputs[j] !== undefined) {", + " inputValues.push(node.inputs[j].getValue(context));", + " }", + " else {", + " inputValues.push(undefined);", + " }", + " }", + " node.func(context, inputValues, node.outputValues);", + " }", + " }", + " run(graph, context) {", + " if (!graph.compiled) {", + " this.buildExecutionOrder(graph, context);", + " }", + " this.executeCompiledGraph(graph, context);", + " }", + "}", + "", + "class NodeType {", + " constructor(name) {", + " this.nodeTypeSignatures = [];", + " this.name = name;", + " }", + " addSignature(inputTypes, outputTypes, func) {", + " this.nodeTypeSignatures.push({", + " inputTypes: inputTypes,", + " outputTypes: outputTypes,", + " func: func,", + " });", + " }", + "}", + "class GraphNodeType extends NodeType {", + " constructor(nodeGraph) {", + " const inputTypes = [];", + " for (let i = 0; i < nodeGraph.inputNodes.length; i++) {", + " if (nodeGraph.inputNodes[i].type.name === 'input') {", + " inputTypes.push(nodeGraph.inputNodes[i].data.type);", + " }", + " }", + " const outputTypes = [];", + " for (let i = 0; i < nodeGraph.outputNodes.length; i++) {", + " if (nodeGraph.outputNodes[i].type.name === 'output') {", + " outputTypes.push(nodeGraph.outputNodes[i].data.type);", + " }", + " }", + " super(nodeGraph.name);", + " this.addSignature(inputTypes, outputTypes, (context, data, inputs, outputs) => {", + " context.inputs = inputs;", + " context.outputs = outputs;", + " Interpreter.Instance.run(nodeGraph, context);", + " });", + " this.nodeGraph = nodeGraph;", + " }", + "}", + "", + "const NodeTypes = {};", + "const addNode = new NodeType('add');", + "addNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] + inputs[1];", + "});", + "addNode.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].addVectors(inputs[0], inputs[1]);", + "});", + "addNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].addVectors(inputs[0], inputs[1]);", + "});", + "addNode.addSignature([NodeValueType.Vec4, NodeValueType.Vec4], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].addVectors(inputs[0], inputs[1]);", + "});", + "NodeTypes['add'] = addNode;", + "const subNode = new NodeType('sub');", + "subNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] - inputs[1];", + "});", + "subNode.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].subVectors(inputs[0], inputs[1]);", + "});", + "subNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].subVectors(inputs[0], inputs[1]);", + "});", + "subNode.addSignature([NodeValueType.Vec4, NodeValueType.Vec4], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].subVectors(inputs[0], inputs[1]);", + "});", + "NodeTypes['sub'] = subNode;", + "const mulNode = new NodeType('mul');", + "mulNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] * inputs[1];", + "});", + "mulNode.addSignature([NodeValueType.Vec2, NodeValueType.Number], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).multiplyScalar(inputs[1]);", + "});", + "mulNode.addSignature([NodeValueType.Vec3, NodeValueType.Number], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).multiplyScalar(inputs[1]);", + "});", + "mulNode.addSignature([NodeValueType.Vec4, NodeValueType.Number], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).multiplyScalar(inputs[1]);", + "});", + "NodeTypes['mul'] = mulNode;", + "const divNode = new NodeType('div');", + "divNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] / inputs[1];", + "});", + "divNode.addSignature([NodeValueType.Vec2, NodeValueType.Number], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).divideScalar(inputs[1]);", + "});", + "divNode.addSignature([NodeValueType.Vec3, NodeValueType.Number], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).divideScalar(inputs[1]);", + "});", + "divNode.addSignature([NodeValueType.Vec4, NodeValueType.Number], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).divideScalar(inputs[1]);", + "});", + "NodeTypes['div'] = divNode;", + "const sinNode = new NodeType('sin');", + "sinNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.sin(inputs[0]);", + "});", + "NodeTypes['sin'] = sinNode;", + "const cosNode = new NodeType('cos');", + "cosNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.cos(inputs[0]);", + "});", + "NodeTypes['cos'] = cosNode;", + "const tanNode = new NodeType('tan');", + "tanNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.tan(inputs[0]);", + "});", + "NodeTypes['tan'] = tanNode;", + "const absNode = new NodeType('abs');", + "absNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.abs(inputs[0]);", + "});", + "NodeTypes['abs'] = absNode;", + "const minNode = new NodeType('min');", + "minNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.min(inputs[0], inputs[1]);", + "});", + "NodeTypes['min'] = minNode;", + "const maxNode = new NodeType('max');", + "maxNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.max(inputs[0], inputs[1]);", + "});", + "NodeTypes['max'] = maxNode;", + "const dot = new NodeType('dot');", + "dot.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].dot(inputs[1]);", + "});", + "dot.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].dot(inputs[1]);", + "});", + "dot.addSignature([NodeValueType.Vec4, NodeValueType.Vec4], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].dot(inputs[1]);", + "});", + "NodeTypes['dot'] = dot;", + "const cross = new NodeType('cross');", + "cross.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].crossVectors(inputs[0], inputs[1]);", + "});", + "NodeTypes['cross'] = cross;", + "const length = new NodeType('length');", + "length.addSignature([NodeValueType.Vec2], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].length();", + "});", + "length.addSignature([NodeValueType.Vec3], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].length();", + "});", + "length.addSignature([NodeValueType.Vec4], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].length();", + "});", + "NodeTypes['length'] = length;", + "const lengthSq = new NodeType('lengthSq');", + "lengthSq.addSignature([NodeValueType.Vec2], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].lengthSq();", + "});", + "lengthSq.addSignature([NodeValueType.Vec3], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].lengthSq();", + "});", + "lengthSq.addSignature([NodeValueType.Vec4], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].lengthSq();", + "});", + "NodeTypes['lengthSq'] = lengthSq;", + "const normalize = new NodeType('normalize');", + "normalize.addSignature([NodeValueType.Vec2], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).normalize();", + "});", + "normalize.addSignature([NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).normalize();", + "});", + "normalize.addSignature([NodeValueType.Vec4], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).normalize();", + "});", + "NodeTypes['normalize'] = normalize;", + "const distance = new NodeType('distance');", + "distance.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].distanceTo(inputs[1]);", + "});", + "distance.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].distanceTo(inputs[1]);", + "});", + "NodeTypes['distance'] = distance;", + "const andNode = new NodeType('and');", + "andNode.addSignature([NodeValueType.Boolean, NodeValueType.Boolean], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] && inputs[1];", + "});", + "NodeTypes['and'] = andNode;", + "const orNode = new NodeType('or');", + "orNode.addSignature([NodeValueType.Boolean, NodeValueType.Boolean], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] || inputs[1];", + "});", + "NodeTypes['or'] = orNode;", + "const notNode = new NodeType('not');", + "notNode.addSignature([NodeValueType.Boolean], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = !inputs[0];", + "});", + "NodeTypes['not'] = notNode;", + "const equalNode = new NodeType('equal');", + "equalNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] === inputs[1];", + "});", + "equalNode.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].equals(inputs[1]);", + "});", + "equalNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].equals(inputs[1]);", + "});", + "equalNode.addSignature([NodeValueType.Vec4, NodeValueType.Vec4], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].equals(inputs[1]);", + "});", + "NodeTypes['equal'] = equalNode;", + "const lessThanNode = new NodeType('lessThan');", + "lessThanNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] < inputs[1];", + "});", + "NodeTypes['lessThan'] = lessThanNode;", + "const greaterThanNode = new NodeType('greaterThan');", + "greaterThanNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] > inputs[1];", + "});", + "NodeTypes['greaterThan'] = greaterThanNode;", + "const lessThanOrEqualNode = new NodeType('lessThanOrEqual');", + "lessThanOrEqualNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] <= inputs[1];", + "});", + "NodeTypes['lessThanOrEqual'] = lessThanOrEqualNode;", + "const greaterThanOrEqualNode = new NodeType('greaterThanOrEqual');", + "greaterThanOrEqualNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] >= inputs[1];", + "});", + "NodeTypes['greaterThanOrEqual'] = greaterThanOrEqualNode;", + "const ifNode = new NodeType('if');", + "ifNode.addSignature([NodeValueType.Boolean, NodeValueType.AnyType, NodeValueType.AnyType], [NodeValueType.AnyType], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] ? inputs[1] : inputs[2];", + "});", + "NodeTypes['if'] = ifNode;", + "const numberNode = new NodeType('number');", + "numberNode.addSignature([], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = data.value;", + "});", + "NodeTypes['number'] = numberNode;", + "const vec2Node = new NodeType('vec2');", + "vec2Node.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].x = inputs[0];", + " outputs[0].y = inputs[1];", + "});", + "NodeTypes['vec2'] = vec2Node;", + "const vec3Node = new NodeType('vec3');", + "vec3Node.addSignature([NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].x = inputs[0];", + " outputs[0].y = inputs[1];", + " outputs[0].z = inputs[2];", + "});", + "NodeTypes['vec3'] = vec3Node;", + "const vec4Node = new NodeType('vec4');", + "vec4Node.addSignature([NodeValueType.Number, NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].x = inputs[0];", + " outputs[0].y = inputs[1];", + " outputs[0].z = inputs[2];", + " outputs[0].w = inputs[3];", + "});", + "NodeTypes['vec4'] = vec4Node;", + "const splitVec2Node = new NodeType('splitVec2');", + "splitVec2Node.addSignature([NodeValueType.Vec2], [NodeValueType.Number, NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].x;", + " outputs[1] = inputs[0].y;", + "});", + "NodeTypes['splitVec2'] = splitVec2Node;", + "const splitVec3Node = new NodeType('splitVec3');", + "splitVec3Node.addSignature([NodeValueType.Vec3], [NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].x;", + " outputs[1] = inputs[0].y;", + " outputs[2] = inputs[0].z;", + "});", + "NodeTypes['splitVec3'] = splitVec3Node;", + "const splitVec4Node = new NodeType('splitVec4');", + "splitVec4Node.addSignature([NodeValueType.Vec4], [NodeValueType.Number, NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].x;", + " outputs[1] = inputs[0].y;", + " outputs[2] = inputs[0].z;", + " outputs[3] = inputs[0].w;", + "});", + "NodeTypes['splitVec4'] = splitVec4Node;", + "const boolNode = new NodeType('bool');", + "boolNode.addSignature([], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = data.value;", + "});", + "NodeTypes['bool'] = boolNode;", + "const particlePropertyNode = new NodeType('particleProperty');", + "particlePropertyNode.addSignature([NodeValueType.NullableAnyType], [NodeValueType.NullableAnyType], (context, data, inputs, outputs) => {", + " if (inputs[0] !== undefined) {", + " if (typeof inputs[0] === 'object') {", + " context.particle[data.property].copy(inputs[0]);", + " }", + " else {", + " context.particle[data.property] = inputs[0];", + " }", + " }", + " if (context.particle[data.property] !== undefined) {", + " if (typeof outputs[0] === 'object') {", + " outputs[0].copy(context.particle[data.property]);", + " }", + " else {", + " outputs[0] = context.particle[data.property];", + " }", + " }", + "});", + "NodeTypes['particleProperty'] = particlePropertyNode;", + "const emitNode = new NodeType('emit');", + "emitNode.addSignature([NodeValueType.EventStream], [], (context, data, inputs, outputs) => {", + " const arr = inputs[0];", + " for (let i = 0; i < arr.length; i++) {", + " context.signal(i, arr[i]);", + " }", + "});", + "NodeTypes['emit'] = emitNode;", + "const graphPropertyNode = new NodeType('graphProperty');", + "graphPropertyNode.addSignature([NodeValueType.NullableAnyType], [NodeValueType.NullableAnyType], (context, data, inputs, outputs) => {", + " if (inputs[0] !== undefined) {", + " if (typeof inputs[0] === 'object') {", + " context.graph[data.property].copy(inputs[0]);", + " }", + " else {", + " context.graph[data.property] = inputs[0];", + " }", + " }", + " if (context.graph[data.property] !== undefined) {", + " if (typeof outputs[0] === 'object') {", + " outputs[0].copy(context.graph[data.property]);", + " }", + " else {", + " outputs[0] = context.graph[data.property];", + " }", + " }", + "});", + "NodeTypes['graphProperty'] = graphPropertyNode;", + "const startEventNode = new NodeType('startEvent');", + "startEventNode.addSignature([], [NodeValueType.EventStream], (context, data, inputs, outputs) => {", + " outputs[0] = [{ type: 'start' }];", + "});", + "NodeTypes['startEvent'] = startEventNode;", + "const repeaterNode = new NodeType('repeater');", + "repeaterNode.addSignature([NodeValueType.EventStream, NodeValueType.Number], [NodeValueType.EventStream], (context, data, inputs, outputs) => {", + " const arr = inputs[0];", + " const count = inputs[1];", + " const result = [];", + " for (let j = 0; j < arr.length; j++) {", + " for (let i = 0; i < count; i++) {", + " result.push(arr[j]);", + " }", + " }", + " outputs[0] = result;", + "});", + "NodeTypes['repeater'] = repeaterNode;", + "const timeNode = new NodeType('time');", + "timeNode.addSignature([], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = context.emissionState.time;", + "});", + "NodeTypes['time'] = timeNode;", + "const deltaNode = new NodeType('delta');", + "deltaNode.addSignature([], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = context.delta;", + "});", + "NodeTypes['delta'] = deltaNode;", + "const outputNode = new NodeType('output');", + "outputNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0];", + "});", + "outputNode.addSignature([NodeValueType.Vec2], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0];", + "});", + "outputNode.addSignature([NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0];", + "});", + "outputNode.addSignature([NodeValueType.Vec4], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0];", + "});", + "outputNode.addSignature([NodeValueType.Boolean], [NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0];", + "});", + "NodeTypes['output'] = outputNode;", + "const lerpNode = new NodeType('lerp');", + "lerpNode.addSignature([NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] =", + " inputs[0] * (1 - inputs[2]) + inputs[1] * inputs[2];", + "});", + "lerpNode.addSignature([NodeValueType.Vec2, NodeValueType.Vec2, NodeValueType.Number], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].lerpVectors(inputs[0], inputs[1], inputs[2]);", + "});", + "lerpNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3, NodeValueType.Number], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].lerpVectors(inputs[0], inputs[1], inputs[2]);", + "});", + "lerpNode.addSignature([NodeValueType.Vec4, NodeValueType.Vec4, NodeValueType.Number], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].lerpVectors(inputs[0], inputs[1], inputs[2]);", + "});", + "NodeTypes['lerp'] = lerpNode;", + "const normalD = (x) => {", + " return (1 / Math.sqrt(2 * Math.PI)) * Math.exp(x * x * -0.5);", + "};", + "const normalDistributionNode = new NodeType('normDistrib');", + "normalDistributionNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = normalD(inputs[0]);", + "});", + "NodeTypes['normDistrib'] = normalDistributionNode;", + "const normcdfNode = new NodeType('normcdf');", + "normcdfNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " let x = inputs[0];", + " const a1 = 0.254829592;", + " const a2 = -0.284496736;", + " const a3 = 1.421413741;", + " const a4 = -1.453152027;", + " const a5 = 1.061405429;", + " const p = 0.3275911;", + " let sign = 1;", + " if (x < 0)", + " sign = -1;", + " x = Math.abs(x) / Math.sqrt(2.0);", + " const t = 1.0 / (1.0 + p * x);", + " const y = 1.0 - ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t * Math.exp(-x * x);", + " outputs[0] = 0.5 * (1.0 + sign * y);", + "});", + "NodeTypes['normcdf'] = normcdfNode;", + "const normcdfInvNode = new NodeType('normcdfInv');", + "const rationalApproximation = (t) => {", + " const c = [2.515517, 0.802853, 0.010328];", + " const d = [1.432788, 0.189269, 0.001308];", + " return t - ((c[2] * t + c[1]) * t + c[0]) / (((d[2] * t + d[1]) * t + d[0]) * t + 1.0);", + "};", + "const normcdfInv = (p) => {", + " if (p < 0.5) {", + " return -rationalApproximation(Math.sqrt(-2.0 * Math.log(p)));", + " }", + " else {", + " return rationalApproximation(Math.sqrt(-2.0 * Math.log(1 - p)));", + " }", + "};", + "normcdfInvNode.addSignature([NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = normcdfInv(inputs[0]);", + "});", + "NodeTypes['normcdfInv'] = normcdfInvNode;", + "const clampNode = new NodeType('clamp');", + "clampNode.addSignature([NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.max(Math.min(inputs[0], inputs[2]), inputs[1]);", + "});", + "NodeTypes['clamp'] = clampNode;", + "const smoothstepNode = new NodeType('smoothstep');", + "smoothstepNode.addSignature([NodeValueType.Number, NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " const x = Math.max(Math.min(inputs[0], inputs[2]), inputs[1]);", + " outputs[0] = x * x * (3 - 2 * x);", + "});", + "NodeTypes['smoothstep'] = smoothstepNode;", + "const randomNode = new NodeType('random');", + "randomNode.addSignature([NodeValueType.Number, NodeValueType.Number], [NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.random() * (inputs[1] - inputs[0]) + inputs[0];", + "});", + "randomNode.addSignature([NodeValueType.Vec2, NodeValueType.Vec2], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " let random = Math.random();", + " outputs[0].lerpVectors(inputs[0], inputs[1], random);", + "});", + "randomNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " let random = Math.random();", + " outputs[0].lerpVectors(inputs[0], inputs[1], random);", + "});", + "randomNode.addSignature([NodeValueType.Vec4, NodeValueType.Vec4], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " let random = Math.random();", + " outputs[0].lerpVectors(inputs[0], inputs[1], random);", + "});", + "NodeTypes['random'] = randomNode;", + "const vrandNode = new NodeType('vrand');", + "vrandNode.addSignature([], [NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " let x = normcdfInv(Math.random());", + " let y = normcdfInv(Math.random());", + " const mag = Math.sqrt(x * x + y * y);", + " outputs[0].set(x / mag, y / mag);", + "});", + "vrandNode.addSignature([], [NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " let x = normcdfInv(Math.random());", + " let y = normcdfInv(Math.random());", + " let z = normcdfInv(Math.random());", + " const mag = Math.sqrt(x * x + y * y + z * z);", + " outputs[0].set(x / mag, y / mag, z / mag);", + "});", + "vrandNode.addSignature([], [NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " let x = normcdfInv(Math.random());", + " let y = normcdfInv(Math.random());", + " let z = normcdfInv(Math.random());", + " let w = normcdfInv(Math.random());", + " const mag = Math.sqrt(x * x + y * y + z * z + w * w);", + " outputs[0].set(x / mag, y / mag, z / mag, w / mag);", + "});", + "NodeTypes['vrand'] = vrandNode;", + "const bsdfNode = new NodeType('bsdf');", + "bsdfNode.addSignature([NodeValueType.Vec3, NodeValueType.Vec3, NodeValueType.Vec3, NodeValueType.Number], [], (context, data, inputs, outputs) => { });", + "NodeTypes['bsdf'] = bsdfNode;", + "const OutputNodeTypeNames = new Set(['output', 'particleProperty', 'graphProperty', 'emit']);", + "", + "class NodeGraph {", + " constructor(name) {", + " this.inputNodes = [];", + " this.outputNodes = [];", + " this.allNodes = new Map();", + " this.wires = [];", + " this.compiled = false;", + " this.nodesInOrder = [];", + " this.version = '1.0';", + " this.uuid = THREE.MathUtils.generateUUID();", + " this.name = name;", + " this.revision = 0;", + " }", + " addWire(wire) {", + " this.wires.push(wire);", + " this.revision++;", + " }", + " addNode(node) {", + " this.allNodes.set(node.id, node);", + " if (node.type === NodeTypes['input']) {", + " this.inputNodes.push(node);", + " }", + " else if (OutputNodeTypeNames.has(node.type.name)) {", + " this.outputNodes.push(node);", + " }", + " this.revision++;", + " }", + " getNode(id) {", + " return this.allNodes.get(id);", + " }", + " deleteNode(node) {", + " this.allNodes.delete(node.id);", + " this.revision++;", + " }", + " deleteWire(wire) {", + " let index = wire.input.outputs[wire.inputIndex].indexOf(wire);", + " if (index !== -1) {", + " wire.input.outputs[wire.inputIndex].splice(index, 1);", + " }", + " wire.output.inputs[wire.outputIndex] = undefined;", + " index = this.wires.indexOf(wire);", + " if (index != -1) {", + " this.wires[index] = this.wires[this.wires.length - 1];", + " this.wires.pop();", + " }", + " this.revision++;", + " }", + " toJSON() {", + " throw new Error('not implemented');", + " }", + " clone() {", + " throw new Error('not implemented');", + " }", + "}", + "", + "new THREE.Vector3(0, 0, 1);", + "const tempQ = new THREE.Quaternion();", + "const tempV = new THREE.Vector3();", + "const tempV2 = new THREE.Vector3();", + "const PREWARM_FPS = 60;", + "const DEFAULT_GEOMETRY = new THREE.PlaneGeometry(1, 1, 1, 1);", + "class NodeVFX {", + " set time(time) {", + " this.emissionState.time = time;", + " }", + " get time() {", + " return this.emissionState.time;", + " }", + " get layers() {", + " return this.rendererSettings.layers;", + " }", + " get texture() {", + " return this.rendererSettings.material.map;", + " }", + " set texture(texture) {", + " this.rendererSettings.material.map = texture;", + " this.neededToUpdateRender = true;", + " }", + " get material() {", + " return this.rendererSettings.material;", + " }", + " set material(material) {", + " this.rendererSettings.material = material;", + " this.neededToUpdateRender = true;", + " }", + " get instancingGeometry() {", + " return this.rendererSettings.instancingGeometry;", + " }", + " set instancingGeometry(geometry) {", + " this.restart();", + " this.particles.length = 0;", + " this.rendererSettings.instancingGeometry = geometry;", + " this.neededToUpdateRender = true;", + " }", + " get renderMode() {", + " return this.rendererSettings.renderMode;", + " }", + " set renderMode(renderMode) {", + " if ((this.rendererSettings.renderMode != RenderMode.Trail && renderMode === RenderMode.Trail) ||", + " (this.rendererSettings.renderMode == RenderMode.Trail && renderMode !== RenderMode.Trail)) {", + " this.restart();", + " this.particles.length = 0;", + " }", + " if (this.rendererSettings.renderMode !== renderMode) {", + " switch (renderMode) {", + " case RenderMode.Trail:", + " this.rendererEmitterSettings = {", + " startLength: 30,", + " followLocalOrigin: false,", + " };", + " break;", + " case RenderMode.Mesh:", + " this.rendererEmitterSettings = {", + " geometry: new THREE.PlaneGeometry(1, 1),", + " };", + " break;", + " case RenderMode.BillBoard:", + " case RenderMode.VerticalBillBoard:", + " case RenderMode.HorizontalBillBoard:", + " case RenderMode.StretchedBillBoard:", + " this.rendererEmitterSettings = {};", + " break;", + " }", + " }", + " this.rendererSettings.renderMode = renderMode;", + " this.neededToUpdateRender = true;", + " }", + " get renderOrder() {", + " return this.rendererSettings.renderOrder;", + " }", + " set renderOrder(renderOrder) {", + " this.rendererSettings.renderOrder = renderOrder;", + " this.neededToUpdateRender = true;", + " }", + " get blending() {", + " return this.rendererSettings.material.blending;", + " }", + " set blending(blending) {", + " this.rendererSettings.material.blending = blending;", + " this.neededToUpdateRender = true;", + " }", + " constructor(parameters) {", + " var _a, _b, _c, _d, _e, _f, _g;", + " this.temp = new THREE.Vector3();", + " this.travelDistance = 0;", + " this.normalMatrix = new THREE.Matrix3();", + " this.speedFactor = 0;", + " this.autoDestroy = parameters.autoDestroy === undefined ? false : parameters.autoDestroy;", + " this.duration = (_a = parameters.duration) !== null && _a !== void 0 ? _a : 1;", + " this.looping = parameters.looping === undefined ? true : parameters.looping;", + " this.prewarm = parameters.prewarm === undefined ? false : parameters.prewarm;", + " this.worldSpace = (_b = parameters.worldSpace) !== null && _b !== void 0 ? _b : false;", + " this.rendererEmitterSettings = (_c = parameters.rendererEmitterSettings) !== null && _c !== void 0 ? _c : {};", + " this.emissionGraph = parameters.emissionGraph;", + " this.updateGraph = parameters.updateGraph;", + " this.interpreter = new Interpreter();", + " this.rendererSettings = {", + " instancingGeometry: (_d = parameters.instancingGeometry) !== null && _d !== void 0 ? _d : DEFAULT_GEOMETRY,", + " renderMode: (_e = parameters.renderMode) !== null && _e !== void 0 ? _e : RenderMode.BillBoard,", + " renderOrder: (_f = parameters.renderOrder) !== null && _f !== void 0 ? _f : 0,", + " material: parameters.material,", + " layers: (_g = parameters.layers) !== null && _g !== void 0 ? _g : new THREE.Layers(),", + " uTileCount: 1,", + " vTileCount: 1,", + " };", + " this.neededToUpdateRender = true;", + " this.particles = new Array();", + " this.emitter = new ParticleEmitter(this);", + " this.paused = false;", + " this.particleNum = 0;", + " this.emissionState = {", + " time: 0,", + " };", + " this.emitEnded = false;", + " this.markForDestroy = false;", + " this.prewarmed = false;", + " }", + " pause() {", + " this.paused = true;", + " }", + " play() {", + " this.paused = false;", + " }", + " spawn(emissionState, matrix) {", + " tempQ.setFromRotationMatrix(matrix);", + " const translation = tempV;", + " const quaternion = tempQ;", + " const scale = tempV2;", + " matrix.decompose(translation, quaternion, scale);", + " this.particleNum++;", + " while (this.particles.length < this.particleNum) {", + " this.particles.push(new NodeParticle());", + " }", + " const particle = this.particles[this.particleNum - 1];", + " particle.reset();", + " this.interpreter.run(this.updateGraph, { particle: particle, emissionState: this.emissionState });", + " if (this.rendererSettings.renderMode === RenderMode.Trail &&", + " this.rendererEmitterSettings.followLocalOrigin) {", + " const trail = particle;", + " trail.localPosition = new THREE.Vector3().copy(trail.position);", + " }", + " if (this.worldSpace) {", + " particle.position.applyMatrix4(matrix);", + " particle.size *= (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z)) / 3;", + " particle.velocity.multiply(scale).applyMatrix3(this.normalMatrix);", + " if (particle.rotation && particle.rotation instanceof THREE.Quaternion) {", + " particle.rotation.multiplyQuaternions(tempQ, particle.rotation);", + " }", + " }", + " }", + " endEmit() {", + " this.emitEnded = true;", + " if (this.autoDestroy) {", + " this.markForDestroy = true;", + " }", + " }", + " dispose() {", + " if (this._renderer)", + " this._renderer.deleteSystem(this);", + " this.emitter.dispose();", + " if (this.emitter.parent)", + " this.emitter.parent.remove(this.emitter);", + " }", + " restart() {", + " this.paused = false;", + " this.particleNum = 0;", + " this.emissionState.time = 0;", + " this.emitEnded = false;", + " this.markForDestroy = false;", + " this.prewarmed = false;", + " }", + " update(delta) {", + " if (this.paused)", + " return;", + " let currentParent = this.emitter;", + " while (currentParent.parent) {", + " currentParent = currentParent.parent;", + " }", + " if (currentParent.type !== 'Scene') {", + " this.dispose();", + " return;", + " }", + " if (this.emitEnded && this.particleNum === 0) {", + " if (this.markForDestroy && this.emitter.parent)", + " this.dispose();", + " return;", + " }", + " if (this.looping && this.prewarm && !this.prewarmed) {", + " this.prewarmed = true;", + " for (let i = 0; i < this.duration * PREWARM_FPS; i++) {", + " this.update(1.0 / PREWARM_FPS);", + " }", + " }", + " if (delta > 0.1) {", + " delta = 0.1;", + " }", + " if (this.neededToUpdateRender) {", + " if (this._renderer)", + " this._renderer.updateSystem(this);", + " this.neededToUpdateRender = false;", + " }", + " this.emit(delta, this.emissionState, this.emitter.matrixWorld);", + " const context = { particle: undefined, emissionState: this.emissionState, delta };", + " for (let i = 0; i < this.particleNum; i++) {", + " context.particle = this.particles[i];", + " this.interpreter.run(this.updateGraph, context);", + " }", + " for (let i = 0; i < this.particleNum; i++) {", + " if (this.rendererEmitterSettings.followLocalOrigin &&", + " this.particles[i].localPosition) {", + " this.particles[i].position.copy(this.particles[i].localPosition);", + " if (this.particles[i].parentMatrix) {", + " this.particles[i].position.applyMatrix4(this.particles[i].parentMatrix);", + " }", + " else {", + " this.particles[i].position.applyMatrix4(this.emitter.matrixWorld);", + " }", + " }", + " else {", + " this.particles[i].position.addScaledVector(this.particles[i].velocity, delta);", + " }", + " this.particles[i].age += delta;", + " }", + " if (this.rendererSettings.renderMode === RenderMode.Trail) {", + " for (let i = 0; i < this.particleNum; i++) {", + " const particle = this.particles[i];", + " particle.update();", + " }", + " }", + " for (let i = 0; i < this.particleNum; i++) {", + " const particle = this.particles[i];", + " if (particle.died && (!(particle instanceof TrailParticle) || particle.previous.length === 0)) {", + " this.particles[i] = this.particles[this.particleNum - 1];", + " this.particles[this.particleNum - 1] = particle;", + " this.particleNum--;", + " i--;", + " }", + " }", + " }", + " emit(delta, emissionState, emitterMatrix) {", + " if (emissionState.time > this.duration) {", + " if (this.looping) {", + " emissionState.time -= this.duration;", + " }", + " else {", + " if (!this.emitEnded) {", + " this.endEmit();", + " }", + " }", + " }", + " this.normalMatrix.getNormalMatrix(emitterMatrix);", + " const context = {", + " signal: () => {", + " this.spawn(emissionState, emitterMatrix);", + " },", + " emissionState,", + " delta,", + " };", + " if (!this.emitEnded) {", + " this.interpreter.run(this.emissionGraph, context);", + " }", + " if (this.previousWorldPos === undefined)", + " this.previousWorldPos = new THREE.Vector3();", + " this.emitter.getWorldPosition(this.previousWorldPos);", + " emissionState.time += delta;", + " }", + " toJSON(meta, options = {}) {", + " return {};", + " }", + " getRendererSettings() {", + " return this.rendererSettings;", + " }", + " clone() {", + " return this;", + " }", + "}", + "", + "gdjs.__particleEmmiter3DExtension = {", + " ParticleEmitter3DRenderer,", + " ParticleEmitterAdapter,", + " ParticleEmitterHelper,", + "", + " ApplyCollision,", + " ApplyForce,", + " ApplySequences,", + " AxisAngleGenerator,", + " BatchedParticleRenderer,", + " BatchedRenderer,", + " BehaviorFromJSON,", + " BehaviorTypes,", + " Bezier,", + " ChangeEmitDirection,", + " ColorGeneratorFromJSON,", + " ColorOverLife,", + " ColorRange,", + " ConeEmitter,", + " ConstantColor,", + " ConstantValue,", + " DonutEmitter,", + " EmitSubParticleSystem,", + " EmitterFromJSON,", + " EmitterMode,", + " EmitterShapes,", + " EulerGenerator,", + " ForceOverLife,", + " FrameOverLife,", + " GeneratorFromJSON,", + " Gradient,", + " GraphNodeType,", + " GravityForce,", + " GridEmitter,", + " Interpreter,", + " IntervalValue,", + " MeshSurfaceEmitter,", + " Node,", + " NodeGraph,", + " NodeType,", + " NodeTypes,", + " NodeValueType,", + " Noise,", + " OrbitOverLife,", + " ParticleEmitter,", + " ParticleSystem,", + " PiecewiseBezier,", + " PiecewiseFunction,", + " Plugins,", + " PointEmitter,", + " QuarksLoader,", + " RandomColor,", + " RandomColorBetweenGradient,", + " RandomQuatGenerator,", + " RecordState,", + " RenderMode,", + " Rotation3DOverLife,", + " RotationGeneratorFromJSON,", + " RotationOverLife,", + " SequencerFromJSON,", + " SizeOverLife,", + " SpeedOverLife,", + " SphereEmitter,", + " SpriteBatch,", + " SpriteParticle,", + " SubParticleEmitMode,", + " TextureSequencer,", + " TrailBatch,", + " TrailParticle,", + " TurbulenceField,", + " VFXBatch,", + " ValueGeneratorFromJSON,", + " WidthOverLength,", + " Wire,", + " genDefaultForNodeValueType,", + " getPhysicsResolver,", + " loadPlugin,", + " setPhysicsResolver,", + " unloadPlugin,", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] }, { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadIntersectionPath", - "persistentUuid": "48c14d38-4885-4341-b9cc-25f79a337840", - "width": 0, - "x": -1920, - "y": -1152, - "zOrder": 44, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "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": [ { - "angle": -90, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadIntersectionPath", - "persistentUuid": "b7a6e433-4d6c-4c70-a87c-6c2e0b22a949", - "width": 0, - "x": -1920, - "y": 512, - "zOrder": 44, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "areaMaxX": 64, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "defaultName": "ParticleEmitter", + "description": "Display a large number of particles to create visual effects.", + "fullName": "3D particle emitter", + "is3D": true, + "isUsingLegacyInstancesRenderer": true, + "name": "ParticleEmitter3D", + "objects": [ + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Particle", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "Image", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Particle" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [], + "editionSettings": {}, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const {", + " ParticleEmitterAdapter,", + " ParticleEmitter3DRenderer,", + " ParticleEmitterHelper,", + "", + " ParticleSystem,", + " IntervalValue,", + " ConstantValue,", + " ConstantColor,", + " ColorOverLife,", + " SizeOverLife,", + " ApplyForce,", + " Gradient,", + " PiecewiseBezier,", + " Bezier,", + " PointEmitter,", + " ConeEmitter,", + " RenderMode", + "} = gdjs.__particleEmmiter3DExtension;", + "", + "/** @type {gdjs.CustomRuntimeObject} */", + "const object = objects[0];", + "// Force the size of the object because it doesn't contain any instance.", + "object._innerArea = {", + " min: [-16, -16, -16],", + " max: [16, 16, 16],", + " };", + "const hitbox = new gdjs.Polygon();", + "hitbox.vertices = [[-16, -16], [16, -16], [16, 16], [-16, 16]];", + "object._untransformedHitBoxes = [hitbox];", + "object._unrotatedAABB.min[0] = -16;", + "object._unrotatedAABB.min[1] = -16;", + "object._unrotatedAABB.max[0] = 16;", + "object._unrotatedAABB.max[1] = 16;", + "object._updateUntransformedHitBoxes = () => {};", + "", + "// Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.", + "const gameScene = object.getRuntimeScene();", + "const game = runtimeScene.getGame();", + "", + "const texture = game.getImageManager().getThreeTexture('');", + "", + "// Set the blending here because changes are not applied after the emitter creation.", + "const blendingString = object._getBlending();", + "const blending =", + " blendingString === \"Additive\" ? THREE.AdditiveBlending :", + " blendingString === \"Normal\" ? THREE.NormalBlending :", + " blendingString === \"Subtractive\" ? THREE.SubtractiveBlending :", + " blendingString === \"Multiply\" ? THREE.MultiplyBlending :", + " blendingString === \"None\" ? THREE.NoBlending :", + " THREE.AdditiveBlending;", + "", + "", + "// Build a configuration with the right kind of objects.", + "// These values are not important as they are overrided by the object properties values.", + "const muzzle = {", + " duration: 10,", + " looping: false,", + " startLife: new IntervalValue(1, 2),", + " startSpeed: new IntervalValue(100, 200),", + " startSize: new IntervalValue(20, 50),", + " startColor: new ConstantColor(new THREE.Vector4(1, 1, 1, 1)),", + " worldSpace: true,", + "", + " maxParticle: 5,", + " emissionOverTime: new ConstantValue(50),", + " emissionBursts: [{", + " time: 0,", + " count: new ConstantValue(1),", + " cycle: 1,", + " interval: 0.01,", + " probability: 1,", + " }],", + "", + " shape: new PointEmitter(),", + " material: new THREE.MeshBasicMaterial({", + " map: texture,", + " blending: blending,", + " transparent: true,", + " side: THREE.DoubleSide", + " }),", + " startTileIndex: 0,", + " uTileCount: 1,", + " vTileCount: 1,", + " renderOrder: 2,", + " renderMode: RenderMode.BillBoard", + "};", + "const particleSystem = new ParticleSystem(muzzle);", + "", + "const colorOverLife = new ColorOverLife(", + " new Gradient(", + " [", + " [new THREE.Vector3(1, 0, 0), 0],", + " [new THREE.Vector3(1, 0, 0), 1],", + " ],", + " [", + " [1, 0],", + " [1, 1],", + " ]", + " ));", + "particleSystem.addBehavior(colorOverLife);", + "const sizeOverLife = new SizeOverLife(new PiecewiseBezier([[new Bezier(1, 2 / 3, 1 / 3, 0), 0]]));", + "particleSystem.addBehavior(sizeOverLife);", + "const applyForce = new ApplyForce(new THREE.Vector3(0, 0, -1), new ConstantValue(0));", + "particleSystem.addBehavior(applyForce);", + "", + "particleSystem.emitter.name = object.getName() + object.getNameId();", + "", + "object.__particleEmitterAdapter = new ParticleEmitterAdapter(particleSystem, colorOverLife, sizeOverLife, applyForce);", + "object.__particleSystem = particleSystem;", + "", + "// This is a hack that may break in future releases.", + "// Replace the group that would hold children objects by the emmiter.", + "const layer = object.getInstanceContainer().getLayer(object.getLayer());", + "const group = object.getRenderer()._threeGroup;", + "layer.getRenderer().remove3DRendererObject(group);", + "particleSystem.emitter.position.copy(group.position);", + "particleSystem.emitter.rotation.order = 'ZYX';", + "particleSystem.emitter.rotation.copy(group.rotation);", + "", + "const particleEmitter3DRenderer = new ParticleEmitter3DRenderer(object, object._instanceContainer, object.getInstanceContainer());", + "object._renderer = particleEmitter3DRenderer;", + "if (game.isInGameEdition && game.isInGameEdition()) {", + " const particleEmitterHelper = new ParticleEmitterHelper(object);", + " particleEmitter3DRenderer._threeGroup = particleEmitterHelper;", + " layer.getRenderer().add3DRendererObject(particleEmitterHelper);", + "}", + "else {", + " particleEmitter3DRenderer._threeGroup = particleSystem.emitter;", + " layer.getRenderer().add3DRendererObject(particleSystem.emitter);", + "}", + "", + "particleSystem.emitter.updateMatrixWorld(true);", + "", + "", + "// See doStepPostEvents", + "gameScene.__particleEmmiter3DExtension = gameScene.__particleEmmiter3DExtension || {};", + "gameScene.__particleEmmiter3DExtension.emittersCount = gameScene.__particleEmmiter3DExtension.emittersCount || 0;", + "gameScene.__particleEmmiter3DExtension.emittersCount++;", + "", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::UpdateFromProperties" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetRotationCenter" + }, + "parameters": [ + "Object", + "0", + "0", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDestroy", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.CustomRuntimeObject} */", + "const object = objects[0];", + "// Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.", + "const gameScene = object.getRuntimeScene();", + "", + "object.__particleSystem.dispose();", + "", + "// See doStepPostEvents", + "gameScene.__particleEmmiter3DExtension.emittersCount--;", + "", + "if (gameScene.__particleEmmiter3DExtension.emittersCount === 0) {", + " // Update batch system now because doStepPostEvents won't be called.", + " gameScene.__particleEmmiter3DExtension.layerNames = gameScene.__particleEmmiter3DExtension.layerNames || [];", + " const layerNames = gameScene.__particleEmmiter3DExtension.layerNames;", + " gameScene.getAllLayerNames(layerNames);", + " for (const layerName of layerNames) {", + " const layer = gameScene.getLayer(layerName);", + " if (layer.__particleEmmiter3DExtension) {", + " layer.__particleEmmiter3DExtension.batchSystem.update(layer.getElapsedTime() / 1000);", + " }", + " }", + "}" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::UpdateFromProperties" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Update from properties.", + "fullName": "Update from properties", + "functionType": "Action", + "name": "UpdateFromProperties", + "private": true, + "sentence": "Update from properties of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetZ" + }, + "parameters": [ + "Object", + "=", + "Object.Z()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetRotationX" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyRotationX()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetRotationY" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyRotationY()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartColor" + }, + "parameters": [ + "Object", + "=", + "Object.StartColor()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetEndColor" + }, + "parameters": [ + "Object", + "=", + "Object.EndColor()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartOpacity" + }, + "parameters": [ + "Object", + "=", + "Object.StartOpacity()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetEndOpacity" + }, + "parameters": [ + "Object", + "=", + "Object.EndOpacity()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetFlow" + }, + "parameters": [ + "Object", + "=", + "Object.Flow()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSizeMin" + }, + "parameters": [ + "Object", + "=", + "Object.StartSizeMin()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSizeMax" + }, + "parameters": [ + "Object", + "=", + "Object.StartSizeMax()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetEndScale" + }, + "parameters": [ + "Object", + "=", + "Object.EndScale()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSpeedMin" + }, + "parameters": [ + "Object", + "=", + "Object.StartSpeedMin()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSpeedMax" + }, + "parameters": [ + "Object", + "=", + "Object.StartSpeedMax()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetLifespanMin" + }, + "parameters": [ + "Object", + "=", + "Object.LifespanMin()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetLifespanMax" + }, + "parameters": [ + "Object", + "=", + "Object.LifespanMax()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetDuration" + }, + "parameters": [ + "Object", + "=", + "Object.Duration()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetSpayConeAngle" + }, + "parameters": [ + "Object", + "=", + "Object.SpayConeAngle()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetGravity" + }, + "parameters": [ + "Object", + "=", + "Object.Gravity()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetGravityTop" + }, + "parameters": [ + "Object", + "=", + "Object.GravityTop()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::UpdateImage" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "AreParticlesRelative", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetAreParticlesRelative" + }, + "parameters": [ + "Object", + "no", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "AreParticlesRelative", + "True", + "" + ] + } + ], + "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()", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::UpdateHelper" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "Update helper", + "functionType": "Action", + "name": "UpdateHelper", + "private": true, + "sentence": "Update graphical helper of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const game = runtimeScene.getGame();", + "if (game.isInGameEdition && game.isInGameEdition()) {", + " const particleEmitterHelper = objects[0].get3DRendererObject();", + " particleEmitterHelper.update();", + "}" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "Update particle image", + "functionType": "Action", + "name": "UpdateImage", + "private": true, + "sentence": "Update particle image of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.CustomRuntimeObject3D} */\r", + "const object = objects[0];\r", + "/** @type {SpriteObjectDataType} */\r", + "const particleSpriteData = object._instanceContainer._objects.get(\"Particle\");\r", + "/** @type {gdjs.SpriteAnimationData} */\r", + "const animation = particleSpriteData.animations[0];\r", + "const animationFrame = animation ? animation.directions[0].sprites[0] : null;\r", + "const resourceName = animationFrame ? animationFrame.image : '';\r", + "object.__particleEmitterAdapter.setImage(resourceName);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::HasEnded" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::Delete" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ParticleEmitter3D::ParticleEmitter3D::HasEnded" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::RegisterInLayer" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.CustomRuntimeObject3D} */", + "const object = objects[0];", + "// Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.", + "const gameScene = object.getRuntimeScene();", + "", + "// Update batch system after having moved every emitter.", + "// See onScenePreEvents", + "gameScene.__particleEmmiter3DExtension.emittersStepped++;", + "if (gameScene.__particleEmmiter3DExtension.emittersStepped === gameScene.__particleEmmiter3DExtension.emittersCount) {", + " gameScene.__particleEmmiter3DExtension.layerNames = gameScene.__particleEmmiter3DExtension.layerNames || [];", + " const layerNames = gameScene.__particleEmmiter3DExtension.layerNames;", + " gameScene.getAllLayerNames(layerNames);", + " for (const layerName of layerNames) {", + " const layer = gameScene.getLayer(layerName);", + " if (layer.__particleEmmiter3DExtension) {", + " layer.__particleEmmiter3DExtension.batchSystem.update(layer.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();", + "", + " let rootObject = object;", + " while (rootObject.getInstanceContainer().getOwner) {", + " rootObject = rootObject.getInstanceContainer().getOwner();", + " }", + "", + " const layer = gameScene.getLayer(rootObject.getLayer());", + " layer.__particleEmmiter3DExtension = layer.__particleEmmiter3DExtension || {};", + " if (!layer.__particleEmmiter3DExtension.batchSystem) {", + " const batchSystem = new gdjs.__particleEmmiter3DExtension.BatchedRenderer();", + " batchSystem.scale.y *= -1;", + " 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": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check that emission has ended and no particle is alive anymore.", + "fullName": "Emission has ended", + "functionType": "Condition", + "name": "HasEnded", + "sentence": "Emission from _PARAM0_ has ended", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "\r", + "eventsFunctionContext.returnValue =\r", + " object._getShouldAutodestruct()\r", + " && object.__particleSystem.emitEnded\r", + " && object.__particleSystem.particleNum === 0;\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Restart particule emission from the beginning.", + "fullName": "Restart", + "functionType": "Action", + "name": "Restart", + "sentence": "Restart particule emission from _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.CustomRuntimeObject} */\r", + "const object = objects[0];\r", + "\r", + "object.__particleSystem.restart();\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the Z position of the emitter.", + "fullName": "Z elevaltion (deprecated)", + "functionType": "ExpressionAndCondition", + "group": "Position", + "name": "Z", + "private": true, + "sentence": "the Z position", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyZ()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Z", + "name": "SetZ", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Z", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the rotation on X axis of the emitter.", + "fullName": "Rotation on X axis (deprecated)", + "functionType": "ExpressionAndCondition", + "group": "Angle", + "name": "RotationX", + "private": true, + "sentence": "the rotation on X axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyRotationX()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "RotationX", + "name": "SetRotationX", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "RotationX", + "=", + "Value" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "\r", + "object.__particleSystem.emitter.rotation.x = eventsFunctionContext.getArgument(\"Value\") * Math.PI / 180;" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the rotation on Y axis of the emitter.", + "fullName": "Rotation on Y axis (deprecated)", + "functionType": "ExpressionAndCondition", + "group": "Angle", + "name": "RotationY", + "private": true, + "sentence": "the rotation on Y axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyRotationY()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "RotationY", + "name": "SetRotationY", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "RotationY", + "=", + "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": "SetStringVariable" + }, + "parameters": [ + "StartColor", + "=", + "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": "SetStringVariable" + }, + "parameters": [ + "EndColor", + "=", + "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": "SetNumberVariable" + }, + "parameters": [ + "StartOpacity", + "=", + "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": "SetNumberVariable" + }, + "parameters": [ + "EndOpacity", + "=", + "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": "SetNumberVariable" + }, + "parameters": [ + "Flow", + "=", + "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": "SetNumberVariable" + }, + "parameters": [ + "StartSizeMin", + "=", + "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": "SetNumberVariable" + }, + "parameters": [ + "StartSizeMax", + "=", + "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": "SetNumberVariable" + }, + "parameters": [ + "EndScale", + "=", + "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": "SetNumberVariable" + }, + "parameters": [ + "StartSpeedMin", + "=", + "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": "SetNumberVariable" + }, + "parameters": [ + "StartSpeedMax", + "=", + "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": "SetNumberVariable" + }, + "parameters": [ + "LifespanMin", + "=", + "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": "SetNumberVariable" + }, + "parameters": [ + "LifespanMax", + "=", + "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": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "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": "BooleanVariable" + }, + "parameters": [ + "AreParticlesRelative", + "True", + "" + ] + } + ], + "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": "BooleanVariable" + }, + "parameters": [ + "Value", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "AreParticlesRelative", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Value", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "AreParticlesRelative", + "True", + "" + ] + } + ] + }, + { + "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": "SetNumberVariable" + }, + "parameters": [ + "SpayConeAngle", + "=", + "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": "SetStringVariable" + }, + "parameters": [ + "Blending", + "=", + "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": "SetStringVariable" + }, + "parameters": [ + "GravityTop", + "=", + "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": "SetNumberVariable" + }, + "parameters": [ + "Gravity", + "=", + "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": "BooleanVariable" + }, + "parameters": [ + "ShouldAutodestruct", + "True", + "" + ] + } + ], + "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": "BooleanVariable" + }, + "parameters": [ + "Value", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "ShouldAutodestruct", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Value", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "ShouldAutodestruct", + "True", + "" + ] + } + ] + } + ], + "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", + "group": "Color", + "name": "StartColor" + }, + { + "value": "255;255;0", + "type": "Color", + "label": "End color", + "group": "Color", + "name": "EndColor" + }, + { + "value": "255", + "type": "Number", + "unit": "Dimensionless", + "label": "Start opacity", + "group": "Color", + "name": "StartOpacity" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "End opacity", + "group": "Color", + "name": "EndOpacity" + }, + { + "value": "50", + "type": "Number", + "label": "Flow of particles (particles per second)", + "name": "Flow" + }, + { + "value": "10", + "type": "Number", + "unit": "Pixel", + "label": "Start min size", + "group": "Size", + "name": "StartSizeMin" + }, + { + "value": "20", + "type": "Number", + "unit": "Pixel", + "label": "Start max size", + "group": "Size", + "name": "StartSizeMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "End scale", + "group": "Size", + "name": "EndScale" + }, + { + "value": "100", + "type": "Number", + "unit": "PixelSpeed", + "label": "Start min speed", + "group": "Speed", + "name": "StartSpeedMin" + }, + { + "value": "100", + "type": "Number", + "unit": "PixelSpeed", + "label": "Start max speed", + "group": "Speed", + "name": "StartSpeedMax" + }, + { + "value": "1", + "type": "Number", + "unit": "Second", + "label": "Min lifespan", + "name": "LifespanMin" + }, + { + "value": "2", + "type": "Number", + "unit": "Second", + "label": "Max lifespan", + "name": "LifespanMax" + }, + { + "value": "5", + "type": "Number", + "unit": "Second", + "label": "Emission duration", + "name": "Duration" + }, + { + "value": "", + "type": "Boolean", + "label": "Particles move with the emitter", + "group": "Speed", + "name": "AreParticlesRelative" + }, + { + "value": "30", + "type": "Number", + "unit": "DegreeAngle", + "label": "Spay cone angle", + "group": "Position", + "name": "SpayConeAngle" + }, + { + "value": "Additive", + "type": "Choice", + "label": "Blending", + "group": "Color", + "choices": [ + { + "label": "Normal", + "value": "Normal" + }, + { + "label": "Additive", + "value": "Additive" + }, + { + "label": "Subtractive", + "value": "Subtractive" + }, + { + "label": "Multiply", + "value": "Multiply" + }, + { + "label": "None", + "value": "None" + } + ], + "name": "Blending" + }, + { + "value": "Y-", + "type": "Choice", + "label": "Gravity top", + "group": "Speed", + "choices": [ + { + "label": "Y-", + "value": "Y-" + }, + { + "label": "Z+", + "value": "Z+" + } + ], + "name": "GravityTop" + }, + { + "value": "0", + "type": "Number", + "unit": "PixelAcceleration", + "label": "Gravity", + "group": "Speed", + "name": "Gravity" + }, + { + "value": "true", + "type": "Boolean", + "label": "Delete when emission ends", + "name": "ShouldAutodestruct" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "hidden": true, + "name": "ParentOrigin" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z (elevation)", + "description": "Deprecated", + "group": "Position", + "hidden": true, + "name": "Z" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation on X axis", + "group": "Position", + "hidden": true, + "name": "RotationX" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation on Y axis", + "group": "Position", + "hidden": true, + "name": "RotationY" + } + ], + "variants": [] + } + ] + }, + { + "author": "@Bouh", + "category": "User interface", + "extensionNamespace": "", + "fullName": "Time formatting", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWNsb2NrLWRpZ2l0YWwiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMiw2QTIsMiAwIDAsMCAwLDhWMTZBMiwyIDAgMCwwIDIsMThIMjJBMiwyIDAgMCwwIDI0LDE2VjhBMiwyIDAgMCwwIDIyLDZNMiw4SDIyVjE2SDJNMyw5VjEwLjVINi4yNUwzLDE1SDQuNzVMOCwxMC41VjlNOS4yNSw5VjEwLjVIMTAuNzVWOU0xMiw5VjEwLjVIMTMuNVYxNUgxNVY5TTE3LDlBMSwxIDAgMCwwIDE2LDEwVjE0QTEsMSAwIDAsMCAxNywxNUgyMEExLDEgMCAwLDAgMjEsMTRWMTBBMSwxIDAgMCwwIDIwLDlNMTcuNSwxMC41SDE5LjVWMTMuNUgxNy41TTkuMjUsMTMuNVYxNUgxMC43NVYxMy41IiAvPjwvc3ZnPg==", + "name": "TimeFormatter", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/clock-digital.svg", + "shortDescription": "Converts seconds into standard time formats, such as HH:MM:SS. ", + "version": "0.0.2", + "description": [ + "Ideal for displaying timers on screen.", + "", + "Formats included:", + "* HH:MM:SS", + "* HH:MM:SS.000 (displays milliseconds)" + ], + "origin": { + "identifier": "TimeFormatter", + "name": "gdevelop-extension-store" + }, + "tags": [ + "time", + "timer", + "format", + "hours", + "minutes", + "seconds", + "milliseconds" + ], + "authorIds": [ + "2OwwM8ToR9dx9RJ2sAKTcrLmCB92" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ { - "angle": 90, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadBend", - "persistentUuid": "b513f37a-9788-4ca8-ad24-a10607a409be", - "width": 0, - "x": -3456, - "y": -1152, - "zOrder": 45, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Format time in seconds to HH:MM:SS.", + "fullName": "Format time in seconds to HH:MM:SS", + "functionType": "StringExpression", + "name": "SecondsToHHMMSS", + "sentence": "Format time _PARAM1_ to HH:MM:SS in _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "var format_time = function (time_second) {\r", + " date = new Date(null);\r", + " date.setSeconds(time_second);\r", + " if (time_second >= 3600) {\r", + " return date.toISOString().substr(11, 8); // MM:SS\r", + " } else {\r", + " return date.toISOString().substr(14, 5); // HH:MM:SS\r", + " }\r", + "}\r", + "\r", + "eventsFunctionContext.returnValue = format_time(eventsFunctionContext.getArgument(\"TimeInSeconds\"));" + ], + "parameterObjects": "", + "useStrict": false, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Time, in seconds", + "name": "TimeInSeconds", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Coin", - "persistentUuid": "cbd66354-aa75-4dbb-a3e8-279964278708", - "rotationY": 90, - "width": 0, - "x": -1984, - "y": 2750, - "z": 21, - "zOrder": 27, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "description": "Format time in seconds to HH:MM:SS.000, including milliseconds.", + "fullName": "Format time in seconds to HH:MM:SS.000", + "functionType": "StringExpression", + "name": "SecondsToHHMMSS000", + "sentence": "Format time _PARAM1_ to HH:MM:SS in _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "var format_time = function (time_second) {\r", + " date = new Date(null);\r", + " date.setMilliseconds(1000*time_second);\r", + " if (time_second >= 3600) {\r", + " return date.toISOString().substr(11, 12); // MM:SS.000\r", + " } else {\r", + " return date.toISOString().substr(14, 9); // HH:MM:SS.000\r", + " }\r", + "}\r", + "\r", + "eventsFunctionContext.returnValue = format_time(eventsFunctionContext.getArgument(\"TimeInSeconds\"));" + ], + "parameterObjects": "", + "useStrict": false, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Time, in seconds", + "name": "TimeInSeconds", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "User interface", + "extensionNamespace": "", + "fullName": "Panel sprite button", + "gdevelopVersion": ">=5.5.230", + "helpPath": "/objects/button", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI5LDIzSDNjLTEuMSwwLTItMC45LTItMlYxMWMwLTEuMSwwLjktMiwyLTJoMjZjMS4xLDAsMiwwLjksMiwydjEwQzMxLDIyLjEsMzAuMSwyMywyOSwyM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMywxOUwxMywxOWMtMS4xLDAtMi0wLjktMi0ydi0yYzAtMS4xLDAuOS0yLDItMmgwYzEuMSwwLDIsMC45LDIsMnYyQzE1LDE4LjEsMTQuMSwxOSwxMywxOXoiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIxOCIgeTE9IjEzIiB4Mj0iMTgiIHkyPSIxOSIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIxIiB5MT0iMTMiIHgyPSIxOCIgeTI9IjE3Ii8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMjEiIHkxPSIxOSIgeDI9IjE5IiB5Mj0iMTYiLz4NCjwvc3ZnPg0K", + "name": "PanelSpriteButton", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg", + "shortDescription": "A button that can be customized.", + "version": "2.1.1", + "description": [ + "A button that can be used for menus and most labelled buttons of a game. The button can be customized with a background for each state and a label. It handles user interactions and a simple condition can be used to check if it is clicked.", + "", + "There are ready-to-use buttons in the asset-store [menu buttons pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=menu-buttons-menu-buttons)." + ], + "origin": { + "identifier": "PanelSpriteButton", + "name": "gdevelop-extension-store" + }, + "tags": [ + "button", + "ui" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "changelog": [ { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Coin", - "persistentUuid": "b9d44291-2f67-4945-9cf5-fc46e2373c43", - "rotationY": 90, - "width": 0, - "x": -2176, - "y": 2750, - "z": 21, - "zOrder": 27, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "version": "2.0.0", + "breaking": "- Buttons now use \"variants\", allowing easy swapping of their visual aspect. You will have to make some adjustments to existing buttons in your project. Follow this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/) to do these changes." + } + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Coin", - "persistentUuid": "1ba16ea5-93e3-424c-91cf-17a1c708f31d", - "rotationY": 90, - "width": 0, - "x": -2080, - "y": 2750, - "z": 21, - "zOrder": 27, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "description": "Check if the events are running for the editor.", + "fullName": "Editor is running", + "functionType": "Condition", + "name": "IsInGameEdition", + "private": true, + "sentence": "Events are running for the editor", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const game = runtimeScene.getGame();\r", + "eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Coin", - "persistentUuid": "93ec0aa2-0322-46e8-bd55-9cc9f11dde20", - "rotationY": 90, - "width": 0, - "x": -1946, - "y": 2517, - "z": 21, - "zOrder": 27, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "description": "The finite state machine used internally by the button object.", + "fullName": "Button finite state machine", + "name": "ButtonFSM", + "objectType": "", + "private": true, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PanelSpriteButton::IsInGameEdition" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [], + "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": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"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": "SetBooleanVariable" + }, + "parameters": [ + "MouseIsInside", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "ShouldCheckHovering", + "True", + "" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "MouseOnlyCursorX(Object.Layer(), 0)", + "MouseOnlyCursorY(Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "MouseIsInside", + "True", + "" + ] + } + ] + }, + { + "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": "SetBooleanVariable" + }, + "parameters": [ + "TouchIsInside", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TouchId", + "!=", + "0" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(TouchId, Object.Layer(), 0)", + "TouchY(TouchId, Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "TouchIsInside", + "True", + "" + ] + } + ] + } + ], + "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": "SetNumberVariable" + }, + "parameters": [ + "Index", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StartedTouchOrMouseCount()", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(Index), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Index), Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchId", + "=", + "StartedTouchOrMouseId(Index)" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "TouchIsInside", + "True", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + }, + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"PressedInside\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Index", + "+", + "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": "BooleanVariable" + }, + "parameters": [ + "MouseIsInside", + "True", + "" + ] + }, + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"Idle\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MouseIsInside", + "True", + "" + ] + }, + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"Hovered\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "TouchIsInside", + "True", + "" + ] + }, + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"PressedOutside\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "TouchIsInside", + "True", + "" + ] + }, + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"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": [ + "", + "TouchId" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchId", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"Validated\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"PressedInside\"" + ] + }, + { + "type": { + "inverted": true, + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"Idle\"" + ] + } + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::ResetState" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Reset the state of the button.", + "fullName": "Reset state", + "functionType": "Action", + "name": "ResetState", + "private": true, + "sentence": "Reset the button state of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"Idle\"" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchId", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is not used.", + "fullName": "Is idle", + "functionType": "Condition", + "name": "IsIdle", + "sentence": "_PARAM0_ is idle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button was just clicked.", + "fullName": "Is clicked", + "functionType": "Condition", + "name": "IsClicked", + "sentence": "_PARAM0_ is clicked", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the cursor is hovered over the button.", + "fullName": "Is hovered", + "functionType": "Condition", + "name": "IsHovered", + "sentence": "_PARAM0_ is hovered", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is either hovered or pressed but not hovered.", + "fullName": "Is focused", + "functionType": "Condition", + "name": "IsFocused", + "sentence": "_PARAM0_ is focused", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is currently being pressed with mouse or touch.", + "fullName": "Is pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "_PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is currently being pressed outside with mouse or touch.", + "fullName": "Is held outside", + "functionType": "Condition", + "name": "IsPressedOutside", + "sentence": "_PARAM0_ is held outside", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the touch id that is using the button or 0 if none.", + "fullName": "Touch id", + "functionType": "ExpressionAndCondition", + "name": "TouchId", + "sentence": "the touch id", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TouchId" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "true", + "type": "Boolean", + "label": "", + "description": "Should check hovering", + "hidden": true, + "name": "ShouldCheckHovering" + }, + { + "value": "Idle", + "type": "Choice", + "label": "State", + "choices": [ + { + "label": "Idle", + "value": "Idle" + }, + { + "label": "Hovered", + "value": "Hovered" + }, + { + "label": "PressedInside", + "value": "PressedInside" + }, + { + "label": "PressedOutside", + "value": "PressedOutside" + }, + { + "label": "Validated", + "value": "Validated" + } + ], + "hidden": true, + "name": "State" + }, + { + "value": "0", + "type": "Number", + "label": "Touch id", + "hidden": true, + "name": "TouchId" + }, + { + "value": "", + "type": "Boolean", + "label": "Touch is inside", + "hidden": true, + "name": "TouchIsInside" + }, + { + "value": "", + "type": "Boolean", + "label": "Mouse is inside", + "hidden": true, + "name": "MouseIsInside" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "Index" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [ { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "SuvLuxury", - "persistentUuid": "fdeae199-6038-4af9-8471-6983634af29b", - "width": 0, - "x": -2454, - "y": 791, - "z": 4, - "zOrder": 28, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "areaMaxX": 256, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "defaultName": "Button", + "description": "A button that can be customized.", + "fullName": "Button (panel sprite)", + "isInnerAreaFollowingParentSize": true, + "isUsingLegacyInstancesRenderer": false, + "name": "PanelSpriteButton", + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Label", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "topEdgeAnchor": 4, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ], + "string": "Text", + "font": "", + "textAlignment": "center", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Text", + "font": "", + "textAlignment": "center", + "verticalTextAlignment": "center", + "characterSize": 20, + "lineHeight": 0, + "color": "0;0;0" + } + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Idle", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [ + { + "folded": true, + "name": "State", + "type": "string", + "value": "Idle" + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "ButtonFSM", + "type": "PanelSpriteButton::ButtonFSM", + "ShouldCheckHovering": true + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Hovered", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Pressed", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "name": "BitmapLabel", + "type": "BitmapText::BitmapTextObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "topEdgeAnchor": 4, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "text": "Text", + "opacity": 255, + "scale": 1, + "fontSize": 20, + "tint": "255;255;255", + "bitmapFontResourceName": "", + "textureAtlasResourceName": "", + "align": "center", + "verticalTextAlignment": "center" + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Label" + }, + { + "objectName": "BitmapLabel" + }, + { + "objectName": "Idle" + }, + { + "objectName": "Hovered" + }, + { + "objectName": "Pressed" + } + ] + }, + "objectsGroups": [ + { + "name": "Background", + "objects": [ + { + "name": "Idle" + }, + { + "name": "Hovered" + }, + { + "name": "Pressed" + } + ] + }, + { + "name": "Labels", + "objects": [ + { + "name": "Label" + }, + { + "name": "BitmapLabel" + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 64, + "layer": "", + "name": "Idle", + "persistentUuid": "24882334-eec8-403e-8bf1-70fc928a46e6", + "width": 256, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 64, + "layer": "", + "name": "Label", + "persistentUuid": "3b29c95c-5363-4e25-bf47-eecf13e8a226", + "width": 256, + "x": 0, + "y": 32, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": {}, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Create one background instance for of each state.\nOnly the instance for the current state is shown." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Hovered", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Pressed", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetSize" + }, + "parameters": [ + "Hovered", + "Resizable", + "Idle.Width()", + "Idle.Height()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetSize" + }, + "parameters": [ + "Pressed", + "Resizable", + "Idle.Width()", + "Idle.Height()" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Hovered" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Pressed" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Hovered", + "=", + "1" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Pressed", + "=", + "1" + ] + }, + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "Labels", + "Text", + "=", + "LabelText" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [ + { + "name": "Background", + "objects": [ + { + "name": "Idle" + }, + { + "name": "Hovered" + }, + { + "name": "Pressed" + } + ] + } + ] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsPressed" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" + }, + "parameters": [ + "Object", + "=", + "PressedLabelOffsetY", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "Labels", + "Text", + "=", + "LabelText" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Apply states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Show the right background accordingly to the new state." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsIdle" + }, + "parameters": [ + "Object", + "ButtonFSM" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" + }, + "parameters": [ + "Object", + "=", + "0", + "" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Idle", + "" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Pressed" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Visible" + }, + "parameters": [ + "Hovered" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "HoveredFadeOutDuration", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::TweenBehavior::AddObjectOpacityTween2" + }, + "parameters": [ + "Hovered", + "Tween", + "\"Fadeout\"", + "0", + "\"linear\"", + "HoveredFadeOutDuration", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "HoveredFadeOutDuration", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Hovered" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "OpacityCapability::OpacityBehavior::Value" + }, + "parameters": [ + "Hovered", + "Opacity", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Hovered" + ] + }, + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "Hovered", + "Opacity", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsHovered" + }, + "parameters": [ + "Object", + "ButtonFSM" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" + }, + "parameters": [ + "Object", + "=", + "0", + "" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Idle" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Hovered", + "" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Pressed" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Hovered", + "Tween", + "\"Fadeout\"" + ] + }, + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "Hovered", + "Opacity", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsPressed" + }, + "parameters": [ + "Object", + "ButtonFSM" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" + }, + "parameters": [ + "Object", + "=", + "PressedLabelOffsetY", + "" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Idle" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Hovered" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Pressed", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsFocused" + }, + "parameters": [ + "Object", + "ButtonFSM" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" + }, + "parameters": [ + "Object", + "=", + "0", + "" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Idle" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Hovered", + "" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Pressed" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is not used.", + "fullName": "Is idle", + "functionType": "Condition", + "name": "IsIdle", + "sentence": "_PARAM0_ is idle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::IsIdle" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button was just clicked.", + "fullName": "Is clicked", + "functionType": "Condition", + "name": "IsClicked", + "sentence": "_PARAM0_ is clicked", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::IsClicked" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the cursor is hovered over the button.", + "fullName": "Is hovered", + "functionType": "Condition", + "name": "IsHovered", + "sentence": "_PARAM0_ is hovered", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::IsHovered" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is either hovered or pressed but not hovered.", + "fullName": "Is focused", + "functionType": "Condition", + "name": "IsFocused", + "sentence": "_PARAM0_ is focused", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::IsFocused" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is currently being pressed with mouse or touch.", + "fullName": "Is pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "_PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::IsPressed" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Change the text of the button label.", + "fullName": "Label text", + "functionType": "Action", + "name": "SetLabelText", + "private": true, + "sentence": "Change the text of _PARAM0_ to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "Labels", + "Text", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + }, + { + "description": "Text", + "name": "Value", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "LabelText", + "name": "SetLabelTextOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "Labels", + "Text", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the label text.", + "fullName": "Label text", + "functionType": "ExpressionAndCondition", + "name": "LabelText", + "sentence": "the label text", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Labels.Text::Value()" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "De/activate interactions with the button.", + "fullName": "De/activate interactions", + "functionType": "Action", + "name": "Activate", + "sentence": "Activate interactions with _PARAM0_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "ShouldActivate", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "ShouldActivate", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "no" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + }, + { + "description": "Activate", + "name": "ShouldActivate", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Check if interactions are activated on the button.", + "fullName": "Interactions activated", + "functionType": "Condition", + "name": "IsActivated", + "sentence": "Interactions on _PARAM0_ are activated", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BehaviorActivated" + }, + "parameters": [ + "Idle", + "ButtonFSM" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the labelOffset of the object.", + "fullName": "LabelOffset", + "functionType": "ExpressionAndCondition", + "name": "LabelOffset", + "private": true, + "sentence": "the labelOffset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "LabelOffset" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "LabelOffset", + "name": "SetLabelOffset", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Labels", + "+", + "Value - LabelOffset" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "LabelOffset", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "MultilineString", + "label": "Label", + "name": "LabelText" + }, + { + "value": "0.25", + "type": "Number", + "unit": "Second", + "label": "Hovered fade out duration", + "group": "States", + "name": "HoveredFadeOutDuration" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Label offset on Y axis when pressed", + "group": "States", + "name": "PressedLabelOffsetY" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "", + "hidden": true, + "name": "LabelOffset" + }, + { + "value": "", + "type": "Choice", + "label": "", + "choices": [ + { + "label": "Label.Text=LabelText", + "value": "Label.Text=LabelText" + }, + { + "label": "BitmapLabel.Text=LabelText", + "value": "BitmapLabel.Text=LabelText" + } + ], + "hidden": true, + "name": "_PropertyMapping" + } + ], + "variants": [ + { + "areaMaxX": 256, + "areaMaxY": 106, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "Yellow button 2", + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Label", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "topEdgeAnchor": 4, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ], + "string": "Button", + "font": "Chango-Regular.ttf", + "textAlignment": "center", + "characterSize": 40, + "color": { + "b": 42, + "g": 87, + "r": 139 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Button", + "font": "Chango-Regular.ttf", + "textAlignment": "center", + "verticalTextAlignment": "center", + "characterSize": 40, + "lineHeight": 0, + "color": "139;87;42" + } + }, + { + "assetStoreId": "", + "bottomMargin": 32, + "height": 106, + "leftMargin": 16, + "name": "Idle", + "rightMargin": 16, + "texture": "Yellow Button_Idle.png", + "tiled": false, + "topMargin": 16, + "type": "PanelSpriteObject::PanelSprite", + "width": 256, + "variables": [ + { + "folded": true, + "name": "State", + "type": "string", + "value": "Idle" + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "ButtonFSM", + "type": "PanelSpriteButton::ButtonFSM", + "ShouldCheckHovering": true + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 32, + "height": 106, + "leftMargin": 16, + "name": "Hovered", + "rightMargin": 16, + "texture": "Yellow Button_Hovered.png", + "tiled": false, + "topMargin": 16, + "type": "PanelSpriteObject::PanelSprite", + "width": 256, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 16, + "height": 106, + "leftMargin": 16, + "name": "Pressed", + "rightMargin": 16, + "texture": "Yellow Button_Pressed.png", + "tiled": false, + "topMargin": 32, + "type": "PanelSpriteObject::PanelSprite", + "width": 256, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Label" + }, + { + "objectName": "Idle" + }, + { + "objectName": "Hovered" + }, + { + "objectName": "Pressed" + } + ] + }, + "objectsGroups": [ + { + "name": "Background", + "objects": [ + { + "name": "Idle" + }, + { + "name": "Hovered" + }, + { + "name": "Pressed" + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 106, + "layer": "", + "name": "Idle", + "persistentUuid": "24882334-eec8-403e-8bf1-70fc928a46e6", + "width": 256, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 81, + "layer": "", + "name": "Label", + "persistentUuid": "3b29c95c-5363-4e25-bf47-eecf13e8a226", + "width": 240, + "x": 8, + "y": 48, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": {} + }, + { + "areaMaxX": 256, + "areaMaxY": 128, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "assetStoreAssetId": "72c8adcfb9187ebb5fcfbcd75bc18c74d6af5507e7c482cadcfad28f8011b387", + "assetStoreOriginalName": "Orange Bubble Button", + "name": "Orange Bubble Button", + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Label", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ], + "string": "Button", + "font": "Poppins-Medium.ttf", + "textAlignment": "center", + "characterSize": 60, + "color": { + "b": 0, + "g": 42, + "r": 117 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Button", + "font": "Poppins-Medium.ttf", + "textAlignment": "center", + "verticalTextAlignment": "center", + "characterSize": 60, + "lineHeight": 0, + "color": "117;42;0" + } + }, + { + "assetStoreId": "", + "bottomMargin": 35, + "height": 128, + "leftMargin": 56, + "name": "Idle", + "rightMargin": 35, + "texture": "Orange Bubble Button_Idle.png", + "tiled": false, + "topMargin": 35, + "type": "PanelSpriteObject::PanelSprite", + "width": 256, + "variables": [ + { + "folded": true, + "name": "State", + "type": "string", + "value": "Idle" + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "ButtonFSM", + "type": "PanelSpriteButton::ButtonFSM", + "serializedBehavior": { + "name": "ButtonFSM", + "type": "PanelSpriteButton::ButtonFSM", + "ShouldCheckHovering": true + } + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 35, + "height": 128, + "leftMargin": 56, + "name": "Hovered", + "rightMargin": 35, + "texture": "Orange Bubble Button_Hovered.png", + "tiled": false, + "topMargin": 35, + "type": "PanelSpriteObject::PanelSprite", + "width": 256, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior", + "serializedBehavior": { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 35, + "height": 128, + "leftMargin": 35, + "name": "Pressed", + "rightMargin": 35, + "texture": "Orange Bubble Button_Pressed.png", + "tiled": false, + "topMargin": 35, + "type": "PanelSpriteObject::PanelSprite", + "width": 256, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Label" + }, + { + "objectName": "Idle" + }, + { + "objectName": "Hovered" + }, + { + "objectName": "Pressed" + } + ] + }, + "objectsGroups": [ + { + "name": "Background", + "objects": [ + { + "name": "Idle" + }, + { + "name": "Hovered" + }, + { + "name": "Pressed" + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": false, + "depth": 1, + "height": 64, + "layer": "", + "name": "Idle", + "persistentUuid": "24882334-eec8-403e-8bf1-70fc928a46e6", + "width": 64, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 110, + "keepRatio": true, + "layer": "", + "name": "Label", + "persistentUuid": "8aabdbe2-ad4d-4746-839b-9f769bc07c5e", + "width": 238, + "x": 9, + "y": 64, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": {} + }, + { + "areaMaxX": 256, + "areaMaxY": 106, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "assetStoreAssetId": "615de0316452630b9f4f6a39decc82e2449b82c1afd1ff24d6470dad2922177b", + "assetStoreOriginalName": "Yellow button", + "name": "Yellow button", + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Label", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "topEdgeAnchor": 4, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ], + "string": "Button", + "font": "", + "textAlignment": "center", + "characterSize": 60, + "color": { + "b": 42, + "g": 87, + "r": 139 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Button", + "font": "", + "textAlignment": "center", + "verticalTextAlignment": "center", + "characterSize": 60, + "lineHeight": 0, + "color": "139;87;42" + } + }, + { + "assetStoreId": "", + "bottomMargin": 32, + "height": 106, + "leftMargin": 16, + "name": "Idle", + "rightMargin": 16, + "texture": "Yellow Button_Idle.png", + "tiled": false, + "topMargin": 16, + "type": "PanelSpriteObject::PanelSprite", + "width": 256, + "variables": [ + { + "folded": true, + "name": "State", + "type": "string", + "value": "Idle" + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "ButtonFSM", + "type": "PanelSpriteButton::ButtonFSM", + "ShouldCheckHovering": true + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 32, + "height": 106, + "leftMargin": 16, + "name": "Hovered", + "rightMargin": 16, + "texture": "Yellow Button_Hovered.png", + "tiled": false, + "topMargin": 16, + "type": "PanelSpriteObject::PanelSprite", + "width": 256, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 16, + "height": 106, + "leftMargin": 16, + "name": "Pressed", + "rightMargin": 16, + "texture": "Yellow Button_Pressed.png", + "tiled": false, + "topMargin": 32, + "type": "PanelSpriteObject::PanelSprite", + "width": 256, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Label" + }, + { + "objectName": "Idle" + }, + { + "objectName": "Hovered" + }, + { + "objectName": "Pressed" + } + ] + }, + "objectsGroups": [ + { + "name": "Background", + "objects": [ + { + "name": "Idle" + }, + { + "name": "Hovered" + }, + { + "name": "Pressed" + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 106, + "layer": "", + "name": "Idle", + "persistentUuid": "24882334-eec8-403e-8bf1-70fc928a46e6", + "width": 256, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 81, + "layer": "", + "name": "Label", + "persistentUuid": "3b29c95c-5363-4e25-bf47-eecf13e8a226", + "width": 240, + "x": 8, + "y": 48, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": {} + } + ] + } + ] + }, + { + "author": "D8H", + "category": "Movement", + "extensionNamespace": "", + "fullName": "Stick objects to others", + "gdevelopVersion": ">=5.5.222", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXN0aWNrZXItb3V0bGluZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik01LjUgMkMzLjYgMiAyIDMuNiAyIDUuNVYxOC41QzIgMjAuNCAzLjYgMjIgNS41IDIySDE2TDIyIDE2VjUuNUMyMiAzLjYgMjAuNCAyIDE4LjUgMkg1LjVNNS44IDRIMTguM0MxOS4zIDQgMjAuMSA0LjggMjAuMSA1LjhWMTVIMTguNkMxNi43IDE1IDE1LjEgMTYuNiAxNS4xIDE4LjVWMjBINS44QzQuOCAyMCA0IDE5LjIgNCAxOC4yVjUuOEM0IDQuOCA0LjggNCA1LjggNCIgLz48L3N2Zz4=", + "name": "Sticker", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/sticker-outline.svg", + "shortDescription": "Make objects follow the position and rotation of the object they are stuck to.", + "version": "0.5.4", + "description": [ + "This extension can be useful to:", + "- Stick accessories to moving objects", + "- Animate a skeleton", + "- Delete an object with another one", + "", + "An example allows to check it out ([open the project online](https://editor.gdevelop.io/?project=example://stick-objects))." + ], + "origin": { + "identifier": "Sticker", + "name": "gdevelop-extension-store" + }, + "tags": [ + "sticker", + "stick", + "follow", + "skeleton", + "joint", + "pin", + "bind", + "glue", + "tie", + "attach", + "hold", + "paste", + "wear" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "SuvLuxury", - "persistentUuid": "8e164f83-fe1e-4c63-8b3d-e66a756aba3a", - "width": 0, - "x": -2294, - "y": 791, - "z": 4, - "zOrder": 28, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Define helper classes JavaScript code.", + "fullName": "Define helper classes", + "functionType": "Action", + "name": "DefineHelperClasses", + "private": true, + "sentence": "Define helper classes JavaScript code", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (gdjs._stickerExtension) {", + " return;", + "}", + "", + "// Unstick from deleted objects.", + "gdjs.registerObjectDeletedFromSceneCallback(function (runtimeScene, deletedObject) {", + " const extension = runtimeScene._stickerExtension;", + " if (!extension) {", + " return;", + " }", + " /** @type {Set} */", + " const allStickers = runtimeScene._stickerExtension.allStickers;", + " for (const behavior of allStickers) {", + " /** @type {Sticker} */", + " const sticker = behavior._sticker;", + " if (sticker.isStuckTo(deletedObject)) {", + " if (behavior._getIsDestroyedWithParent()) {", + " behavior.owner.deleteFromScene(runtimeScene);", + " }", + " sticker.unstick();", + " }", + " }", + "});", + "", + "class Sticker {", + " /** @type {gdjs.RuntimeBehavior} */", + " behavior;", + " /** @type {gdjs.RuntimeObject | null} */", + " basisObject;", + " followingDoneThisFrame = false;", + " relativeX = 0;", + " relativeY = 0;", + " relativeAngle = 0;", + " relativeRotatedX = 0;", + " relativeRotatedY = 0;", + " basisOldX = 0;", + " basisOldY = 0;", + " basisOldAngle = 0;", + " basisOldWidth = 0;", + " basisOldHeight = 0;", + " basisOldCenterXInScene = 0;", + " basisOldCenterYInScene = 0;", + "", + " /**", + " * @param {gdjs.RuntimeBehavior} behavior", + " */", + " constructor(behavior) {", + " this.behavior = behavior;", + " }", + "", + " /**", + " * @param {gdjs.RuntimeObject} basisObject", + " */", + " isStuckTo(basisObject) {", + " return this.basisObject === basisObject;", + " }", + "", + " /**", + " * @param {gdjs.RuntimeObject} basisObject", + " */", + " stickTo(basisObject) {", + " this.basisObject = basisObject;", + " this.updateOldCoordinates();", + " this.updateRelativeCoordinates();", + " }", + "", + " unstick() {", + " this.basisObject = null;", + " }", + "", + " onStepPreEvents() {", + " this.followingDoneThisFrame = false;", + " }", + "", + " /**", + " * Update the coordinates in the basisObject basis.", + " * ", + " * It uses the basisObject coordinates from the previous frame.", + " * This way, the sticker can move relatively to it and still", + " * follow basisObject.", + " * ", + " * @param {gdjs.RuntimeObject} basisObject", + " */", + " updateRelativeCoordinates() {", + " const object = this.behavior.owner;", + "", + " // Update relative coordinates", + " this.relativeX = object.getX() - this.basisOldX;", + " this.relativeY = object.getY() - this.basisOldY;", + " if (!this.behavior._getOnlyFollowPosition()) {", + " this.relativeAngle = object.getAngle() - this.basisOldAngle;", + " this.relativeWidth = object.getWidth() / this.basisOldWidth;", + " this.relativeHeight = object.getHeight() / this.basisOldHeight;", + " const deltaX = object.getCenterXInScene() - this.basisOldCenterXInScene;", + " const deltaY = object.getCenterYInScene() - this.basisOldCenterYInScene;", + " const angle = this.basisOldAngle * Math.PI / 180;", + " const cosA = Math.cos(angle);", + " const sinA = Math.sin(angle);", + " this.relativeRotatedX = (deltaX * cosA + deltaY * sinA) / this.basisOldWidth;", + " this.relativeRotatedY = (-deltaX * sinA + deltaY * cosA) / this.basisOldHeight;", + "", + " // Save initial values to avoid calculus and rounding errors", + " this.basisOriginalWidth = this.basisObject.getWidth();", + " this.basisOriginalHeight = this.basisObject.getHeight();", + " this.basisOriginalAngle = this.basisObject.getAngle();", + " }", + " }", + "", + " /**", + " * Copy the coordinates to use it the next frame.", + " */", + " updateOldCoordinates() {", + " const object = this.behavior.owner;", + "", + " this.ownerOldX = object.getX();", + " this.ownerOldY = object.getY();", + "", + " this.basisOldX = this.basisObject.getX();", + " this.basisOldY = this.basisObject.getY();", + "", + " if (!this.behavior._getOnlyFollowPosition()) {", + " this.ownerOldAngle = object.getAngle();", + " this.ownerOldWidth = object.getWidth();", + " this.ownerOldHeight = object.getHeight();", + "", + " this.basisOldAngle = this.basisObject.getAngle();", + " this.basisOldWidth = this.basisObject.getWidth();", + " this.basisOldHeight = this.basisObject.getHeight();", + " this.basisOldCenterXInScene = this.basisObject.getCenterXInScene();", + " this.basisOldCenterYInScene = this.basisObject.getCenterYInScene();", + " }", + " }", + "", + " /**", + " * Follow the basisObject (called in doStepPostEvents).", + " * ", + " * This method is also called by children to ensure", + " * parents are updated first.", + " */", + " followBasisObject() {", + " if (this.followingDoneThisFrame) {", + " return;", + " }", + " this.followingDoneThisFrame = true;", + " const basisObject = this.basisObject;", + " if (!basisObject) {", + " return;", + " }", + " // If the behavior on the basis object has a different name,", + " // the objects will still follow their basis objects", + " // but frame delays could happen.", + " const behaviorName = this.behavior.getName();", + " if (basisObject.hasBehavior(behaviorName)) {", + " const basisBehavior = basisObject.getBehavior(behaviorName);", + " if (basisBehavior.type === this.behavior.type) {", + " // Follow parents 1st to avoid frame delays", + " basisBehavior._sticker.followBasisObject();", + " }", + " }", + " if (this.behavior._getOnlyFollowPosition()) {", + " this.followPosition();", + " } else {", + " this.followTransformation();", + " }", + " this.updateOldCoordinates();", + " }", + "", + " followPosition() {", + " const object = this.behavior.owner;", + " const basisObject = this.basisObject;", + " if (!basisObject) {", + " return;", + " }", + " if (object.getX() !== this.ownerOldX", + " || object.getY() !== this.ownerOldY) {", + " this.updateRelativeCoordinates();", + " }", + " if (this.basisOldX !== basisObject.getX()", + " || this.basisOldY !== basisObject.getY()) {", + " object.setPosition(", + " basisObject.getX() + this.relativeX,", + " basisObject.getY() + this.relativeY);", + " }", + " }", + "", + " followTransformation() {", + " const object = this.behavior.owner;", + " const basisObject = this.basisObject;", + " if (!basisObject) {", + " return;", + " }", + " if (object.getX() !== this.ownerOldX", + " || object.getY() !== this.ownerOldY", + " || object.getAngle() !== this.ownerOldAngle", + " || object.getWidth() !== this.ownerOldWidth", + " || object.getHeight() !== this.ownerOldHeight) {", + " this.updateRelativeCoordinates();", + " }", + " if (this.basisOldAngle !== this.basisObject.getAngle()", + " || this.basisOldWidth !== this.basisObject.getWidth()", + " || this.basisOldHeight !== this.basisObject.getHeight()", + " || this.basisOldCenterXInScene !== this.basisObject.getCenterXInScene()", + " || this.basisOldCenterYInScene !== this.basisObject.getCenterYInScene()) {", + " // 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());", + " }", + " // Follow basisObject", + " if (basisObject.getAngle() === this.basisOriginalAngle", + " && this.basisOriginalAngle === 0) {", + " if (basisObject.getWidth() === this.basisOriginalWidth", + " || basisObject.getHeight() === this.basisOriginalHeight) {", + " if (this.basisOldX !== basisObject.getX() ||", + " this.basisOldY !== basisObject.getY()) {", + " object.setPosition(", + " basisObject.getX() + this.relativeX,", + " basisObject.getY() + this.relativeY);", + " }", + " } else {", + " object.setCenterPositionInScene(", + " basisObject.getCenterXInScene() + this.relativeRotatedX * basisObject.getWidth(),", + " basisObject.getCenterYInScene() + this.relativeRotatedY * basisObject.getHeight());", + " }", + " } else {", + " object.setAngle(basisObject.getAngle() + this.relativeAngle);", + "", + " const deltaX = this.relativeRotatedX * basisObject.getWidth();", + " const deltaY = this.relativeRotatedY * basisObject.getHeight();", + " const angle = -basisObject.getAngle() * Math.PI / 180;", + " const cosA = Math.cos(angle);", + " const sinA = Math.sin(angle);", + " object.setX(", + " basisObject.getCenterXInScene() + object.getX() - object.getCenterXInScene()", + " + deltaX * cosA + deltaY * sinA);", + " object.setY(", + " basisObject.getCenterYInScene() + object.getY() - object.getCenterYInScene()", + " - deltaX * sinA + deltaY * cosA);", + " }", + " }", + " }", + "}", + "", + "gdjs._stickerExtension = {", + " Sticker", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "Van", - "persistentUuid": "83bfb37d-c6d0-41a9-bdd2-5b502ea7aa54", - "width": 0, - "x": -2040, - "y": 791, - "z": 4, - "zOrder": 38, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "description": "Check if the object is stuck to another object.", + "fullName": "Is stuck to another object", + "functionType": "Condition", + "name": "IsStuck", + "sentence": "_PARAM1_ is stuck to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const stickerBehaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "/** @type {Hashtable} */", + "const stickerObjectsLists = eventsFunctionContext.getObjectsLists(\"Object\");", + "/** @type {Hashtable} */", + "const basisObjectsLists = eventsFunctionContext.getObjectsLists(\"BasisObject\");", + "", + "eventsFunctionContext.returnValue = gdjs.evtTools.object.twoListsTest(", + " (stickerObject, basisObject) => {", + " const sticker = stickerObject.getBehavior(stickerBehaviorName)._sticker;", + " return sticker.isStuckTo(basisObject);", + " },", + " stickerObjectsLists,", + " basisObjectsLists,", + " false", + ");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Sticker", + "name": "Object", + "type": "objectList" + }, + { + "description": "Sticker behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + }, + { + "description": "Basis", + "name": "BasisObject", + "type": "objectList" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "Van", - "persistentUuid": "46b869c6-e23b-441f-a55f-582b0964331b", - "width": 0, - "x": -2262, - "y": 2626, - "z": 4, - "zOrder": 37, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "description": "Stick the object to another. Use the action to stick the object, or unstick it later.", + "fullName": "Sticker", + "name": "Sticker", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Sticker::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const Sticker = gdjs._stickerExtension.Sticker;", + "", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const object = objects[0];", + "const behavior = object.getBehavior(behaviorName);", + "", + "behavior._sticker = new Sticker(behavior);", + "", + "// Set up the scene sticker objects list - if not done already.", + "runtimeScene._stickerExtension = runtimeScene._stickerExtension || {", + " allStickers: new Set(),", + "};", + "// Register this object as a sticker.", + "/** @type {Set} */", + "const allStickers = runtimeScene._stickerExtension.allStickers;", + "allStickers.add(behavior);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const object = objects[0];", + "const behavior = object.getBehavior(behaviorName);", + "", + "behavior._sticker.onStepPreEvents();" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const object = objects[0];", + "const behavior = object.getBehavior(behaviorName);", + "", + "behavior._sticker.followBasisObject();" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Stick on another object.", + "fullName": "Stick", + "functionType": "Action", + "name": "Stick", + "sentence": "Stick _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const basisObjects = eventsFunctionContext.getObjects(\"BasisObject\");", + "", + "if (basisObjects.length === 0) return;", + "// An object can stick to only one object.", + "const basisObject = basisObjects[0];", + "object.getBehavior(behaviorName)._sticker.stickTo(basisObject);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + }, + { + "description": "Object to stick to", + "name": "BasisObject", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Unstick from the object it was stuck to.", + "fullName": "Unstick", + "functionType": "Action", + "name": "Unstick", + "sentence": "Unstick _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "", + "object.getBehavior(behaviorName)._sticker.unstick();", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDestroy", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const object = objects[0];", + "const behavior = object.getBehavior(behaviorName);", + "", + "/** @type {Set} */", + "const allStickers = runtimeScene._stickerExtension.allStickers;", + "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", + "name": "OnlyFollowPosition" + }, + { + "value": "", + "type": "Boolean", + "label": "Destroy when the object it's stuck on is destroyed", + "name": "IsDestroyedWithParent" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "Tristan Rhodes (tristan@victrisgames.com), Entropy", + "category": "Movement", + "extensionNamespace": "", + "fullName": "Screen wrap", + "gdevelopVersion": ">=5.5.222", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLW1vbml0b3Itc2NyZWVuc2hvdCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik05LDZINVYxMEg3VjhIOU0xOSwxMEgxN1YxMkgxNVYxNEgxOU0yMSwxNkgzVjRIMjFNMjEsMkgzQzEuODksMiAxLDIuODkgMSw0VjE2QTIsMiAwIDAsMCAzLDE4SDEwVjIwSDhWMjJIMTZWMjBIMTRWMThIMjFBMiwyIDAgMCwwIDIzLDE2VjRDMjMsMi44OSAyMi4xLDIgMjEsMiIgLz48L3N2Zz4=", + "name": "ScreenWrap", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/monitor-screenshot.svg", + "shortDescription": "Teleport object when it moves off the screen and immediately appear on the opposite side while maintaining speed and trajectory.", + "version": "0.3.2", + "description": [ + "The teleport happens when the center point of the object crosses a border (this can be adjusted with an offset).", + "By default, the borders of the wrapping area match the screen size, but they can also be changed.", + "", + "The Asteroid-like example uses this extension ([open the project online](https://editor.gdevelop.io/?project=example://space-asteroids))." + ], + "origin": { + "identifier": "ScreenWrap", + "name": "gdevelop-extension-store" + }, + "tags": [ + "screen", + "wrap", + "teleport", + "asteroids" + ], + "authorIds": [ + "q8ubdigLvIRXLxsJDDTaokO41mc2", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1", + "1OgYzWp5UeVPbiWGJwI6vqfgZLC3" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ { - "angle": 180, - "customSize": false, - "height": 0, - "layer": "", - "name": "SuvLuxury", - "persistentUuid": "ea735180-6642-4fa4-ab42-c868975d232c", - "width": 0, - "x": -2390, - "y": 2626, - "z": 4, - "zOrder": 39, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Teleport the object when leaving one side of the screen so that it immediately reappears on the opposite side, maintaining speed and trajectory.", + "fullName": "Screen Wrap", + "name": "ScreenWrap", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Initialize variables (if needed)", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "BorderBottom", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::SetBottomBorder" + }, + "parameters": [ + "Object", + "Behavior", + "SceneWindowHeight()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "BorderRight", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::SetRightBorder" + }, + "parameters": [ + "Object", + "Behavior", + "SceneWindowWidth()", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "colorB": 5, + "colorG": 117, + "colorR": 65, + "creationTime": 0, + "name": "ScreenWrap", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Move object to opposite side (if needed)", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [], + "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object", + "<", + "BorderLeft - (Object.Width()/2) - TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "=", + "BorderRight - (Object.Width()/2) + TriggerOffset" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object", + ">", + "BorderRight - (Object.Width()/2) + TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "=", + "BorderLeft - (Object.Width()/2) - TriggerOffset" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object", + "<", + "BorderTop - (Object.Height()/2) - TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "=", + "BorderBottom - (Object.Height()/2) + TriggerOffset" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object", + ">", + "BorderBottom - (Object.Height()/2) + TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "=", + "BorderTop - (Object.Height()/2) - TriggerOffset" + ] + } + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is wrapping on the left and right borders.", + "fullName": "Is horizontal wrapping", + "functionType": "Condition", + "name": "IsHorizontalWrapping", + "sentence": "_PARAM0_ is horizontal wrapping", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is wrapping on the top and bottom borders.", + "fullName": "Is vertical wrapping", + "functionType": "Condition", + "name": "IsVerticalWrapping", + "sentence": "_PARAM0_ is vertical wrapping", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Enable wrapping on the left and right borders.", + "fullName": "Enable horizontal wrapping", + "functionType": "Action", + "name": "EnableHorizontalWrapping", + "sentence": "Enable _PARAM0_ horizontal wrapping: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "EnableHorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "EnableHorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "True", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "description": "Value", + "name": "EnableHorizontalWrapping", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Enable wrapping on the top and bottom borders.", + "fullName": "Enable vertical wrapping", + "functionType": "Action", + "name": "EnableVerticalWrapping", + "sentence": "Enable _PARAM0_ vertical wrapping: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "EnableVerticalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "EnableVerticalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "True", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "description": "Value", + "name": "EnableVerticalWrapping", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Top border (Y position).", + "fullName": "Top border", + "functionType": "Expression", + "name": "BorderTop", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BorderTop" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Left border (X position).", + "fullName": "Left border", + "functionType": "Expression", + "name": "BorderLeft", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BorderLeft" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Right border (X position).", + "fullName": "Right border", + "functionType": "Expression", + "name": "BorderRight", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BorderRight" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Bottom border (Y position).", + "fullName": "Bottom border", + "functionType": "Expression", + "name": "BorderBottom", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BorderBottom" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Number of pixels past the center where the object teleports and appears.", + "fullName": "Trigger offset", + "functionType": "Expression", + "name": "TriggerOffset", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TriggerOffset" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Set top border (Y position).", + "fullName": "Set top border", + "functionType": "Action", + "name": "SetTopBorder", + "sentence": "Set _PARAM0_ top border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderTop", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "description": "Top border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set left border (X position).", + "fullName": "Set left border", + "functionType": "Action", + "name": "SetLeftBorder", + "sentence": "Set _PARAM0_ left border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderLeft", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "description": "Left border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set bottom border (Y position).", + "fullName": "Set bottom border", + "functionType": "Action", + "name": "SetBottomBorder", + "sentence": "Set _PARAM0_ bottom border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderBottom", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "description": "Bottom border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set right border (X position).", + "fullName": "Set right border", + "functionType": "Action", + "name": "SetRightBorder", + "sentence": "Set _PARAM0_ right border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderRight", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "description": "Right border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set trigger offset (pixels).", + "fullName": "Set trigger offset", + "functionType": "Action", + "name": "SetTriggerOffset", + "sentence": "Set _PARAM0_ trigger offset to _PARAM2_ pixels", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TriggerOffset", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "description": "SetScreen Offset Leaving Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "true", + "type": "Boolean", + "label": "Horizontal wrapping", + "name": "HorizontalWrapping" + }, + { + "value": "true", + "type": "Boolean", + "label": "Vertical wrapping", + "name": "VerticalWrapping" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Top border of wrapped area (Y)", + "name": "BorderTop" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Left border of wrapped area (X)", + "name": "BorderLeft" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Right border of wrapped area (X)", + "description": "If blank, the value will be the scene width.", + "name": "BorderRight" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Bottom border of wrapped area (Y)", + "description": "If blank, the value will be scene height.", + "name": "BorderBottom" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Number of pixels past the center where the object teleports and appears", + "name": "TriggerOffset" + } + ], + "sharedPropertyDescriptors": [] }, { - "angle": 0, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "29a0fefb-02c6-45ce-bf9b-90b4f83d9b34", - "width": 1152, - "x": -3072, - "y": 2560, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "description": "Teleport the object when leaving one side of the screen so that it immediately reappears on the opposite side, maintaining speed and trajectory.", + "fullName": "Screen Wrap (physics objects)", + "name": "ScreenWrapPhysics", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Initialize variables (if needed)", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "BorderBottom", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::SetBottomBorder" + }, + "parameters": [ + "Object", + "Behavior", + "SceneWindowHeight()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "BorderRight", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::SetRightBorder" + }, + "parameters": [ + "Object", + "Behavior", + "SceneWindowWidth()", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 5, + "colorG": 117, + "colorR": 65, + "creationTime": 0, + "name": "ScreenWrap", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Move object to opposite side (if needed)", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [], + "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::IsHorizontalWrapping" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Velocity is saved because Physics2 resets objects velocities when they are moved from the outside of the extension." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object", + "<", + "BorderLeft - (Object.Width()/2) - TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "=", + "BorderRight - (Object.Width()/2) + TriggerOffset" + ] + }, + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object", + ">", + "BorderRight - (Object.Width()/2) + TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "=", + "BorderLeft - (Object.Width()/2) - TriggerOffset" + ] + }, + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::IsVerticalWrapping" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object", + "<", + "BorderTop - (Object.Height()/2) - TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "=", + "BorderBottom - (Object.Height()/2) + TriggerOffset" + ] + }, + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object", + ">", + "BorderBottom - (Object.Height()/2) + TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "=", + "BorderTop - (Object.Height()/2) - TriggerOffset" + ] + }, + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is wrapping on the left and right borders.", + "fullName": "Is horizontal wrapping", + "functionType": "Condition", + "name": "IsHorizontalWrapping", + "sentence": "_PARAM0_ is horizontal wrapping", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is wrapping on the top and bottom borders.", + "fullName": "Is vertical wrapping", + "functionType": "Condition", + "name": "IsVerticalWrapping", + "sentence": "_PARAM0_ is vertical wrapping", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Enable wrapping on the left and right borders.", + "fullName": "Enable horizontal wrapping", + "functionType": "Action", + "name": "EnableHorizontalWrapping", + "sentence": "Enable _PARAM0_ horizontal wrapping: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "EnableHorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "EnableHorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "True", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + }, + { + "description": "Value", + "name": "EnableHorizontalWrapping", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Enable wrapping on the top and bottom borders.", + "fullName": "Enable vertical wrapping", + "functionType": "Action", + "name": "EnableVerticalWrapping", + "sentence": "Enable _PARAM0_ vertical wrapping: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "EnableVerticalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "EnableVerticalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "True", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + }, + { + "description": "Value", + "name": "EnableVerticalWrapping", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Top border (Y position).", + "fullName": "Top border", + "functionType": "Expression", + "name": "BorderTop", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BorderTop" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Left border (X position).", + "fullName": "Left border", + "functionType": "Expression", + "name": "BorderLeft", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BorderLeft" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Right border (X position).", + "fullName": "Right border", + "functionType": "Expression", + "name": "BorderRight", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BorderRight" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Bottom border (Y position).", + "fullName": "Bottom border", + "functionType": "Expression", + "name": "BorderBottom", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BorderBottom" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Number of pixels past the center where the object teleports and appears.", + "fullName": "Trigger offset", + "functionType": "Expression", + "name": "TriggerOffset", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TriggerOffset" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Set top border (Y position).", + "fullName": "Set top border", + "functionType": "Action", + "name": "SetTopBorder", + "sentence": "Set _PARAM0_ top border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderTop", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + }, + { + "description": "Top border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set left border (X position).", + "fullName": "Set left border", + "functionType": "Action", + "name": "SetLeftBorder", + "sentence": "Set _PARAM0_ left border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderLeft", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + }, + { + "description": "Left border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set bottom border (Y position).", + "fullName": "Set bottom border", + "functionType": "Action", + "name": "SetBottomBorder", + "sentence": "Set _PARAM0_ bottom border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderBottom", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + }, + { + "description": "Bottom border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set right border (X position).", + "fullName": "Set right border", + "functionType": "Action", + "name": "SetRightBorder", + "sentence": "Set _PARAM0_ right border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderRight", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + }, + { + "description": "Right border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set trigger offset (pixels).", + "fullName": "Set trigger offset", + "functionType": "Action", + "name": "SetTriggerOffset", + "sentence": "Set _PARAM0_ trigger offset to _PARAM2_ pixels", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TriggerOffset", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + }, + { + "description": "SetScreen Offset Leaving Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Save current velocity values.", + "fullName": "Save current velocity values", + "functionType": "Action", + "name": "SaveCurrentVelocities", + "sentence": "Save current velocity values of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AngularVelocity", + "=", + "Object.RequiredPhysicsBehavior::AngularVelocity()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "LinearVelocityX", + "=", + "Object.RequiredPhysicsBehavior::LinearVelocityX()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "LinearVelocityY", + "=", + "Object.RequiredPhysicsBehavior::LinearVelocityY()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Apply saved velocity values.", + "fullName": "Apply saved velocity values", + "functionType": "Action", + "name": "ApplySavedVelocities", + "sentence": "Apply saved velocity values of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Physics2::AngularVelocity" + }, + "parameters": [ + "Object", + "RequiredPhysicsBehavior", + "=", + "AngularVelocity" + ] + }, + { + "type": { + "value": "Physics2::LinearVelocityX" + }, + "parameters": [ + "Object", + "RequiredPhysicsBehavior", + "=", + "LinearVelocityX" + ] + }, + { + "type": { + "value": "Physics2::LinearVelocityY" + }, + "parameters": [ + "Object", + "RequiredPhysicsBehavior", + "=", + "LinearVelocityY" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Physics Behavior", + "extraInformation": [ + "Physics2::Physics2Behavior" + ], + "choices": [], + "name": "RequiredPhysicsBehavior" + }, + { + "value": "true", + "type": "Boolean", + "label": "Horizontal wrapping", + "name": "HorizontalWrapping" + }, + { + "value": "true", + "type": "Boolean", + "label": "Vertical wrapping", + "name": "VerticalWrapping" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Top border of wrapped area (Y)", + "name": "BorderTop" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Left border of wrapped area (X)", + "name": "BorderLeft" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Right border of wrapped area (X)", + "description": "If blank, the value will be the scene width.", + "name": "BorderRight" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Bottom border of wrapped area (Y)", + "description": "If blank, the value will be scene height.", + "name": "BorderBottom" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Number of pixels past the center where the object teleports and appears", + "name": "TriggerOffset" + }, + { + "value": "0", + "type": "Number", + "label": "Angular Velocity", + "hidden": true, + "name": "AngularVelocity" + }, + { + "value": "0", + "type": "Number", + "label": "Linear Velocity X", + "hidden": true, + "name": "LinearVelocityX" + }, + { + "value": "0", + "type": "Number", + "label": "Linear Velocity Y", + "hidden": true, + "name": "LinearVelocityY" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "Silver-Streak, @Bouh, Tristan Rhodes", + "category": "Game mechanic", + "extensionNamespace": "", + "fullName": "Object \"Is On Screen\" Detection", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLW1vbml0b3Itc2NyZWVuc2hvdCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik05LDZINVYxMEg3VjhIOU0xOSwxMEgxN1YxMkgxNVYxNEgxOU0yMSwxNkgzVjRIMjFNMjEsMkgzQzEuODksMiAxLDIuODkgMSw0VjE2QTIsMiAwIDAsMCAzLDE4SDEwVjIwSDhWMjJIMTZWMjBIMTRWMThIMjFBMiwyIDAgMCwwIDIzLDE2VjRDMjMsMi44OSAyMi4xLDIgMjEsMiIgLz48L3N2Zz4=", + "name": "IsOnScreen", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/monitor-screenshot.svg", + "shortDescription": "This adds a condition to detect if an object is on screen based off its current layer.", + "version": "1.2.2", + "description": [ + "This extension adds conditions to check if an object is located within the visible portion of its layer's camera. The condition also allows for specifying padding to the virtual screen border.", + "", + "Note that this does not take into account any object visibility, such as being hidden or 0 opacity, but can be combined with those existing conditions." + ], + "origin": { + "identifier": "IsOnScreen", + "name": "gdevelop-extension-store" + }, + "tags": [ + "is on screen", + "condition", + "visible", + "hide", + "screen" + ], + "authorIds": [ + "2OwwM8ToR9dx9RJ2sAKTcrLmCB92", + "8Ih1aa8f5gWUp4UB2BdhQ2iXWxJ3", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ { - "angle": 90, - "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "af6bdbde-6c09-45fa-91fb-2e4f14c2d22e", - "width": 1665, - "x": -4096, - "y": 1536, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "description": "This behavior provides a condition to check if the object is located within the visible portion of its layer's camera. The condition also allows for specifying padding to the virtual screen border.\nNote that object visibility, such as being hidden or 0 opacity, is not considered (but you can use those existing conditions in addition to this behavior).", + "fullName": "Is on screen", + "name": "InOnScreen", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "description": "Checks if an object position is within the viewport of its layer.", + "fullName": "Is on screen", + "functionType": "Condition", + "name": "IsOnScreen", + "sentence": "_PARAM0_ is on screen (padded by _PARAM2_ pixels)", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/*", + "Get the object layer, convert the position from this layer to the screen coordinates.", + "Get the point on each side on the object on screen, and compare with the screen area.", + "", + "This way even if the camera has a rotation or custom scale the object is always compared to the screen area.", + "*/", + "", + "", + "// Get the layer of the object.", + "const object = objects[0];", + "const layer = runtimeScene.getLayer(object.getLayer());", + "", + "// Get the aabb of the object on his layer.", + "const aabb = object.getVisibilityAABB();", + "", + "// Get the layer to convert the coordinates of the AABB to the screen coordinates", + "const topLeft = layer.convertInverseCoords(aabb.min[0], aabb.min[1]);", + "const topRight = layer.convertInverseCoords(aabb.max[0], aabb.min[1]);", + "const bottomRight = layer.convertInverseCoords(aabb.max[0], aabb.max[1]);", + "const bottomLeft = layer.convertInverseCoords(aabb.min[0], aabb.max[1]);", + "", + "// Get the points on each side of the object on screen.", + "const posLeftObjectOnScreen = Math.min(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]);", + "const posRightObjectOnScreen = Math.max(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]);", + "const posUpObjectOnScreen = Math.min(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]);", + "const posDownObjectOnScreen = Math.max(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]);", + "", + "const padding = eventsFunctionContext.getArgument(\"Padding\");", + "", + "if (", + " !(posLeftObjectOnScreen - padding > runtimeScene.getGame().getGameResolutionWidth() ||", + " posUpObjectOnScreen - padding > runtimeScene.getGame().getGameResolutionHeight() ||", + " posRightObjectOnScreen + padding < 0 ||", + " posDownObjectOnScreen + padding < 0", + " )", + ") {", + " eventsFunctionContext.returnValue = true;", + "}", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "IsOnScreen::InOnScreen", + "type": "behavior" + }, + { + "description": "Padding (in pixels)", + "longDescription": "Number of pixels to pad the screen border. Zero by default. A negative value goes inside the screen, a positive value go outside.", + "name": "Padding", + "type": "expression" + } + ], + "objectGroups": [ + { + "name": "Group", + "objects": [] + } + ] + } + ], + "propertyDescriptors": [], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "General", + "extensionNamespace": "", + "fullName": "3D collision", + "gdevelopVersion": ">=5.5.222", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZlY3Rvci1pbnRlcnNlY3Rpb24iIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMy4xNCwxQTIuMTQsMi4xNCAwIDAsMCAxLDMuMTRWNUgzVjNINVYxSDMuMTRNNywxVjNIMTBWMUg3TTEyLDFWM0gxNFY1SDE2VjMuMTRDMTYsMS45NiAxNS4wNCwxIDEzLjg2LDFIMTJNMSw3VjEwSDNWN0gxTTksN0M3Ljg5LDcgNyw3Ljg5IDcsOUM3LDExLjMzIDcsMTYgNywxNkM3LDE2IDExLjU3LDE2IDEzLjg2LDE2QTIuMTQsMi4xNCAwIDAsMCAxNiwxMy44NkMxNiwxMS41NyAxNiw3IDE2LDdDMTYsNyAxMS4zMyw3IDksN00xOCw3VjlIMjBWMTFIMjJWOUMyMiw3Ljg5IDIxLjExLDcgMjAsN0gxOE05LDlIMTRWMTRIOVY5TTEsMTJWMTMuODZDMSwxNS4wNCAxLjk2LDE2IDMuMTQsMTZINVYxNEgzVjEySDFNMjAsMTNWMTZIMjJWMTNIMjBNNywxOFYyMEM3LDIxLjExIDcuODksMjIgOSwyMkgxMVYyMEg5VjE4SDdNMjAsMThWMjBIMThWMjJIMjBDMjEuMTEsMjIgMjIsMjEuMTEgMjIsMjBWMThIMjBNMTMsMjBWMjJIMTZWMjBIMTNaIiAvPjwvc3ZnPg==", + "name": "Collision3D", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/7a5696a515bf40813692e118147568392a854f65f5b50750c9b9aaa967aba7df_vector-intersection.svg", + "shortDescription": "Check collision and distance between 3D objects.", + "version": "0.2.0", + "description": "Check collision and distance between 3D objects and separate them from each other.", + "origin": { + "identifier": "Collision3D", + "name": "gdevelop-extension-store" + }, + "tags": [ + "3d", + "collision" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "PEzPAaWHgYgk5UwIPppsL6f2ugp2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "2423ce72-6cd9-4419-9606-6080457124bf", - "width": 0, - "x": -2880, - "y": 2432, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Define helper classes JavaScript code.", + "fullName": "Define helper classes", + "functionType": "Action", + "name": "DefineHelperClasses", + "private": true, + "sentence": "Define helper classes JavaScript code", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (gdjs._collision3DExtension) {", + " return;", + "}", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @param {boolean} shouldUseCustomCenter", + " * @return {number}", + " */", + "const getCenterX = (object, shouldUseCustomCenter) =>", + " shouldUseCustomCenter ?", + " object.getCenterXInScene() :", + " object.getDrawableX() + object.getWidth() / 2", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @param {boolean} shouldUseCustomCenter", + " * @return {number}", + " */", + "const getCenterY = (object, shouldUseCustomCenter) =>", + " shouldUseCustomCenter ?", + " object.getCenterYInScene() :", + " object.getDrawableY() + object.getHeight() / 2", + "", + "/**", + " * @param {gdjs.RuntimeObject3D} object", + " * @param {boolean} shouldUseCustomCenter", + " * @return {number}", + " */", + "const getCenterZ = (object, shouldUseCustomCenter) =>", + " !object.getCenterZInScene ? 0 :", + " shouldUseCustomCenter ?", + " object.getCenterZInScene() :", + " object.getDrawableZ() + object.getDepth() / 2", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @param {float} x", + " * @param {float} y", + " * @param {float} z", + " * @param {boolean} shouldUseCustomCenter", + " * @return {number}", + " */", + "const getSqDistanceToPosition = (object, x, y, z, shouldUseCustomCenter = true) => {", + " const deltaX = getCenterX(object, shouldUseCustomCenter) - x;", + " const deltaY = getCenterY(object, shouldUseCustomCenter) - y;", + " const deltaZ = getCenterZ(object, shouldUseCustomCenter) - z;", + " return deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ;", + "};", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @param {float} x", + " * @param {float} y", + " * @param {float} z", + " * @return {number}", + " */", + "const getDistanceToPosition = (object, x, y, z) => Math.sqrt(getSqDistanceToPosition(object, x, y, z));", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @param {gdjs.RuntimeObject} otherObject", + " * @param {boolean} shouldUseCustomCenter", + " * @return {number}", + " */", + "const getSqDistanceToObject = (object, otherObject, shouldUseCustomCenter = true) => {", + " return getSqDistanceToPosition(", + " object,", + " getCenterX(otherObject, shouldUseCustomCenter),", + " getCenterY(otherObject, shouldUseCustomCenter),", + " getCenterZ(otherObject, shouldUseCustomCenter)", + " );", + "};", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @param {gdjs.RuntimeObject} otherObject", + " * @return {number}", + " */", + "const getDistanceToObject = (object, otherObject) => Math.sqrt(getSqDistanceToObject(object, otherObject));", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @param {gdjs.RuntimeObject} otherObject", + " * @param {{distanceSq: number, shouldUseCustomCenter: boolean}} distanceSettings", + " * @return {boolean}", + " */", + "const areObjectsWithinDistance = (object, otherObject, distanceSettings) => {", + " return getSqDistanceToObject(", + " object, otherObject, distanceSettings.shouldUseCustomCenter) <= distanceSettings.distanceSq;", + "};", + "", + "const distanceSettings = {distanceSq: 0, shouldUseCustomCenter: true};", + "", + "/**", + " * @param {Hashtable} objectsLists1", + " * @param {Hashtable} objectsLists2", + " * @param {number} distance", + " * @param {boolean} shouldUseCustomCenter", + " * @param {boolean} inverted", + " * @return {boolean}", + " */", + "const pickObjectsWithinDistance = (objectsLists1, objectsLists2, distance, shouldUseCustomCenter, inverted) => {", + " distanceSettings.distanceSq = distance * distance;", + " distanceSettings.shouldUseCustomCenter = shouldUseCustomCenter;", + " return gdjs.evtTools.object.twoListsTest(", + " areObjectsWithinDistance,", + " objectsLists1,", + " objectsLists2,", + " inverted,", + " distanceSettings", + " );", + "}", + "", + "/**", + " * @param {Hashtable} objectsLists", + " * @param {number} x", + " * @param {number} y", + " * @param {number} z", + " * @param {boolean} inverted", + " * @return {boolean}", + " */", + "const pickNearestObject = function (objectsLists, x, y, z, inverted) {", + " let bestObject = null;", + " let best = 0;", + " let first = true;", + " const lists = gdjs.staticArray(gdjs._collision3DExtension.pickNearestObject);", + " objectsLists.values(lists);", + " for (let i = 0, len = lists.length; i < len; ++i) {", + " const list = lists[i];", + " for (let j = 0; j < list.length; ++j) {", + " const object = list[j];", + " const distance = getSqDistanceToPosition(object, x, y, z);", + " // @ts-ignore", + " if (first || (distance < best) ^ inverted) {", + " best = distance;", + " bestObject = object;", + " }", + " first = false;", + " }", + " }", + " if (bestObject) {", + " gdjs.evtTools.object.pickOnly(objectsLists, bestObject);", + " }", + " return !!bestObject;", + "}", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @return {float}", + " */", + "const getObjectMinZ = (object) =>", + " object.getDrawableZ ? object.getDrawableZ() : 0", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @return {float}", + " */", + "const getObjectMaxZ = (object) =>", + " object.getDrawableZ ? object.getDrawableZ() + object.getDepth() : 0;", + "", + "/**", + " * @param {gdjs.RuntimeObject} object1", + " * @param {gdjs.RuntimeObject} object2", + " * @param {boolean} ignoreTouchingEdges If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.", + " * @return {boolean}", + " */", + "const areObjectsInCollision = (", + " object1,", + " object2,", + " ignoreTouchingEdges,", + ") => {", + " const object1MinZ = getObjectMinZ(object1);", + " const object1MaxZ = getObjectMaxZ(object1);", + " const object2MinZ = getObjectMinZ(object2);", + " const object2MaxZ = getObjectMaxZ(object2);", + "", + " const canObjectsOverlapOnZ = ignoreTouchingEdges ?", + " (object1MinZ < object2MaxZ && object1MaxZ > object2MinZ) :", + " (object1MinZ <= object2MaxZ && object1MaxZ >= object2MinZ);", + "", + " return canObjectsOverlapOnZ &&", + " gdjs.RuntimeObject.collisionTest(", + " object1,", + " object2,", + " ignoreTouchingEdges", + " );", + "}", + "", + "/**", + " * @param {Hashtable} objectsLists1", + " * @param {Hashtable} objectsLists2", + " * @param {boolean} inverted", + " * @return {boolean}", + " */", + "const pickObjectsInCollision = (", + " objectsLists1,", + " objectsLists2,", + " inverted,", + ") => {", + " return gdjs.evtTools.object.twoListsTest(", + " areObjectsInCollision,", + " objectsLists1,", + " objectsLists2,", + " inverted,", + " false", + " );", + "}", + "", + "/**", + " * @param {gdjs.RuntimeObject} movingObject", + " * @param {gdjs.RuntimeObject} object", + " * @return {float}", + " */", + "const getSeparationDeltaZ = (", + " movingObject,", + " object,", + ") => {", + " const movingObjectMinZ = getObjectMinZ(movingObject);", + " const movingObjectMaxZ = getObjectMaxZ(movingObject);", + " const objectMinZ = getObjectMinZ(object);", + " const objectMaxZ = getObjectMaxZ(object);", + "", + " const downwardDeltaZ = Math.min(0, objectMinZ - movingObjectMaxZ);", + " const upwardDeltaZ = Math.max(0, objectMaxZ - movingObjectMinZ);", + "", + " return -downwardDeltaZ < upwardDeltaZ ? downwardDeltaZ : upwardDeltaZ", + "}", + "", + "// This function is an exact copy from GDJS/Runtime/runtimeobject.ts", + "/**", + " * Move the object using the results from collisionTest call.", + " * This moves the object according to the direction of the longest vector,", + " * and projects the others on the orthogonal vector.", + " *", + " * See {@link RuntimeObject.separateFromObjects}", + " *", + " * @param {gdjs.RuntimeObject} object The object to move.", + " * @param {float[]} moveXArray The X coordinates of the vectors to move the object.", + " * @param {float[]} moveYArray The Y coordinates of the vectors to move the object.", + " * @return {boolean} true if the object was moved.", + " */", + "const moveFollowingSeparatingVectors = (", + " object,", + " moveXArray,", + " moveYArray", + ") => {", + " if (moveXArray.length === 0) {", + " moveXArray.length = 0;", + " moveYArray.length = 0;", + " return false;", + " }", + " if (moveXArray.length === 1) {", + " // Move according to the results returned by the collision algorithm.", + " object.setPosition(", + " object.getX() + moveXArray[0],", + " object.getY() + moveYArray[0]", + " );", + " moveXArray.length = 0;", + " moveYArray.length = 0;", + " return true;", + " }", + "", + " // Find the longest vector", + " let squaredDistanceMax = 0;", + " let distanceMaxIndex = 0;", + " for (let index = 0; index < moveXArray.length; index++) {", + " const moveX = moveXArray[index];", + " const moveY = moveYArray[index];", + "", + " const squaredDistance = moveX * moveX + moveY * moveY;", + " if (squaredDistance > squaredDistanceMax) {", + " squaredDistanceMax = squaredDistance;", + " distanceMaxIndex = index;", + " }", + " }", + "", + " const distanceMax = Math.sqrt(squaredDistanceMax);", + " // unit vector of the longest vector", + " const uX = moveXArray[distanceMaxIndex] / distanceMax;", + " const uY = moveYArray[distanceMaxIndex] / distanceMax;", + "", + " // normal vector of the longest vector", + " const vX = -uY;", + " const vY = uX;", + "", + " // Project other vectors on the normal", + " let scalarProductMin = 0;", + " let scalarProductMax = 0;", + " for (let index = 0; index < moveXArray.length; index++) {", + " const moveX = moveXArray[index];", + " const moveY = moveYArray[index];", + "", + " const scalarProduct = moveX * vX + moveY * vY;", + " scalarProductMin = Math.min(scalarProductMin, scalarProduct);", + " scalarProductMax = Math.max(scalarProductMax, scalarProduct);", + " }", + "", + " // Apply the longest vector", + " let deltaX = moveXArray[distanceMaxIndex];", + " let deltaY = moveYArray[distanceMaxIndex];", + "", + " // Apply the longest projected vector if they all are in the same direction", + " // Some projections could have rounding errors,", + " // they are considered negligible under a 1 for 1,000,000 ratio.", + " const scalarProductMinIsNegligible =", + " -scalarProductMin < scalarProductMax / 1048576;", + " const scalarProductMaxIsNegligible =", + " scalarProductMax < -scalarProductMin / 1048576;", + " if (scalarProductMinIsNegligible !== scalarProductMaxIsNegligible) {", + " if (scalarProductMaxIsNegligible) {", + " deltaX += scalarProductMin * vX;", + " deltaY += scalarProductMin * vY;", + " } else {", + " deltaX += scalarProductMax * vX;", + " deltaY += scalarProductMax * vY;", + " }", + " }", + " object.setPosition(object.getX() + deltaX, object.getY() + deltaY);", + " moveXArray.length = 0;", + " moveYArray.length = 0;", + " return true;", + "};", + "", + "/**", + " * Arrays and data structure that are (re)used by", + " * {@link separateFromObjects} to avoid any allocation.", + " * @type {{moveXArray: float[], moveYArray: float[], moveZArray: float[]}}", + " */", + "const separateFromObjectsStatics = {", + " moveXArray: [],", + " moveYArray: [],", + " moveZArray: [],", + "};", + "", + "/**", + " * Separate the object from others objects, using their hitboxes.", + " * @param {gdjs.RuntimeObject} object The object that moves.", + " * @param {gdjs.RuntimeObject[]} objects The objects that stay still.", + " * @return {boolean} true if the object was moved", + " */", + "const separateFromObjects = (", + " object,", + " objects", + ") => {", + " const moveXArray = separateFromObjectsStatics.moveXArray;", + " const moveYArray = separateFromObjectsStatics.moveYArray;", + " moveXArray.length = 0;", + " moveYArray.length = 0;", + " let moveZMax = 0;", + "", + " // We can assume that the moving object is not grid based,", + " // so there is no need for optimization:", + " // getHitBoxes can be called directly.", + " const hitBoxes = object.getHitBoxes();", + " /** @type {gdjs.AABB | null} */", + " let aabb = null;", + "", + " // Check if there is a collision with each object", + " for (const otherObject of objects) {", + " if (otherObject.id === object.id) {", + " continue;", + " }", + " const moveZ = getSeparationDeltaZ(object, otherObject);", + " if (moveZ === 0) {", + " continue;", + " }", + " const moveZSq = moveZ * moveZ;", + "", + " let otherHitBoxesArray = otherObject.getHitBoxes();", + " /** @type {Iterable} */", + " let otherHitBoxes = otherHitBoxesArray;", + " if (otherHitBoxesArray.length > 4) {", + " // The other object has a lot of hit boxes.", + " // Try to reduce the amount of hitboxes to check.", + " if (!aabb) {", + " aabb = object.getAABB();", + " }", + " otherHitBoxes = otherObject.getHitBoxesAround(", + " aabb.min[0],", + " aabb.min[1],", + " aabb.max[0],", + " aabb.max[1]", + " );", + " }", + " for (const hitBox of hitBoxes) {", + " for (const otherHitBox of otherHitBoxes) {", + " const result = gdjs.Polygon.collisionTest(", + " hitBox,", + " otherHitBox,", + " true", + " );", + " if (result.collision) {", + " const moveX = result.move_axis[0];", + " const moveY = result.move_axis[1];", + " if (moveZSq < moveX * moveX + moveY * moveY) {", + " if (Math.abs(moveZ) > Math.abs(moveZMax)) {", + " moveZMax = moveZ;", + " }", + " }", + " else {", + " moveXArray.push(moveX);", + " moveYArray.push(moveY);", + " }", + " }", + " }", + " }", + " }", + " const hasObjectMovedOnZ = moveZMax !== 0;", + " if (hasObjectMovedOnZ) {", + " object.setZ(object.getZ() + moveZMax);", + " }", + " const hasObjectMovedOnXY = moveFollowingSeparatingVectors(object, moveXArray, moveYArray);", + " return hasObjectMovedOnXY || hasObjectMovedOnZ;", + "}", + "", + "gdjs._collision3DExtension = {", + " getSqDistanceToPosition,", + " getDistanceToPosition,", + " getSqDistanceToObject,", + " getDistanceToObject,", + " pickObjectsWithinDistance,", + " pickNearestObject,", + " pickObjectsInCollision,", + " separateFromObjects", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "039a2ae3-f429-4bf9-8d54-a06d26294aa7", - "width": 0, - "x": -2496, - "y": 2480, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Collision3D::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "9ce2bf00-9b32-4171-80ca-71a06e71cfac", - "width": 0, - "x": -2176, - "y": 1344, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Compare the distance between two objects in 3D.", + "fullName": "Distance between two objects in 3D", + "functionType": "Condition", + "group": "Position", + "name": "AreWithinDistance", + "sentence": "_PARAM1_ distance to _PARAM2_ is below _PARAM3_ pixels", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "// TODO If condition is inverted, only objects that have a distance greater than specified to any other object will be picked.\r", + "const inverted = false;\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._collision3DExtension.pickObjectsWithinDistance(\r", + " eventsFunctionContext.getObjectsLists(\"Object\"),\r", + " eventsFunctionContext.getObjectsLists(\"OtherObject\"),\r", + " eventsFunctionContext.getArgument(\"Distance\"),\r", + " eventsFunctionContext.getArgument(\"ShouldUseCustomCenter\"),\r", + " inverted\r", + ");\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Other object", + "name": "OtherObject", + "type": "objectList" + }, + { + "description": "Distance", + "name": "Distance", + "type": "expression" + }, + { + "defaultValue": "yes", + "description": "Use custom center", + "name": "ShouldUseCustomCenter", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "35d29936-54ea-41bb-a6d4-8b08ba17643c", - "width": 0, - "x": -2112, - "y": 2432, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Distance between two objects in 3D.", + "fullName": "Distance between two objects in 3D", + "functionType": "Expression", + "group": "Position", + "name": "Distance", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const otherObjects = eventsFunctionContext.getObjectsLists(\"OtherObject\");\r", + "\r", + "if (objects.length > 0 && otherObjects.length > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._collision3DExtension.getDistanceToObject(\r", + " objects[0],\r", + " otherObjects[0]\r", + " );\r", + "}\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Other object", + "name": "OtherObject", + "type": "objectList" + } + ], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "1b2077a2-f66e-4d15-80d9-682cbfc572c6", - "width": 0, - "x": -3008, - "y": 1344, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Square distance between two objects in 3D.", + "fullName": "Square distance between two objects", + "functionType": "Expression", + "group": "Position", + "name": "SqDistance", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const otherObjects = eventsFunctionContext.getObjectsLists(\"OtherObject\");\r", + "\r", + "if (objects.length > 0 && otherObjects.length > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._collision3DExtension.getSqDistanceToObject(\r", + " objects[0],\r", + " otherObjects[0]\r", + " );\r", + "}\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Other object", + "name": "OtherObject", + "type": "objectList" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "dcdb4b80-0b24-4520-8094-9a15f66e34f9", - "width": 0, - "x": -2880, - "y": 1024, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Distance between an object and a position in 3D.", + "fullName": "Distance between an object and a position", + "functionType": "Expression", + "group": "Position", + "name": "DistanceToPosition", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "if (objects.length > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._collision3DExtension.getDistanceToPosition(\r", + " objects[0],\r", + " eventsFunctionContext.getArgument(\"PositionX\"),\r", + " eventsFunctionContext.getArgument(\"PositionY\"),\r", + " eventsFunctionContext.getArgument(\"PositionZ\"),\r", + " );\r", + "}\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "X position", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Y position", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Z position", + "name": "PositionZ", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "ab602015-5ee4-4443-a192-e53617874fde", - "width": 0, - "x": -2112, - "y": 1024, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Square distance between an object and a position in 3D.", + "fullName": "Square distance between an object and a position", + "functionType": "Expression", + "group": "Position", + "name": "SqDistanceToPosition", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "if (objects.length > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._collision3DExtension.getSqDistanceToPosition(\r", + " objects[0],\r", + " eventsFunctionContext.getArgument(\"PositionX\"),\r", + " eventsFunctionContext.getArgument(\"PositionY\"),\r", + " eventsFunctionContext.getArgument(\"PositionZ\"),\r", + " );\r", + "}\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "X position", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Y position", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Z position", + "name": "PositionZ", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 180, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "48ac81d3-9e8f-4c16-9afe-695c11260fe5", - "width": 0, - "x": -2496, - "y": 960, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Pick the object of this type that is nearest to the specified position in 3D.", + "fullName": "Pick nearest object in 3D", + "functionType": "Condition", + "group": "Objects", + "name": "PickNearest", + "sentence": "Pick the _PARAM1_ that is nearest to _PARAM2_ ; _PARAM3_ ; _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "// TODO If the condition is inverted, the object farthest from the specified position is picked instead.\r", + "const inverted = false;\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._collision3DExtension.pickNearestObject(\r", + " eventsFunctionContext.getObjectsLists(\"Object\"),\r", + " eventsFunctionContext.getArgument(\"PositionX\"),\r", + " eventsFunctionContext.getArgument(\"PositionY\"),\r", + " eventsFunctionContext.getArgument(\"PositionZ\"),\r", + " inverted\r", + ");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "X position", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Y position", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Z position", + "name": "PositionZ", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "8846971c-4d3d-4b4e-bf27-f7db6ec3d4a8", - "width": 0, - "x": -2816, - "y": 1344, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Check the collision between two objects using their collision masks. Object rotation around X and Y axes are ignored.", + "fullName": "Collision in 3D", + "functionType": "Condition", + "group": "Collision", + "name": "AreInCollision", + "sentence": "_PARAM1_ is in collision with _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "// TODO If the condition is inverted, the object farthest from the specified position is picked instead.\r", + "const inverted = false;\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._collision3DExtension.pickObjectsInCollision(\r", + " eventsFunctionContext.getObjectsLists(\"Object\"),\r", + " eventsFunctionContext.getObjectsLists(\"OtherObject\"),\r", + " eventsFunctionContext.getArgument(\"IgnoreEdges\"),\r", + " inverted\r", + ");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Other object", + "name": "OtherObject", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "OtherObjectCapability", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Ignore objects that are touching each other on their edges, but are not overlapping (default: no)", + "name": "IgnoreEdges", + "type": "yesorno" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "f002dcb6-7734-44ff-9c11-03d80f21656d", - "width": 0, - "x": -2496, - "y": 1152, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "description": "Move an object away from another using their collision masks. Object rotation around X and Y axes are ignored.\nBe sure to call this action on a reasonable number of objects to avoid slowing down the game.", + "fullName": "Separate objects in 3D", + "functionType": "Action", + "group": "Position", + "name": "SeparateFromObjects", + "sentence": "Move _PARAM1_ away from _PARAM3_ (only _PARAM1_ will move)", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const otherObjects = eventsFunctionContext.getObjects(\"OtherObject\");\r", + "\r", + "for (const object of objects) {\r", + " gdjs._collision3DExtension.separateFromObjects(\r", + " object,\r", + " otherObjects,\r", + " );\r", + "}" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Objects (won't move)", + "name": "OtherObject", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "OtherObject3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "", + "extensionNamespace": "", + "fullName": "", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "", + "name": "Collectible", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "", + "tags": [], + "authorIds": [], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [ { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "480c6e8b-cae4-4a0a-ac27-f28ae6a550ed", - "width": 0, - "x": -2496, - "y": 2304, - "zOrder": 48, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "folded": true, + "name": "RisingPitch", + "type": "number", + "value": 0.8 + } + ], + "eventsFunctions": [ { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "d8a2ca27-e500-4c08-85f4-11ce7bae63fe", - "width": 0, - "x": -2816, - "y": 1728, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "fullName": "", + "functionType": "Action", + "name": "onScenePreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Reset rising pitch" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareTimer" + }, + "parameters": [ + "", + "\"RisingPitch\"", + ">", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "RisingPitch", + "=", + "RandomFloatInRange(0.9,1.1)" + ] + }, + { + "type": { + "value": "RemoveTimer" + }, + "parameters": [ + "", + "\"RisingPitch\"" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ { - "angle": 270, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingF", - "persistentUuid": "4dc9a0dc-b445-4982-b723-a8a6d9cb0f68", - "width": 0, - "x": -1984, - "y": 1728, - "zOrder": 49, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Rotate continuously and make a sound when deleted.", + "fullName": "Collectible", + "name": "Collectible", + "objectType": "Scene3D::Model3DObject", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onDestroy", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Reseting the rising pitch variable after being adjusted in the coin collision event." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PlaySound" + }, + "parameters": [ + "", + "CoinPickUp", + "", + "25", + "RisingPitch" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "RisingPitch", + "*", + "1.05" + ] + }, + { + "type": { + "value": "ResetTimer" + }, + "parameters": [ + "", + "\"RisingPitch\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Collectible::Collectible", + "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": "Rotating the coins in game." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Rotate" + }, + "parameters": [ + "Object", + "RotationSpeed", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Collectible::Collectible", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "50", + "type": "Number", + "unit": "AngularSpeed", + "label": "Rotation speed", + "name": "RotationSpeed" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "User interface", + "extensionNamespace": "", + "fullName": "Leaderboard dialog", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXRyb3BoeSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xOCAyQzE3LjEgMiAxNiAzIDE2IDRIOEM4IDMgNi45IDIgNiAySDJWMTFDMiAxMiAzIDEzIDQgMTNINi4yQzYuNiAxNSA3LjkgMTYuNyAxMSAxN1YxOS4wOEM4IDE5LjU0IDggMjIgOCAyMkgxNkMxNiAyMiAxNiAxOS41NCAxMyAxOS4wOFYxN0MxNi4xIDE2LjcgMTcuNCAxNSAxNy44IDEzSDIwQzIxIDEzIDIyIDEyIDIyIDExVjJIMThNNiAxMUg0VjRINlYxMU0yMCAxMUgxOFY0SDIwVjExWiIgLz48L3N2Zz4=", + "name": "LeaderboardDialog", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/4b89b420c0ed9c540a7f00c5735a31af0db2160679d3fab2170df3681c3ac38c_trophy.svg", + "shortDescription": "Display the player score and allow to submit it to a leaderboard.", + "version": "1.0.1", + "description": "Display the player score and allow to submit it to a leaderboard.", + "origin": { + "identifier": "LeaderboardDialog", + "name": "gdevelop-extension-store" + }, + "tags": [ + "" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Check if the events are running for the editor.", + "fullName": "Editor is running", + "functionType": "Condition", + "name": "IsInGameEdition", + "private": true, + "sentence": "Events are running for the editor", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const game = runtimeScene.getGame();\r", + "eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "000a2c81-8cdc-4da1-88ed-9afb39fe3d8f", - "width": 0, - "x": -2176, - "y": 1728, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Return a formated time for a given timestamp", + "fullName": "Format time", + "functionType": "StringExpression", + "name": "FormatTime", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "ToString(Time)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Format", + "=", + "\"MM:SS.ms\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "LeaderboardDialog::PadStart(ToString(floor(Time / 60)), 2, \"0\") + \":\" + LeaderboardDialog::PadStart(LeaderboardDialog::ToFixed(mod(Time, 60), 3), 6, \"0\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Format", + "=", + "\"MM:SS\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "LeaderboardDialog::PadStart(ToString(floor(Time / 60)), 2, \"0\") + \":\" + LeaderboardDialog::PadStart(ToString(mod(floor(Time), 60)), 2, \"0\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Format", + "=", + "\"SS\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "LeaderboardDialog::ToFixed(Time, 3)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Format", + "=", + "\"SS.ms\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "LeaderboardDialog::ToFixed(Time, 3)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Format", + "=", + "\"ms\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "ToString(floor(Time * 1000))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Format", + "=", + "\"HH:MM:SS.ms\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "LeaderboardDialog::PadStart(ToString(floor(Time / 3600)), 2, \"0\") + \":\" + LeaderboardDialog::PadStart(ToString(mod(floor(Time / 60), 60)), 2, \"0\") + \":\" + LeaderboardDialog::PadStart(LeaderboardDialog::ToFixed(mod(Time, 60), 3), 6, \"0\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Format", + "=", + "\"HH:MM:SS\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "LeaderboardDialog::PadStart(ToString(floor(Time / 3600)), 2, \"0\") + \":\" + LeaderboardDialog::PadStart(ToString(mod(floor(Time / 60), 60)), 2, \"0\") + \":\" + LeaderboardDialog::PadStart(ToString(mod(floor(Time), 60)), 2, \"0\")" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Time", + "name": "Time", + "type": "expression" + }, + { + "description": "Format", + "name": "Format", + "supplementaryInformation": "[\"MM:SS.ms\",\"MM:SS\",\"SS\",\"SS.ms\",\"ms\",\"HH:MM:SS.ms\",\"HH:MM:SS\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadBend", - "persistentUuid": "876e06b4-9467-4979-88fb-9adc2bcf6d8c", - "width": 0, - "x": -3456, - "y": 2560, - "zOrder": 45, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "description": "Formats a number to a string with the specified number of decimal places.", + "fullName": "To fixed", + "functionType": "StringExpression", + "name": "ToFixed", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const valueToBeRounded = eventsFunctionContext.getArgument(\"ValueToBeRounded\");", + "const numberOfDecimalPlaces = eventsFunctionContext.getArgument(\"NumberOfDecimalPlaces\");", + "eventsFunctionContext.returnValue = valueToBeRounded.toFixed(numberOfDecimalPlaces);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "The value to be rounded", + "name": "ValueToBeRounded", + "type": "expression" + }, + { + "description": "Number of decimal places", + "name": "NumberOfDecimalPlaces", + "type": "expression" + } + ], + "objectGroups": [] }, { - "angle": 90, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadIntersectionPath", - "persistentUuid": "6fa14a40-e494-47fc-8816-4a1e91b0c25a", - "width": 0, - "x": -3456, - "y": 512, - "zOrder": 44, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "fullName": "Pad start", + "functionType": "StringExpression", + "name": "PadStart", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const value = eventsFunctionContext.getArgument(\"Value\");", + "const targetLength = eventsFunctionContext.getArgument(\"TargetLength\");", + "const padString = eventsFunctionContext.getArgument(\"PadString\");", + "eventsFunctionContext.returnValue = value.padStart(targetLength, padString);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Text", + "name": "Value", + "type": "string" + }, + { + "description": "Target length", + "name": "TargetLength", + "type": "expression" + }, + { + "description": "Pad string", + "name": "PadString", + "type": "string" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [ { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "4390f306-21e7-4c59-8f8d-41d216f95828", - "width": 0, - "x": -2944, - "y": 2112, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "areaMaxX": 688, + "areaMaxY": 480, + "areaMaxZ": 48, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "defaultName": "LeaderboardDialog", + "description": "Displays the player score and allows to submit it to a leaderboard.", + "fullName": "Leaderboard dialog", + "isInnerAreaFollowingParentSize": true, + "isUsingLegacyInstancesRenderer": false, + "name": "LeaderboardDialog", + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "ScoreLabel", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Score:", + "font": "", + "textAlignment": "", + "characterSize": 40, + "color": { + "b": 79, + "g": 72, + "r": 72 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Score:", + "font": "", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 40, + "lineHeight": 0, + "color": "72;72;79" + } + }, + { + "assetStoreId": "", + "name": "PlayerNameInput", + "type": "TextInput::TextInputObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "initialValue": "", + "placeholder": "PlayerName", + "fontResourceName": "", + "fontSize": 40, + "inputType": "text", + "textColor": "72;72;79", + "fillColor": "231;232;243", + "fillOpacity": 255, + "borderColor": "255;255;255", + "borderOpacity": 255, + "borderWidth": 6, + "readOnly": false, + "disabled": false + } + }, + { + "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", + "name": "SubmitTextButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "Yellow button 2", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 0, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 16, + "RightPadding": 16, + "PressedLabelOffsetY": 10, + "BottomPadding": 32, + "TopPadding": 16, + "HoveredFadeOutDuration": 0.25, + "LabelText": "Send" + } + }, + { + "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", + "name": "RetryTextButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "Yellow button 2", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 16, + "RightPadding": 16, + "PressedLabelOffsetY": 10, + "BottomPadding": 32, + "TopPadding": 16, + "HoveredFadeOutDuration": 0.25, + "LabelText": "Restart" + } + }, + { + "assetStoreId": "", + "bottomMargin": 32, + "height": 128, + "leftMargin": 16, + "name": "Panel", + "rightMargin": 16, + "texture": "", + "tiled": false, + "topMargin": 16, + "type": "PanelSpriteObject::PanelSprite", + "width": 128, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Title", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "string": "Game over", + "font": "", + "textAlignment": "center", + "characterSize": 60, + "color": { + "b": 79, + "g": 72, + "r": 72 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Game over", + "font": "", + "textAlignment": "center", + "verticalTextAlignment": "top", + "characterSize": 60, + "lineHeight": 0, + "color": "72;72;79" + } + }, + { + "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", + "name": "BackTextButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "Yellow button 2", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 16, + "RightPadding": 16, + "PressedLabelOffsetY": 10, + "BottomPadding": 32, + "TopPadding": 16, + "HoveredFadeOutDuration": 0.25, + "LabelText": "Back" + } + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Medal", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [] + }, + { + "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", + "name": "NextTextButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "Yellow button 2", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 16, + "RightPadding": 16, + "PressedLabelOffsetY": 10, + "BottomPadding": 32, + "TopPadding": 16, + "HoveredFadeOutDuration": 0.25, + "LabelText": "Next" + } + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "BestScoreLabel", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Best:", + "font": "", + "textAlignment": "", + "characterSize": 40, + "color": { + "b": 79, + "g": 72, + "r": 72 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Best:", + "font": "", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 40, + "lineHeight": 0, + "color": "72;72;79" + } + }, + { + "assetStoreId": "", + "name": "BitmapTitle", + "type": "BitmapText::BitmapTextObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "text": "Game over", + "opacity": 255, + "scale": 1, + "fontSize": 20, + "tint": "255;255;255", + "bitmapFontResourceName": "", + "textureAtlasResourceName": "", + "align": "center", + "verticalTextAlignment": "top" + } + }, + { + "assetStoreId": "", + "name": "BitmapScoreLabel", + "type": "BitmapText::BitmapTextObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "text": "Score:", + "opacity": 255, + "scale": 1, + "fontSize": 20, + "tint": "255;255;255", + "bitmapFontResourceName": "", + "textureAtlasResourceName": "", + "align": "left", + "verticalTextAlignment": "top" + } + }, + { + "assetStoreId": "", + "name": "BitmapBestScoreLabel", + "type": "BitmapText::BitmapTextObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "text": "Best:", + "opacity": 255, + "scale": 1, + "fontSize": 20, + "tint": "255;255;255", + "bitmapFontResourceName": "", + "textureAtlasResourceName": "", + "align": "left", + "verticalTextAlignment": "top" + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "folderName": "Bitmap labels", + "children": [ + { + "objectName": "BitmapTitle" + }, + { + "objectName": "BitmapScoreLabel" + }, + { + "objectName": "BitmapBestScoreLabel" + } + ] + }, + { + "objectName": "Title" + }, + { + "objectName": "ScoreLabel" + }, + { + "objectName": "BestScoreLabel" + }, + { + "objectName": "Medal" + }, + { + "objectName": "PlayerNameInput" + }, + { + "objectName": "SubmitTextButton" + }, + { + "objectName": "RetryTextButton" + }, + { + "objectName": "BackTextButton" + }, + { + "objectName": "NextTextButton" + }, + { + "objectName": "Panel" + } + ] + }, + "objectsGroups": [ + { + "name": "ActionTextButton", + "objects": [ + { + "name": "RetryTextButton" + }, + { + "name": "BackTextButton" + }, + { + "name": "NextTextButton" + } + ] + }, + { + "name": "Titles", + "objects": [ + { + "name": "Title" + }, + { + "name": "BitmapTitle" + } + ] + }, + { + "name": "ScoreLabels", + "objects": [ + { + "name": "ScoreLabel" + }, + { + "name": "BitmapScoreLabel" + } + ] + }, + { + "name": "BestScoreLabels", + "objects": [ + { + "name": "BestScoreLabel" + }, + { + "name": "BitmapBestScoreLabel" + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 71, + "layer": "", + "name": "ScoreLabel", + "persistentUuid": "e0571581-5b6f-4e0b-928a-92dd21b3851d", + "width": 606, + "x": 36, + "y": 41, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 96, + "layer": "", + "name": "PlayerNameInput", + "persistentUuid": "1b66c419-4bc7-406f-91e7-7deeb515ff67", + "width": 360, + "x": 40, + "y": 160, + "zOrder": 19, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "RetryTextButton", + "persistentUuid": "d9bfca46-e22c-42c9-a581-b88dbe1f5967", + "width": 0, + "x": 224, + "y": 320, + "zOrder": 35, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 48, + "height": 106, + "layer": "", + "name": "SubmitTextButton", + "persistentUuid": "3ad1036e-666f-4a8c-9b85-6d882e192ee8", + "width": 216, + "x": 432, + "y": 150, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 480, + "layer": "", + "name": "Panel", + "persistentUuid": "273f403b-d896-4fa8-81bd-ef1d5d6bd006", + "width": 688, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 1.0174418604651163, + "windowMask": false, + "selectedLayer": "" + }, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "LeaderboardDialog::LeaderboardDialog::SetScore" + }, + "parameters": [ + "Object", + "=", + "0", + "" + ] + }, + { + "type": { + "value": "LeaderboardDialog::LeaderboardDialog::SetDefaultPlayerName" + }, + "parameters": [ + "Object", + "=", + "DefaultPlayerName", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "LeaderboardDialog::IsInGameEdition" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlayerAuthentication::DisplayAuthenticationBanner" + }, + "parameters": [ + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PlayerAuthentication::IsPlayerAuthenticated" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "PlayerNameInput", + "Text", + "=", + "PlayerAuthentication::Username()" + ] + }, + { + "type": { + "value": "TextInput::TextInputObject::SetDisabled" + }, + "parameters": [ + "PlayerNameInput", + "yes" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "LeaderboardDialog::IsInGameEdition" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PlayerAuthentication::HasPlayerLoggedIn" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "PlayerNameInput", + "Text", + "=", + "PlayerAuthentication::Username()" + ] + }, + { + "type": { + "value": "TextInput::TextInputObject::SetDisabled" + }, + "parameters": [ + "PlayerNameInput", + "yes" + ] + }, + { + "type": { + "value": "PlayerAuthentication::DisplayAuthenticationBanner" + }, + "parameters": [ + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Leaderboards::IsLeaderboardViewErrored" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "PlayerAuthentication::DisplayAuthenticationBanner" + }, + "parameters": [ + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Handle leaderboards.\nTo create a leaderboard, make sure your game is registered in Home > Profile > Games Dashboard and then, click on \"Manage game\" > Leaderboards. When a leaderboard is created, it should be available in the actions." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" + }, + "parameters": [ + "SubmitTextButton", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PlayerAuthentication::IsPlayerAuthenticated" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Leaderboards::SaveConnectedPlayerScore" + }, + "parameters": [ + "", + "LeaderboardId", + "Score" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PlayerAuthentication::IsPlayerAuthenticated" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Leaderboards::SavePlayerScore" + }, + "parameters": [ + "", + "LeaderboardId", + "Score", + "PlayerNameInput.Text()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PlayerAuthentication::HideAuthenticationBanner" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "Leaderboards::DisplayLeaderboard" + }, + "parameters": [ + "", + "LeaderboardId", + "yes" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the score.", + "fullName": "Score", + "functionType": "ExpressionAndCondition", + "name": "Score", + "sentence": "the score", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Score" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Score", + "name": "SetScore", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Score", + "=", + "Value" + ] + }, + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "ScoreLabels", + "Text", + "=", + "ScoreLabelText + Object.FormatScore(Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the best score of the object.", + "fullName": "Best score", + "functionType": "ExpressionAndCondition", + "name": "BestScore", + "sentence": "the best score", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BestScore" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "BestScore", + "name": "SetBestScore", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BestScore", + "=", + "Value" + ] + }, + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "BestScoreLabels", + "Text", + "=", + "BestScoreLabelText + Object.FormatScore(Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the formated score.", + "fullName": "Format score", + "functionType": "StringExpression", + "name": "FormatScore", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Format", + "=", + "\"Number\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Prefix + ToString(roundTo(Value, NumberDecimalPoint)) + Suffix" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Format", + "!=", + "\"Number\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Prefix + LeaderboardDialog::FormatTime(Value, Format) + Suffix" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + }, + { + "description": "Score", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the default player name.", + "fullName": "Default player name", + "functionType": "ExpressionAndCondition", + "name": "DefaultPlayerName", + "sentence": "the default player name", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "DefaultPlayerName" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DefaultPlayerName", + "name": "SetDefaultPlayerName", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "DefaultPlayerName", + "=", + "Value" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PlayerAuthentication::IsPlayerAuthenticated" + }, + "parameters": [] + }, + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "DefaultPlayerName", + "!=", + "\"0\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "PlayerNameInput", + "Text", + "=", + "DefaultPlayerName" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the player name.", + "fullName": "Player name", + "functionType": "ExpressionAndCondition", + "name": "PlayerName", + "sentence": "the player name", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "PlayerNameInput.Text::Value()" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the restart button of the dialog is clicked.", + "fullName": "Restart button clicked", + "functionType": "Condition", + "name": "IsRestartClicked", + "sentence": "Restart button of _PARAM0_ is clicked", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" + }, + "parameters": [ + "RetryTextButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlayerAuthentication::HideAuthenticationBanner" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the next button of the dialog is clicked.", + "fullName": "Next button clicked", + "functionType": "Condition", + "name": "IsNextClicked", + "sentence": "Next button of _PARAM0_ is clicked", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" + }, + "parameters": [ + "NextTextButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlayerAuthentication::HideAuthenticationBanner" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the back button of the dialog is clicked.", + "fullName": "Back button clicked", + "functionType": "Condition", + "name": "IsBackClicked", + "sentence": "Back button of _PARAM0_ is clicked", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" + }, + "parameters": [ + "BackTextButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlayerAuthentication::HideAuthenticationBanner" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the score has been sucessfully submitted by the dialog.", + "fullName": "Score is submitted", + "functionType": "Condition", + "name": "IsScoreSubmitted", + "sentence": "_PARAM0_ submitted a score", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Allow to try and submit again in case of error." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Leaderboards::HasPlayerJustClosedLeaderboardView" + }, + "parameters": [] + }, + { + "type": { + "value": "Leaderboards::HasLastSaveSucceeded" + }, + "parameters": [ + "LeaderboardId" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the leaderboard of the object.", + "fullName": "Leaderboard", + "functionType": "ExpressionAndCondition", + "name": "LeaderboardId", + "sentence": "the leaderboard", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "LeaderboardId" + ] + } + ] + } + ], + "expressionType": { + "type": "leaderboardId" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "LeaderboardId", + "name": "SetLeaderboardId", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LeaderboardId", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the title of the object.", + "fullName": "Title", + "functionType": "ExpressionAndCondition", + "name": "Title", + "private": true, + "sentence": "the title", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Title.Text::Value()" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Title", + "name": "SetTitle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "Title", + "Text", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "LeaderboardDialog::LeaderboardDialog", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "String", + "label": "Default player name", + "name": "DefaultPlayerName" + }, + { + "value": "", + "type": "LeaderboardId", + "label": "Leaderboard", + "name": "LeaderboardId" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "", + "hidden": true, + "name": "Score" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "Best score", + "hidden": true, + "name": "BestScore" + }, + { + "value": "Number", + "type": "Choice", + "label": "Format", + "group": "Score format", + "choices": [ + { + "label": "Number", + "value": "Number" + }, + { + "label": "MM:SS.ms", + "value": "MM:SS.ms" + }, + { + "label": "MM:SS", + "value": "MM:SS" + }, + { + "label": "SS.ms", + "value": "SS.ms" + }, + { + "label": "SS", + "value": "SS" + }, + { + "label": "ms", + "value": "ms" + }, + { + "label": "HH:MM:SS.ms", + "value": "HH:MM:SS.ms" + }, + { + "label": "HH:MM:SS", + "value": "HH:MM:SS" + } + ], + "name": "Format" + }, + { + "value": "", + "type": "String", + "label": "Prefix", + "group": "Score format", + "name": "Prefix" + }, + { + "value": "", + "type": "String", + "label": "Suffix", + "group": "Score format", + "name": "Suffix" + }, + { + "value": "3", + "type": "Number", + "label": "Round to decimal point", + "group": "Score format", + "name": "NumberDecimalPoint" + }, + { + "value": "Score: ", + "type": "String", + "label": "Score label", + "name": "ScoreLabelText" + }, + { + "value": "Best: ", + "type": "String", + "label": "Best score label", + "name": "BestScoreLabelText" + } + ], + "variants": [ + { + "areaMaxX": 688, + "areaMaxY": 480, + "areaMaxZ": 48, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "Grey and yellow", + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "ScoreLabel", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Time:", + "font": "Chango-Regular.ttf", + "textAlignment": "", + "characterSize": 40, + "color": { + "b": 79, + "g": 72, + "r": 72 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Time:", + "font": "Chango-Regular.ttf", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 40, + "lineHeight": 0, + "color": "72;72;79" + } + }, + { + "assetStoreId": "", + "name": "PlayerNameInput", + "type": "TextInput::TextInputObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "initialValue": "", + "placeholder": "PlayerName", + "fontResourceName": "Chango-Regular.ttf", + "fontSize": 40, + "inputType": "text", + "textColor": "72;72;79", + "fillColor": "231;232;243", + "fillOpacity": 255, + "borderColor": "255;255;255", + "borderOpacity": 255, + "borderWidth": 6, + "readOnly": false, + "disabled": false + } + }, + { + "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", + "name": "SubmitTextButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "Yellow button 2", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 0, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 16, + "RightPadding": 16, + "PressedLabelOffsetY": 10, + "BottomPadding": 32, + "TopPadding": 16, + "HoveredFadeOutDuration": 0.25, + "LabelText": "Send" + } + }, + { + "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", + "name": "RetryTextButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "Yellow button 2", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 16, + "RightPadding": 16, + "PressedLabelOffsetY": 10, + "BottomPadding": 32, + "TopPadding": 16, + "HoveredFadeOutDuration": 0.25, + "LabelText": "Restart" + } + }, + { + "assetStoreId": "", + "bottomMargin": 32, + "height": 128, + "leftMargin": 16, + "name": "Panel", + "rightMargin": 16, + "texture": "assets\\Grey Button_Idle.png", + "tiled": false, + "topMargin": 16, + "type": "PanelSpriteObject::PanelSprite", + "width": 128, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Title", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "string": "Game over", + "font": "", + "textAlignment": "center", + "characterSize": 60, + "color": { + "b": 79, + "g": 72, + "r": 72 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Game over", + "font": "", + "textAlignment": "center", + "verticalTextAlignment": "top", + "characterSize": 60, + "lineHeight": 0, + "color": "72;72;79" + } + }, + { + "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", + "name": "BackTextButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "Yellow button 2", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 16, + "RightPadding": 16, + "PressedLabelOffsetY": 10, + "BottomPadding": 32, + "TopPadding": 16, + "HoveredFadeOutDuration": 0.25, + "LabelText": "Back" + } + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Medal", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [] + }, + { + "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", + "name": "NextTextButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "Yellow button 2", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 16, + "RightPadding": 16, + "PressedLabelOffsetY": 10, + "BottomPadding": 32, + "TopPadding": 16, + "HoveredFadeOutDuration": 0.25, + "LabelText": "Next" + } + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "BestScoreLabel", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Best:", + "font": "", + "textAlignment": "", + "characterSize": 40, + "color": { + "b": 79, + "g": 72, + "r": 72 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Best:", + "font": "", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 40, + "lineHeight": 0, + "color": "72;72;79" + } + }, + { + "assetStoreId": "", + "name": "BitmapTitle", + "type": "BitmapText::BitmapTextObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "text": "Game over", + "opacity": 255, + "scale": 1, + "fontSize": 20, + "tint": "255;255;255", + "bitmapFontResourceName": "", + "textureAtlasResourceName": "", + "align": "center", + "verticalTextAlignment": "top" + } + }, + { + "assetStoreId": "", + "name": "BitmapScoreLabel", + "type": "BitmapText::BitmapTextObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "text": "Score:", + "opacity": 255, + "scale": 1, + "fontSize": 20, + "tint": "255;255;255", + "bitmapFontResourceName": "", + "textureAtlasResourceName": "", + "align": "left", + "verticalTextAlignment": "top" + } + }, + { + "assetStoreId": "", + "name": "BitmapBestScoreLabel", + "type": "BitmapText::BitmapTextObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "text": "Best:", + "opacity": 255, + "scale": 1, + "fontSize": 20, + "tint": "255;255;255", + "bitmapFontResourceName": "", + "textureAtlasResourceName": "", + "align": "left", + "verticalTextAlignment": "top" + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "folderName": "Bitmap labels", + "children": [ + { + "objectName": "BitmapTitle" + }, + { + "objectName": "BitmapScoreLabel" + }, + { + "objectName": "BitmapBestScoreLabel" + } + ] + }, + { + "objectName": "Title" + }, + { + "objectName": "ScoreLabel" + }, + { + "objectName": "BestScoreLabel" + }, + { + "objectName": "Medal" + }, + { + "objectName": "PlayerNameInput" + }, + { + "objectName": "SubmitTextButton" + }, + { + "objectName": "RetryTextButton" + }, + { + "objectName": "BackTextButton" + }, + { + "objectName": "NextTextButton" + }, + { + "objectName": "Panel" + } + ] + }, + "objectsGroups": [ + { + "name": "ActionTextButton", + "objects": [ + { + "name": "RetryTextButton" + }, + { + "name": "BackTextButton" + }, + { + "name": "NextTextButton" + } + ] + }, + { + "name": "Titles", + "objects": [ + { + "name": "Title" + }, + { + "name": "BitmapTitle" + } + ] + }, + { + "name": "ScoreLabels", + "objects": [ + { + "name": "ScoreLabel" + }, + { + "name": "BitmapScoreLabel" + } + ] + }, + { + "name": "BestScoreLabels", + "objects": [ + { + "name": "BestScoreLabel" + }, + { + "name": "BitmapBestScoreLabel" + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 71, + "layer": "", + "name": "ScoreLabel", + "persistentUuid": "e0571581-5b6f-4e0b-928a-92dd21b3851d", + "width": 606, + "x": 36, + "y": 41, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 96, + "layer": "", + "name": "PlayerNameInput", + "persistentUuid": "1b66c419-4bc7-406f-91e7-7deeb515ff67", + "width": 360, + "x": 40, + "y": 160, + "zOrder": 19, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "RetryTextButton", + "persistentUuid": "d9bfca46-e22c-42c9-a581-b88dbe1f5967", + "width": 0, + "x": 224, + "y": 320, + "zOrder": 35, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 48, + "height": 106, + "layer": "", + "name": "SubmitTextButton", + "persistentUuid": "3ad1036e-666f-4a8c-9b85-6d882e192ee8", + "width": 216, + "x": 432, + "y": 150, + "zOrder": 37, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 480, + "layer": "", + "name": "Panel", + "persistentUuid": "273f403b-d896-4fa8-81bd-ef1d5d6bd006", + "width": 688, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 1.0174418604651163, + "windowMask": false, + "selectedLayer": "" + } + } + ] + } + ] + }, + { + "author": "", + "category": "", + "extensionNamespace": "", + "fullName": "", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "", + "name": "AirControl3D", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "", + "tags": [], + "authorIds": [], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ { - "angle": 90, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "LargeBuildingA", - "persistentUuid": "f06efadf-649b-4cf3-a2ed-25adfb55b34a", - "width": 0, - "x": -2048, - "y": 2112, - "zOrder": 50, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, + "description": "Turn and move objects forward.", + "fullName": "3D air control", + "name": "AirControl3D", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "HasPressedMoveBackward", + "True", + "" + ] + }, + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "HasPressedMoveForward", + "True", + "" + ] + } + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "HasPressedMoveBackward", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CurrentForce", + "=", + "-Force" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "HasPressedMoveForward", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CurrentForce", + "=", + "Force" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Physics3D::Physics3DBehavior::ApplyForceAtCenter" + }, + "parameters": [ + "Object", + "Physics3D", + "XFromAngleAndDistance(Object.Angle(), CurrentForce)", + "YFromAngleAndDistance(Object.Angle(), CurrentForce)", + "0" + ] + } + ] + } + ], + "variables": [ + { + "name": "CurrentForce", + "type": "number", + "value": 0 + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "AirControl3D::AirControl3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Simulate a press of the move backward key.", + "fullName": "Simulate move backward key press", + "functionType": "Action", + "group": "Top-down walk state", + "name": "SimulateMoveBackwardKey", + "sentence": "Simulate pressing move backward key for _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "HadPressedMoveBackward", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HasPressedMoveBackwardLast", + "True", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HasPressedMoveBackward", + "True", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "AirControl3D::AirControl3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Simulate a press of the move forward key.", + "fullName": "Simulate move forward key press", + "functionType": "Action", + "group": "Top-down walk state", + "name": "SimulateMoveForwardKey", + "sentence": "Simulate pressing move forward key for _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "HadPressedMoveForward", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HasPressedMoveBackwardLast", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HasPressedMoveForward", + "True", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "AirControl3D::AirControl3D", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D physics engine", + "extraInformation": [ + "Physics3D::Physics3DBehavior" + ], + "choices": [], + "name": "Physics3D" + }, + { + "value": "4000", + "type": "Number", + "unit": "Newton", + "label": "Force", + "name": "Force" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "hidden": true, + "name": "HasPressedMoveForward" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "hidden": true, + "name": "HasPressedMoveBackward" + } + ], + "sharedPropertyDescriptors": [ + { + "value": "0", + "type": "Number", + "label": "", + "hidden": true, + "name": "Cos" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "Sin" + } + ] + } + ], + "eventsBasedObjects": [] + } + ], + "externalLayouts": [ + { + "associatedLayout": "Game", + "name": "Touch controls", + "instances": [ { - "angle": 90, + "angle": 0, "customSize": true, - "depth": 8, - "height": 384, - "layer": "", - "name": "RoadStraight", - "persistentUuid": "a8244263-7fac-480c-8710-06a78c500e94", - "width": 512, - "x": -1984, - "y": 3008, - "zOrder": 42, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": -90, - "customSize": false, - "height": 0, - "layer": "", - "name": "RoadIntersectionPath", - "persistentUuid": "109f2601-2b75-4462-86ef-e971e00d1221", - "width": 0, - "x": -1920, - "y": 2560, - "zOrder": 44, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 65, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "99e412c0-a22c-4772-aaa4-11d7356a0a0b", - "width": 0, - "x": -3456, - "y": 5120, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 61, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "3cc3334d-7f26-4e43-b9ae-1cb79823b08b", - "width": 0, - "x": 4480, - "y": 2432, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 77, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "0ad08b82-cc6f-4e47-b8d8-105508c828cd", - "width": 0, - "x": 5632, - "y": -640, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 127, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "3c708221-631f-44eb-970a-20632025ef55", - "width": 0, - "x": -4608, - "y": -1280, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 186, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "064cb7cd-1254-4b63-9f19-327619db650b", - "width": 0, - "x": 768, - "y": 5376, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 300, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "a45feb42-e790-4346-80a7-9b19cf827dc6", - "width": 0, - "x": 6016, - "y": 5120, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 315, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "bf30b634-c017-4a1f-b95d-8f56bb8bb703", - "width": 0, - "x": 6144, - "y": 1024, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 255, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "e3ca34a5-bfc6-4ef6-82ac-d5806c6ade12", - "width": 0, - "x": -1024, - "y": -2944, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 315, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "5361970d-57dd-49d5-8cf5-dc346013f6fd", - "width": 0, - "x": 3072, - "y": -4096, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 315, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "4c45061f-ef62-4a10-8c44-956d7ddc5e64", - "width": 0, - "x": 3200, - "y": -1664, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 315, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "f84b0986-298d-439c-8b3a-016aeda4fd5c", - "width": 0, - "x": 1408, - "y": -1792, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 325, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "69960099-26da-4e9e-99bf-53f491642e0b", - "width": 0, - "x": 5760, - "y": -3456, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 61, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "81d67980-48c0-4f09-9e0c-0e4ca7043345", - "width": 0, - "x": -3584, - "y": -3840, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 47, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "95e04ddf-e6fc-418e-a4db-03a49d4cdadd", - "width": 0, - "x": -5376, - "y": 1920, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 96, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "09b945b8-f879-4a21-8afa-62b9bcabb77d", - "width": 0, - "x": 1536, - "y": -3200, - "zOrder": 46, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 81, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "0a0211cf-e0f5-485c-9cd0-16b206107314", - "width": 0, - "x": 3328, - "y": 4352, - "zOrder": 46, + "depth": 32, + "height": 160, + "layer": "MobileControls", + "name": "SteerJoystick", + "persistentUuid": "d42256d9-4b75-48e5-8211-672b4a24b2ff", + "width": 160, + "x": 112, + "y": 592, + "zOrder": 25, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 103, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "ce007c64-db91-427e-b50b-ba07a1f8e747", - "width": 0, - "x": -896, - "y": 4352, - "zOrder": 46, + "angle": 0, + "customSize": true, + "depth": 32, + "height": 160, + "layer": "MobileControls", + "name": "SpeedJoystick", + "persistentUuid": "37b8a038-ac16-4e8b-8ed5-38629193ec1f", + "width": 160, + "x": 1168, + "y": 592, + "zOrder": 26, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 80, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "9db87156-732c-40bb-a128-c61241e5841b", - "width": 0, - "x": -2560, - "y": 3584, - "zOrder": 46, + "angle": 0, + "customSize": true, + "depth": 1.0013908205841446, + "height": 720, + "layer": "MobileControls", + "name": "ScreenOrientationChecker", + "persistentUuid": "eee10984-d670-48cb-b98e-b9cbe189e3f6", + "width": 1280, + "x": 0, + "y": 0, + "zOrder": 27, "numberProperties": [], "stringProperties": [], "initialVariables": [] - }, + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 0.546875, + "windowMask": false + } + }, + { + "associatedLayout": "Game", + "name": "UI", + "instances": [ { - "angle": 117, + "angle": 0, "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "e41ae06f-c7d3-4041-a54c-61eea4782aa9", - "width": 0, - "x": -4352, - "y": 512, - "zOrder": 46, + "height": 46, + "layer": "UI", + "name": "BestTimeText", + "persistentUuid": "6e4d78d7-24e8-4067-b908-0df6dd3a5883", + "width": 187, + "x": 5, + "y": 50, + "zOrder": 23, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 61, + "angle": 0, "customSize": false, "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "38c811e2-2946-43c3-bec5-3910c34774ea", + "layer": "UI", + "name": "TimeText", + "persistentUuid": "dab4abe8-05ed-4d32-bfea-02d1e58543ad", "width": 0, - "x": 3585, - "y": 512, - "zOrder": 46, + "x": 5, + "y": 0, + "zOrder": 24, "numberProperties": [], "stringProperties": [], "initialVariables": [] }, { - "angle": 325, - "customSize": false, - "height": 0, - "layer": "", - "name": "CommonTree", - "persistentUuid": "7a247fc9-d3e9-4fe9-aa36-412158e2efae", - "width": 0, - "x": -2688, - "y": -2047, - "zOrder": 46, + "angle": 0, + "customSize": true, + "depth": 0, + "height": 44, + "layer": "UI", + "name": "TutorialText", + "persistentUuid": "3403afd6-bf06-4ea9-a6b6-e5099f05416b", + "width": 604, + "x": 4, + "y": 688, + "zOrder": 27, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -50071,15 +50026,13 @@ "angle": 0, "customSize": false, "height": 0, - "layer": "", - "name": "Coin", - "persistentUuid": "a6bd15cc-17ed-4904-8dce-f728639a545c", - "rotationY": 90, + "layer": "UI", + "name": "RemainingText", + "persistentUuid": "14937948-fe0c-44db-9651-61a68bca0e1e", "width": 0, - "x": 2496, - "y": -1053, - "z": 155, - "zOrder": 27, + "x": 5, + "y": 110, + "zOrder": 41, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -50089,14 +50042,13 @@ "customSize": false, "height": 0, "layer": "", - "name": "Coin", - "persistentUuid": "d9e7ad70-9d32-467e-9357-66dcf441d32d", - "rotationY": 90, + "name": "Arrow", + "persistentUuid": "a501feba-0bb9-430d-bb1e-cbb8b54de6f0", "width": 0, - "x": 2496, - "y": -850, - "z": 155, - "zOrder": 27, + "x": 1332, + "y": -58, + "z": 10, + "zOrder": 42, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -50106,81 +50058,13 @@ "customSize": false, "height": 0, "layer": "", - "name": "Coin", - "persistentUuid": "78f946eb-b0f5-4a76-ab7a-e629994dfe91", - "rotationY": 90, + "name": "Dust", + "persistentUuid": "d7cd3367-3f3f-4e12-93f1-3e9b5eaddde2", "width": 0, - "x": 2496, - "y": -957, - "z": 155, - "zOrder": 27, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "editionSettings": { - "grid": true, - "gridType": "rectangular", - "gridWidth": 128, - "gridHeight": 128, - "gridOffsetX": 0, - "gridOffsetY": 0, - "gridColor": 10401023, - "gridAlpha": 0.8, - "snap": true, - "zoomFactor": 0.2817259932079715, - "windowMask": false - } - }, - { - "associatedLayout": "Game", - "name": "Touch controls", - "instances": [ - { - "angle": 0, - "customSize": true, - "depth": 32, - "height": 160, - "layer": "MobileControls", - "name": "SteerJoystick", - "persistentUuid": "d42256d9-4b75-48e5-8211-672b4a24b2ff", - "width": 160, - "x": 112, - "y": 592, - "zOrder": 25, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 32, - "height": 160, - "layer": "MobileControls", - "name": "SpeedJoystick", - "persistentUuid": "37b8a038-ac16-4e8b-8ed5-38629193ec1f", - "width": 160, - "x": 1168, - "y": 592, - "zOrder": 26, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 1.0013908205841446, - "height": 720, - "layer": "MobileControls", - "name": "ScreenOrientationChecker", - "persistentUuid": "eee10984-d670-48cb-b98e-b9cbe189e3f6", - "width": 1280, - "x": 0, - "y": 0, - "zOrder": 27, + "x": 1349, + "y": -111, + "z": 15, + "zOrder": 43, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -50191,13 +50075,16 @@ "gridType": "rectangular", "gridWidth": 32, "gridHeight": 32, + "gridDepth": 32, "gridOffsetX": 0, "gridOffsetY": 0, + "gridOffsetZ": 0, "gridColor": 10401023, "gridAlpha": 0.8, "snap": false, "zoomFactor": 0.546875, - "windowMask": false + "windowMask": false, + "selectedLayer": "" } } ] diff --git a/examples/3d-car-coin-hunt/assets/FoggySky.png b/examples/3d-car-coin-hunt/assets/FoggySky.png deleted file mode 100644 index c7edae3deac58c7d1913dee6d1d2b68f0c895e96..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3629 zcmZ`+cQhN0w~xJrpmuGF8b$3{yJ*Z>O(|`uQEEmSqGqkosu{DT#@8sds)^AURjald z6^WX)iy-3H_s)6megAoX+;z@9_ndq0IiGt!N!E8vSs3{k0RRAtxtWnI06_8Ar2x=V z{WZQdPWFEdkF}+}aXxxBt!1_XJBuEk?H`|Q{5t!6X7YX7;sBtCVG9};(ZzS$DQJqO`ZGUt(OP`cO` ziH$bs5_V@(r01b#rlh6#|3i{A> zw{#%dH;O3n;*3pU=3p!2=WE)?XOx?QuI@`s9u+bVBmZ7I}pT=fRKM z{2GRFKJXvr^OT~yB>y4Sb&rjP@N9#p_LMZ{qc$&UiK=Wxw5suGwfPE;NU=%PsQhn5 z{66!k2sv_g+?$&bmV=tI^Kulbzc~Bn59e+!br0s?9T|-}`O87}j^2W2`}4$&!+my- zr&GJVlpMR^aek&mTC&By0o@rzYbi%bIeh}64m;xDwrTZzMS&anP0D*LGm zK!|imcvDJt+0}A^P!TD)0u_Sj#nQ#I9y-_^_>O^k)kh^rf+CbJ6KX0cM_Tb29f)4Q za3e%BKJ6iYWx00|5k)cy_i!?yYr<32na_0a)Dw? zkAJLa@vKrUg~kHsqYN>T3p6Ko_o&lkR`o;ZpsNb*Tu>6tU{Fb(AOnQKjm!FU!q$6_ z?pU4wPjwRzCkl07y{(dE;m7-}+)cMf0p|?M>6&=qV?^I8Io-Zlts*q)U6VjY=dnP97w(*sFypbFMFnWyYx5AcCdk{0Ero%*O zsW+2~90~Y|J9)kFY178cia&DF=a0p)FLchzKzn4K>^{4LJ!>7wuYR_FThp;O@!YU- z5kUw;vCcjClh_jm)MEQOvuLoYMcQbl|~ z-VAS>q=~{NQ@qI@i{1czF{?mW`(e7U0x#pg*9YNiilBBz3`wXBsB+{hb(~+0vJpn$zTPg5rlufzyGA?xX`fpc zmcUB>N%itZv0}5wRFBgdr*14zu_3meTiSujL}eqxkW!4dO7m&PITO)OQav)bV{11$ zVbwXY2kdWOkg#?zvtLd#X9)c9yIN6<_eY;S{?GR+Wo{k@%~9=dgE)d8F}%eHZl=kGwaMj@p(H5QcJ9!r@iZ3mw| zg~)CJ!gI7VRK3VRQR|7&js@{UaL`k7c3KN161gXdXNG&9GmLs*tn_z1|8<&1kx&qs zQ!nTCWdcC*W>%Z-Ic~8Na1E|@7%XzZ1 znZoy6r#VV&C3K4kM;peVFS5{oqCKH&b?O}90k7IQZ@@28RP&{VoMgXVXb^qISIN&u{u?0Pj^hBo&L1DJdDC&i9-QOY22Jf=>Av+Wz@`R=#d7Qyg1Yuy)^6= zbcE)mYSVl#?LXbe9Sb`7NGv1?>Gn8HU|LyMbh`syc#v2-3NNu0Mocscn8jxWVT*9)UZPiuNq;J15KdY z&r6@N(%CJ_ZBx1Y44MlweXvWoAn`*Z#ITpW8N~kn|NU&BWlKp}y76EI%fZN^j)sM@ z^;#)R5z-Z%t{2^<{+T#m+$P{afXq!y#5eg~0*QZ+-t>shoHXP^q^|U!PkF%2cLO@H zEZf&`ZhJDl5SB7S;(0C3#92$9d5%+Ibnhz}MYLCYeZ8-~8Gj@CLk2%;h!UE%3gX{K~o2=*=c<5C)4Umrv)Dgvm}A%^>;7De^kG< z6=md@mHN#tpYlEt9TzT87Up_;czvk*jB7a98}tZfjQ6+JL&4g!Qq`3&TBG9Ck@Vj z(sG)<>{VZ#%5+JdtFa?p7|6t-%X16v*7!?53@5f_0iy5i@@Li3SDBIsGCpai3o2!? zo7tJ5&1wabrdWGAXI-imf!~*DtA?Lc4QP&-Fj6Iyg_cQMnhTjAi2c6S&t+cXRXljP zn1)eLTLqT|Y1A=&o^0lhK*(}{q0_all6t1zI!s8cf)(4<%;lWvS2OD?-x+kT(6~Pk zf6W{hnBHYx4unhKFzn}jonZa7e?th?GfH{kXzw7`AKr=xl^<*OT;L)nM(4HVL4GDr z{dO7#vu?x?8^wKK(;*wc7`57F&E_Ou&Bt|2 zSn8Sw>MTEM0SV`q#J=fOdA@Rzphk^WwnY%n_()VJe;n9ezxaQK8rFA!ha;e$bQW~U zGkLDuSF~D(3YP;Mor|8eqxE;kxyT*Yda^EXHTgweo*LnCZbzbnL*ujM9~j>YKQ2(Z zDxajlCGsJ3)z{gHTfYVt_WrDEux8CcZ@HyGe{27_wR4;1{q4JfhpZ0Y=4yPH-wf#klZjYZxBXb6W=%+{@9I}NNFai4{1QL%zU$IB^LAF@MSEA z%f%mpDzjbsiO!oY{`^caii|V%qkmU38RRl4s%CX_&)jZakQ^r4*Nb1=>g)}3Yn}#1 zRn>RL->dxR*K@Bw@rdi@*hB-E_HH+G3m=s_zK WZzj>rrv2r10CVFzMs>H`WBvmV!|q=I From 69ff380254e1cddc706d0ecd132b03da803ebb90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 21 Nov 2025 17:39:55 +0100 Subject: [PATCH 2/2] Remove invalid instances --- examples/3d-lane-runner/3d-lane-runner.json | 56 ++++++++------------- 1 file changed, 22 insertions(+), 34 deletions(-) diff --git a/examples/3d-lane-runner/3d-lane-runner.json b/examples/3d-lane-runner/3d-lane-runner.json index 2080ae478..04de1e0fe 100644 --- a/examples/3d-lane-runner/3d-lane-runner.json +++ b/examples/3d-lane-runner/3d-lane-runner.json @@ -1,7 +1,7 @@ { "firstLayout": "Menu", "gdVersion": { - "build": 244, + "build": 245, "major": 5, "minor": 5, "revision": 0 @@ -86,6 +86,7 @@ ], "playableDevices": [ "keyboard", + "mobile", "mobile" ], "extensionProperties": [], @@ -537,8 +538,7 @@ "smoothed": true, "userAdded": false } - ], - "resourceFolders": [] + ] }, "objects": [], "objectsFolderStructure": { @@ -575,8 +575,10 @@ "gridType": "rectangular", "gridWidth": 32, "gridHeight": 32, + "gridDepth": 32, "gridOffsetX": 0, "gridOffsetY": 0, + "gridOffsetZ": 0, "gridColor": 10401023, "gridAlpha": 0.8, "snap": true, @@ -815,6 +817,7 @@ "ambientLightColorB": 200, "ambientLightColorG": 200, "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 0.1, @@ -886,12 +889,14 @@ "gridType": "rectangular", "gridWidth": 32, "gridHeight": 32, + "gridDepth": 32, "gridOffsetX": 0, "gridOffsetY": 0, + "gridOffsetZ": 0, "gridColor": 10401023, "gridAlpha": 0.25, "snap": true, - "zoomFactor": 0.5117784035210265, + "zoomFactor": 0.44819780454104385, "windowMask": false, "selectedLayer": "" }, @@ -1359,36 +1364,6 @@ "numberProperties": [], "stringProperties": [], "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 160, - "layer": "UI", - "name": "CoinsScore", - "persistentUuid": "032a72df-d7e0-4d5f-a88e-4fe597c6ee0a", - "width": 512, - "x": 8, - "y": 0, - "zOrder": 9, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 57, - "layer": "UI", - "name": "HighScore", - "persistentUuid": "8376ce96-1bed-45b6-8b3c-d2b50a1207d9", - "width": 291, - "x": 8, - "y": 57, - "zOrder": 11, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] } ], "objects": [ @@ -3046,6 +3021,7 @@ "ambientLightColorB": 200, "ambientLightColorG": 200, "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 0.1, @@ -3121,6 +3097,7 @@ "ambientLightColorB": 200, "ambientLightColorG": 200, "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 0.1, @@ -3625,6 +3602,7 @@ "ambientLightColorB": 167797870, "ambientLightColorG": 6032144, "ambientLightColorR": 8563600, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 0.1, @@ -3658,6 +3636,7 @@ "ambientLightColorB": 3, "ambientLightColorG": 134217728, "ambientLightColorR": 1597197633, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 0.1, @@ -11297,6 +11276,7 @@ "ambientLightColorB": 200, "ambientLightColorG": 200, "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 3, @@ -18303,6 +18283,7 @@ "ambientLightColorB": 200, "ambientLightColorG": 200, "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 3, @@ -19747,6 +19728,7 @@ "ambientLightColorB": 200, "ambientLightColorG": 200, "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 3, @@ -20017,6 +19999,7 @@ "ambientLightColorB": 200, "ambientLightColorG": 200, "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 3, @@ -20280,6 +20263,7 @@ "ambientLightColorB": 200, "ambientLightColorG": 200, "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 3, @@ -24569,6 +24553,7 @@ "ambientLightColorB": 200, "ambientLightColorG": 200, "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 3, @@ -26332,6 +26317,7 @@ "ambientLightColorB": 200, "ambientLightColorG": 200, "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 3, @@ -38441,8 +38427,10 @@ "gridType": "rectangular", "gridWidth": 32, "gridHeight": 32, + "gridDepth": 32, "gridOffsetX": 0, "gridOffsetY": 0, + "gridOffsetZ": 0, "gridColor": 10401023, "gridAlpha": 0.8, "snap": false,